<%include ../layout/second_menu.html %>
<div class="panel-content">
    <div class="panel-title">
        <div class="title-main">
            <h2><%= secondMenu[action].title %></h2>
        </div>
    </div>
    <div class="content-wrap">
        <div class="c-header">
            <!--办事处筛选-->
            <div class="btn-group">
                <button type="button" class="btn btn-default dropdown-toggle btn-sm" data-toggle="dropdown"
                        aria-haspopup="true" aria-expanded="false">
                    办事处 <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <li><a href="#">广东办</a></li>
                    <li><a href="#">总部</a></li>
                </ul>
            </div>
        </div>
        <div class="c-body">
            <table class="table">
                <thead>
                <tr>
                    <th>姓名</th>
                    <th>办事处</th>
                    <th>权限</th>
                    <th width="100">操作</th>
                </tr>
                </thead>
                <tbody>
                <% managerList.forEach(function(manager) { %>
                <tr>
                    <td><%= manager.username %></td>
                    <td><%= manager.office %></td>
                    <td><%= manager.permissionStr %></td>
                    <td>
                        <a href="javascript:void(0);" class="edit btn btn-xs"
                            data-permission="<%= manager.permission %>" data-login="<%= manager.can_login %>"
                            data-id="<%= manager._id %>">编辑</a>
                        <% if (manager.super_admin !== 1) { %>
                        <a href="/manager/delete/<%= manager._id %>" class="btn btn-xs">删除</a>
                        <% } %>
                    </td>
                </tr>
                <% }) %>
                </tbody>
            </table>
            <nav aria-label="Page navigation">
                <%include ../layout/page.html %>
            </nav>
        </div>
    </div>
</div>
<script type="text/javascript" src="/web/users/js/manager.js"></script>
<div class="modal fade" id="edit-account" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">编辑账号</h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label>权限</label>
                    <div class="checkbox">
                        <label>
                            <input type="checkbox" name="permission[]" data-permission="manager"> 用户管理
                        </label>&nbsp;
                        <label>
                            <input type="checkbox" name="permission[]" data-permission="notify"> 通知管理
                        </label>&nbsp;
                        <label>
                            <input type="checkbox" name="permission[]" data-permission="stdBillsmain"> 清单规则编辑器
                        </label>&nbsp;
                        <label>
                            <input type="checkbox" name="permission[]" data-permission="rationRepository"> 定额编辑器
                        </label>&nbsp;
                        <label>
                            <input type="checkbox" name="permission[]" data-permission="report"> 报表模板
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label>禁止登录</label>
                    <div class="checkbox">
                        <label>
                            <input type="checkbox" name="can_login"> 是
                        </label>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" id="save-manager">确定</button>
            </div>
        </div>
    </div>
</div>