ictgj-voting/templates/admin-users.html

32 lines
1005 B
HTML
Raw Permalink Normal View History

2017-04-03 21:32:13 +00:00
<div class="bottom-space center">
<a id="btnAddUser" class="pure-button pure-button-success" href="/admin/users/new"><i class="fa fa-plus"></i> Add User</a>
</div>
<table id="users-table" class="hidden sortable pure-table pure-table-bordered center">
<thead>
<tr>
<th>Email</th>
<th></th>
</tr>
</thead>
<tbody>
{{ range $i, $v := .TemplateData.Users }}
<tr>
<td>{{ $v }}</td>
<td>
<a href="/admin/users/{{ $v }}/edit" class="pure-button pure-button-plain"><i class="fa fa-pencil"></i></a>
<a href="/admin/users/{{ $v }}/delete" class="pure-button pure-button-plain"><i class="fa fa-trash"></i></a>
</td>
</tr>
{{ end }}
</tbody>
</table>
<script>
snack.ready(function() {
var tableBody = document.querySelector("#users-table>tbody");
if(tableBody.children.length>0) {
// Show the table
document.getElementById('users-table').classList.remove('hidden');
}
});
</script>