123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- {{extend './common/layout.art'}}
- {{block 'main'}}
- <!-- 子模板的相对路径相对的是当前文件,因为它是由模板引擎解析的,而不是浏览器-->
- {{include './common/header.art'}}
- <!-- 主体内容 -->
- <div class="content">
- {{include './common/sider.art'}}
- <div class="main">
- <!-- 分类标题 -->
- <div class="title">
- <h4>用户</h4>
- <span>找到1个用户</span>
- <a href="/admin/user-edit" class="btn btn-primary new">新增用户</a>
- </div>
- <!-- /分类标题 -->
- <!-- 内容列表 -->
- <table class="table table-striped table-bordered table-hover custom-table">
- <thead>
- <tr>
- <th>ID</th>
- <th>用户名</th>
- <th>邮箱</th>
- <th>角色</th>
- <th>状态</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- {{each users}}
- <tr>
- <td>{{@$value._id}}</td>
- <td>{{$value.username}}</td>
- <td>{{$value.email}}</td>
- <td>{{$value.role == 'admin' ? '超级管理员' : '普通用户'}}</td>
- <td>{{$value.state ? '禁用' : '启用'}}</td>
- <td>
- <a href="/admin/user-edit?id={{@$value._id}}" class="glyphicon glyphicon-edit"></a>
- <i class="glyphicon glyphicon-remove delete" data-toggle="modal" data-target=".confirm-modal" data-id="{{@$value._id}}"></i>
- </td>
- </tr>
- {{/each}}
- </tbody>
- </table>
- <!-- /内容列表 -->
- <!-- 分页 -->
- <ul class="pagination">
- <li style="display: <%= page-1 < 1 ? 'none': 'inline' %>">
- <a href="/admin/user?page=<%=page-1%>">
- <span>«</span>
- </a>
- </li>
- <% for(var i = 1; i <= total; i++){ %>
- <li><a href="/admin/user?page=<%=i%>"><%=i%></a></li>
- <% } %>
- <li style="display: <%= page-0+1 > total ? 'none': 'inline' %>">
- <a href="/admin/user?page=<%=page-0+1%>">
- <span>»</span>
- </a>
- </li>
- </ul>
- <!-- /分页 -->
- </div>
- </div>
- <!-- /主体内容 -->
- <!-- 删除确认弹出框 -->
- <div class="modal fade confirm-modal">
- <div class="modal-dialog modal-lg">
- <form class="modal-content" action="/admin/user-delete">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal"><span>×</span></button>
- <h4 class="modal-title">请确认</h4>
- </div>
- <div class="modal-body">
- <p>您确定要删除这个用户吗?</p>
- <input type='hidden' name="id" id="deleteUserId" >
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
- <input type="submit" class="btn btn-primary">
- </div>
- </form>
- </div>
- </div>
- <!-- /删除确认弹出框 -->
- {{/block}}
- {{block 'script'}}
- <script>
- $('.delete').on('click', function() {
- var id = $(this).attr('data-id');
- $('#deleteUserId').val(id);
- })
- </script>
- {{/block}}
|