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>
|
|
|
|
{%else%}
|
|
|
|
<button class="ui button twitter" onclick="changeStatus({%.Id%},{%.Status%})">启用</button>
|
|
|
|
{%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" . %}
|