gocron/templates/user/index.html

73 lines
2.4 KiB
Go

{% template "common/header" . %}
<div class="ui grid">
{% template "user/menu" . %}
<div class="twelve wide column">
<div class="pageHeader">
<div class="segment">
<h3 class="ui dividing header">
<a href="/user/create">
<i class="large add icon"></i>
<div class="content">
</div>
</a>
</h3>
</div>
</div>
<table class="ui celled table">
<thead>
<tr>
<th>ID</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{%range $i, $v := .Users%}
<tr>
<td>{%.Id%}</td>
<td>{%.Name%}</td>
<td>{%.Email%}</td>
<td>{%if .IsAdmin%}{%else%}{%end%}</td>
<td>{%if .Status%}{%else%}{%end%}</td>
<td class="operation">
<a class="ui purple button" href="/user/edit/{%.Id%}"></a>
{%if eq .Status 1%}
<button class="ui button red" onclick="changeStatus({%.Id%},{%.Status%})"></button>&nbsp;&nbsp;
{%else%}
<button class="ui button twitter" onclick="changeStatus({%.Id%},{%.Status%})"></button>&nbsp;&nbsp;
{%end%}
<a href="/user/editPassword/{%.Id%}">
<button class="ui button facebook"></button>
</a>
<button class="ui positive button" onclick="util.removeConfirm('/user/remove/{%.Id%}')"></button>
</td>
</tr>
{%end%}
</tbody>
</table>
{% template "common/pagination" .%}
</div>
</div>
<script type="text/javascript">
function changeStatus(id ,status) {
var url = '';
if (status) {
url = '/user/disable';
} else {
url = '/user/enable';
}
url += '/' + id;
util.post(url,{}, function() {
location.reload();
});
}
</script>
{% template "common/footer" . %}