This repository has been archived on 2025-03-01. You can view files and clone it, but cannot push or open issues or pull requests.
trantor/templates/user_admin.html
Las Zenow 6a3da59c75 Port the web to bootstrap5
So it is responsive in phones.
2021-05-01 11:08:35 +00:00

68 lines
1.8 KiB
HTML

{{template "header.html" .S}}
<h4>Add user:</h4>
<form class="row" method="POST" action="/admin/users/add/">
<div class="col-6 col-md-3">
<label class="col-form-label" for="username">Username</label>
<input class="form-control" type="text" id="username" name="username">
</div>
<div class="col-6 col-md-3">
<label class="col-form-label" for="role">Role</label>
<input class="form-control" type="text" id="role" name="role" value="moderator">
</div>
<div class="col-6 col-md-3">
<label class="col-form-label" for="password">Password</label>
<input class="form-control" type="password" id="password" name="password">
</div>
<div class="col-6 col-md-3">
<br />
<button type="submit" class="btn btn-primary" id="submit">Create</button>
</div>
</form>
<br />
<h4>Users:</h4>
<div class="table-responsive-md">
<table class="table">
<thead>
<th>username</th>
<th>role</th>
<th>password</th>
<th>last login</th>
</thead>
<tbody>
{{range .Users}}
<tr>
<td>{{.Username}}</td>
<td><form class="row" method="POST" action="/admin/users/">
<input type="hidden" id="username" name="username" value="{{.Username}}">
<div class="col">
<input type="text" id="role" name="role" value="{{.Role}}">
</div>
<div class="col">
<button type="submit" class="btn btn-primary">Update</button>
</div>
</form>
</td>
<td><form class="row form-inline" method="POST" action="/admin/users/">
<input type="hidden" id="username" name="username" value="{{.Username}}">
<div class="col">
<input type="password" id="password" name="password" placeholder="password">
</div>
<div class="col">
<button type="submit" class="btn btn-primary">Update</button>
</div>
</form>
</td>
<td>{{.LastLogin.Format "2006-01-02"}}</td>
</tr>
{{end}}
</tbody>
</table>
</div>
{{template "footer.html" .S}}