ictgj-voting/templates/admin-users.html
2017-04-03 16:32:13 -05:00

32 lines
1005 B
HTML

<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>