| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- {% extends '../layout/admin.html' %}
- {% block html_title %}グループ管理 · {% endblock %}
- {% block content_head %}
- <div class="header-wrap">
- <header id="page-header">
- <h1 class="title" id="">グループ管理</h1>
- </header>
- </div>
- {% endblock %}
- {% block content_main %}
- <div class="content-main">
- {% set smessage = req.flash('successMessage') %}
- {% if smessage.length %}
- <div class="alert alert-success">
- {{ smessage }}
- </div>
- {% endif %}
- {% set emessage = req.flash('errorMessage') %}
- {% if emessage.length %}
- <div class="alert alert-danger">
- {{ emessage }}
- </div>
- {% endif %}
- <div class="row">
- <div class="col-md-3">
- {% include './widget/menu.html' with {current: 'user-group'} %}
- </div>
- <div class="col-md-9">
- <p>
- <button data-toggle="collapse" class="btn btn-default" href="#createGroupForm">新規グループの作成</button>
- </p>
- <form role="form" action="/admin/user-group/create" method="post">
- <div id="createGroupForm" class="collapse">
- <div class="form-group">
- <label for="createGroupForm[userGroupName]">グループ名</label>
- <textarea class="form-control" name="createGroupForm[userGroupName]" placeholder="例: Group1"></textarea>
- </div>
- <button type="submit" class="btn btn-primary">作成する</button>
- </div>
- <input type="hidden" name="_csrf" value="{{ csrf() }}">
- </form>
- {% set createdUserGroup = req.flash('createdUserGroup') %}
- {% if createdUserGroup.length %}
- <div class="modal fade in" id="createdGroupModal">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title">グループを作成しました</h4>
- </div>
- <div class="modal-body">
- <p>
- 作成したグループにユーザを追加してください
- </p>
- <pre>{{ createdUserGroup.name }}</pre>
- </div>
- </div><!-- /.modal-content -->
- </div><!-- /.modal-dialog -->
- </div><!-- /.modal -->
- {% endif %}
- <div class="modal fade" id="admin-delete-user-group-modal">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title"><code id="admin-delete-user-group-name"></code>グループを削除しますか?</h4>
- </div>
- <div class="modal-body">
- <p>
- グループの削除オペレーションを行うと元に戻すことはできませんのでご注意ください。
- </p>
- <p>
- Related users:
- <ul class="list-inline">
- {% for dGroupRelatedUser in userGroups %}
- <li class="list-inline-item badge badge-primary">{{dGroupRelatedUser.name}}</li>
- {% endfor %}
- </ul>
- </p>
- <form method="post" id="admin-user-groups-delete">
- <input type="hidden" name="user-group_id" value="">
- <input type="hidden" name="_csrf" value="{{ csrf() }}">
- <button type="submit" value="" class="btn btn-danger">
- 実行
- </button>
- </form>
- </div>
- </div>
- <!-- /.modal-content -->
- </div>
- <!-- /.modal-dialog -->
- </div>
- <h2>グループ一覧</h2>
- <table class="table table-hover table-striped table-bordered table-user-list">
- <thead>
- <tr>
- <th width="100px">#</th>
- <th>名前</th>
- <th>ユーザ一覧</th>
- <th width="100px">作成日</th>
- <th width="90px">操作</th>
- </tr>
- </thead>
- <tbody>
- {% for sGroup in userGroups %}
- <tr>
- <td>
- <img src="{{ sGroup|picture }}" class="picture picture-rounded" />
- </td>
- <td>{{ sGroup.name }}</td>
- <td><ul class="list-inline">
- {% for user in userGroups %}
- <li class="list-inline-item badge badge-primary">{{user.name}}</li>
- {% endfor %}
- </ul></td>
- <td>{{ sGroup.createdAt|date('Y-m-d', sGroup.createdAt.getTimezoneOffset()) }}</td>
- <td>
- <div class="btn-group admin-group-menu">
- <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
- 編集
- <span class="caret"></span>
- </button>
- <ul class="dropdown-menu" role="menu">
- <li class="dropdown-header">編集メニュー</li>
- <li>
- <a href="">編集</a>
- </li>
- <li class="dropdown-button">
- <a href="#"
- data-user-group-id="{{ sGroup._id.toString() }}"
- data-user-group-name="{{ sGroup.name.toString() }}"
- data-related-users="{{ userGroups }}"
- data-target="#admin-delete-user-group-modal"
- data-toggle="modal" class="btn btn-block btn-danger">
- グループの削除
- </a>
- </li>
- </ul>
- </div>
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% include '../widget/pager.html' with {path: "/admin/user-groups", pager: pager} %}
- </div>
- </div>
- </div>
- {% endblock content_main %}
- {% block content_footer %}
- {% endblock content_footer %}
|