statping/source/tmpl/users.gohtml

35 lines
1.2 KiB
Plaintext
Raw Normal View History

2018-12-04 04:17:29 +00:00
{{define "title"}}Statping | Users{{end}}
2018-10-02 06:21:14 +00:00
{{define "content"}}
2018-06-24 11:51:07 +00:00
<div class="container col-md-7 col-sm-12 mt-md-5 bg-light">
2018-06-11 03:41:02 +00:00
{{template "nav"}}
2018-10-02 06:21:14 +00:00
<div class="col-12">
2018-06-10 01:31:13 +00:00
<h3>Users</h3>
2018-10-02 06:21:14 +00:00
<table class="table table-striped">
<thead>
<tr>
<th scope="col">Username</th>
<th scope="col"></th>
</tr>
</thead>
2018-11-13 19:28:21 +00:00
<tbody id="users_table">
2018-10-02 06:21:14 +00:00
{{range .}}
2018-11-13 19:28:21 +00:00
<tr id="user_{{.Id}}">
2018-10-02 06:21:14 +00:00
<td>{{.Username}}</td>
2018-11-13 19:28:21 +00:00
<td class="text-right">
{{if Auth}}<div class="btn-group">
2018-10-21 16:22:26 +00:00
<a href="/user/{{.Id}}" class="btn btn-outline-secondary"><i class="fas fa-user-edit"></i> Edit</a>
<a href="/api/users/{{.Id}}" class="ajax_delete btn btn-danger" data-method="DELETE" data-obj="user_{{.Id}}" data-id="{{.Id}}"><i class="fas fa-times"></i></a>
</div>{{end}}
2018-10-02 06:21:14 +00:00
</td>
</tr>
{{end}}
</tbody>
</table>
{{if Auth}}
<h3>Create User</h3>
{{template "form_user" NewUser}}
{{end}}
2018-10-02 06:21:14 +00:00
</div>
</div>
{{end}}