user-groups.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. {% extends '../layout/admin.html' %}
  2. {% block html_title %}グループ管理 · {% endblock %}
  3. {% block content_head %}
  4. <div class="header-wrap">
  5. <header id="page-header">
  6. <h1 class="title" id="">グループ管理</h1>
  7. </header>
  8. </div>
  9. {% endblock %}
  10. {% block content_main %}
  11. <div class="content-main">
  12. {% set smessage = req.flash('successMessage') %}
  13. {% if smessage.length %}
  14. <div class="alert alert-success">
  15. {{ smessage }}
  16. </div>
  17. {% endif %}
  18. {% set emessage = req.flash('errorMessage') %}
  19. {% if emessage.length %}
  20. <div class="alert alert-danger">
  21. {{ emessage }}
  22. </div>
  23. {% endif %}
  24. <div class="row">
  25. <div class="col-md-3">
  26. {% include './widget/menu.html' with {current: 'user-group'} %}
  27. </div>
  28. <div class="col-md-9">
  29. <p>
  30. <button data-toggle="collapse" class="btn btn-default" href="#createGroupForm">新規グループの作成</button>
  31. </p>
  32. <form role="form" action="/admin/group/create" method="post">
  33. <div id="createGroupForm" class="collapse">
  34. <div class="form-group">
  35. <label for="createGroupForm[userGroupName]">グループ名</label>
  36. <textarea class="form-control" name="createGroupForm[userGroupName]" placeholder="例: Group1"></textarea>
  37. </div>
  38. <button type="submit" class="btn btn-primary">作成する</button>
  39. </div>
  40. <input type="hidden" name="_csrf" value="{{ csrf() }}">
  41. </form>
  42. {% set createdGroup = req.flash('createdGroup') %}
  43. {% if createdGroup.length %}
  44. <div class="modal fade in" id="createdGroupModal">
  45. <div class="modal-dialog">
  46. <div class="modal-content">
  47. <div class="modal-header">
  48. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  49. <h4 class="modal-title">グループを作成しました</h4>
  50. </div>
  51. <div class="modal-body">
  52. <p>
  53. 作成したにユーザを追加してください
  54. </p>
  55. <pre>{% for cGroup in createdGroup %}{{ cGroup.name }}<br>{% endfor %}</pre>
  56. </div>
  57. </div><!-- /.modal-content -->
  58. </div><!-- /.modal-dialog -->
  59. </div><!-- /.modal -->
  60. {% endif %}
  61. <h2>グループ一覧</h2>
  62. <table class="table table-hover table-striped table-bordered table-user-list">
  63. <thead>
  64. <tr>
  65. <th width="100px">#</th>
  66. <th>名前</th>
  67. <th width="100px">作成日</th>
  68. <th width="90px">操作</th>
  69. </tr>
  70. </thead>
  71. <tbody>
  72. {% for sGroup in userGroups %}
  73. <tr>
  74. <td>
  75. <img src="{{ sGroup|picture }}" class="picture picture-rounded" />
  76. </td>
  77. <td>{{ sGroup.name }}</td>
  78. <td>{{ sGroup.createdAt|date('Y-m-d', sGroup.createdAt.getTimezoneOffset()) }}</td>
  79. <td>
  80. <div class="btn-group admin-group-menu">
  81. <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
  82. 編集
  83. <span class="caret"></span>
  84. </button>
  85. <ul class="dropdown-menu" role="menu">
  86. <li class="dropdown-header">編集メニュー</li>
  87. <li>
  88. <a href="">編集</a>
  89. </li>
  90. </ul>
  91. </div>
  92. </td>
  93. </tr>
  94. {% endfor %}
  95. </tbody>
  96. </table>
  97. {% include '../widget/pager.html' with {path: "/admin/groups", pager: pager} %}
  98. </div>
  99. </div>
  100. </div>
  101. {% endblock content_main %}
  102. {% block content_footer %}
  103. {% endblock content_footer %}