Hi… I am well aware that this diff view is very suboptimal. It will be fixed when the refactored server comes along!
Use a table to display client list
body {
font-family: sans-serif;
margin: 0;
}
main {
padding: 0 5px;
max-width: 800px;
margin: 0 auto;
}
table {
border-collapse: collapse;
}
td, th {
border: 1px solid black;
padding: 5px;
}
{{ template "head.html" }}
<main>
<h1>sinwon</h1>
<p>Welcome, {{ .Me.Username }}!</p>
<form method="post">
{{ if .Me.Admin }}
<a href="/user/new"><button type="button">Create user</button></a>
<a href="/client/new"><button type="button">Register new client</button></a>
{{ end }}
<a href="/user/{{ .Me.ID }}"><button type="button">Settings</button></a>
<button type="submit" formaction="/logout">Logout</button>
</form>
{{ if .Me.Admin }}
{{ with .Clients }}
<p>{{ . | len }} clients registered:</p>
<ul>
<table> <tr> <th>Client ID</th> <th>Name</th> </tr>
{{ range . }}
<li><a href="/client/{{ .ID }}"><code>{{ .ClientID }}</code></a></li>
<tr>
<td><a href="/client/{{ .ID }}"><code>{{ .ClientID }}</code></a></td>
<td>{{ .ClientName }}</td>
</tr>
{{ end }}
</ul>
</table>
{{ else }}
<p>No client registered yet.</p>
{{ end }}
{{ end }}
</main>
{{ template "foot.html" }}