This commit is contained in:
arraykeys
2019-08-08 17:13:34 +08:00
parent e8e5966a8c
commit f0bf2d5fec
2885 changed files with 1195993 additions and 12 deletions
+75
View File
@@ -0,0 +1,75 @@
<style>
.forx {
display: none;
}
.selectator_element {
border-radius: 0;
}
</style>
{{$user:=.user}}
<div class="panel panel-default">
<div class="panel-body">
<form class="form-horizontal ajaxform" ajaxSuccess="success" ajaxAlways="always" method="post" action="/web/user/{{.action}}">
<input type="hidden" name="user_id" value="{{$user.user_id}}">
<div class="form-group">
<label class="col-sm-2 control-label"><span class="text-danger"> * </span>登录名</label>
<div class="col-sm-4">
<input type="text" name="username" class="form-control" {{if eq .action "edit"}}disabled{{end}} value="{{$user.username}}">
</div>
<div class="col-md-4">
<span class="text-danger"> * 请限制在15个字符以内</span>
</div>
</div>
<!-- <div class="form-group">
<label class="col-sm-2 control-label"><span class="text-danger"> * </span>昵称</label>
<div class="col-sm-4">
<input type="text" name="nickname" class="form-control" value="{{$user.nickname}}">
</div>
<div class="col-md-4">
<span class="text-danger"> * </span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"><span class="text-danger"> * </span>密码</label>
<div class="col-sm-4">
<input type="password" name="password" class="form-control" value="">
</div>
<div class="col-md-4">
<span class="text-danger"> * </span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"><span class="text-danger"> * </span>邮箱</label>
<div class="col-sm-4">
<input type="text" name="email" class="form-control" value="{{$user.email}}">
</div>
<div class="col-md-4">
<span class="text-danger"> * </span>
</div>
</div> -->
<div class="form-group">
<label class="col-md-2 control-label"><span class="text-danger"> * </span>角色</label>
<div class="col-md-4">
<select id="roles_selector" class="form-control" name="role_ids" size="1" multiple style="padding: 0;">
{{range $role := .roles}}
<option value="{{$role.role_id}}" {{if eq $role.is_default "1"}} selected {{end}}>{{$role.name}}</option>
{{end}}
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-success">保存</button>
</div>
</div>
</form>
</div>
</div>
<script type="text/javascript">
$(function() {
$('#roles_selector').selectator({
showAllOptionsOnFocus: true
});
})
</script>
@@ -0,0 +1,61 @@
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
<form action="/web/user/list" method="get">
<div class="col-md-3 col-md-offset-9">
<div class="input-group">
<input class="form-control" name="keyword" type="text" value="{{.keyword}}" placeholder="用户名">
<span class="input-group-btn">
<button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-search"></i></button>
</span>
</div>
</div>
</form>
</div>
</div>
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th class="center w8p">ID</th>
<th class="center w11p">昵称</th>
<th class="center w11p">登录名</th>
<th class="center w20p">角色</th>
<th class="center w15p">邮箱</th>
<th class="center w8p">状态</th>
<th class="center w11p">创建时间</th>
<th class="center">操作</th>
</tr>
</thead>
<tbody>
{{range $user := .users}}
<tr>
<td class="center">{{$user.user_id}}</td>
<td class="center">{{$user.nickname}}</td>
<td class="center">{{$user.username}}</td>
<td>
{{range $userId, $roleName := $.userRoles}} {{if eq $userId $user.user_id}} {{$roleName}} {{end}} {{end}}
</td>
<td class="center">{{$user.email}}</td>
<td class="center">
{{if eq $user.is_forbidden "0"}}
<span class="label label-success">正常</span> {{else}}
<span class="label label-danger">屏蔽</span> {{end}}
</td>
<td class="center">
{{dateFormat $user.create_time "Y-m-d H:i:s"}}
</td>
<td class="center">
<a name="edit" href="/web/user/edit?user_id={{$user.user_id}}"><i class="glyphicon glyphicon-pencil"> </i>修改</a> {{if eq $user.is_forbidden "0"}}
<a name="forbidden" data-toggle="confirmation" data-placement="left" data-title="确定禁用吗?" href="/web/user/forbidden?user_id={{$user.user_id}}"><i class="glyphicon glyphicon-remove"> </i>禁用</a> {{else}}
<a name="review" data-toggle="confirmation" data-placement="left" data-title="确定恢复吗?" href="/web/user/review?user_id={{$user.user_id}}"><i class="glyphicon glyphicon-ok"> </i>恢复</a> {{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
<div class="panel-footer pagebar">
{{str2html .page}}
</div>
</div>