gocron/templates/user/index.html

73 lines
2.4 KiB
Go
Raw Normal View History

2018-01-28 07:48:37 +00:00
{% template "common/header" . %}
2017-10-01 13:49:46 +00:00
<div class="ui grid">
2018-01-28 07:48:37 +00:00
{% template "user/menu" . %}
2017-10-01 13:49:46 +00:00
<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>
2018-01-28 07:48:37 +00:00
{%range $i, $v := .Users%}
2017-10-01 13:49:46 +00:00
<tr>
2018-01-28 07:48:37 +00:00
<td>{%.Id%}</td>
<td>{%.Name%}</td>
<td>{%.Email%}</td>
<td>{%if .IsAdmin%}{%else%}{%end%}</td>
<td>{%if .Status%}{%else%}{%end%}</td>
2017-10-01 13:49:46 +00:00
<td class="operation">
2018-01-28 07:48:37 +00:00
<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%}">
2017-10-01 13:49:46 +00:00
<button class="ui button facebook"></button>
</a>
2018-01-28 07:48:37 +00:00
<button class="ui positive button" onclick="util.removeConfirm('/user/remove/{%.Id%}')"></button>
2017-10-01 13:49:46 +00:00
</td>
</tr>
2018-01-28 07:48:37 +00:00
{%end%}
2017-10-01 13:49:46 +00:00
</tbody>
</table>
2018-01-28 07:48:37 +00:00
{% template "common/pagination" .%}
2017-10-01 13:49:46 +00:00
</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>
2018-01-28 07:48:37 +00:00
{% template "common/footer" . %}