user-group-detail.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. <div class="modal fade" id="admin-add-user-group-relation-modal">
  30. <div class="modal-dialog">
  31. <div class="modal-content">
  32. <div class="modal-header">
  33. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  34. <h4 class="modal-title">
  35. グループにユーザを追加します</h4>
  36. </div>
  37. <div class="modal-body">
  38. <p>
  39. ユーザ名を入力してください。
  40. </p>
  41. <form role="form" action="/admin/user-group-relation/create" method="post">
  42. <p>
  43. Add related user:
  44. <input type="text" name="user_name">
  45. </p>
  46. <input type="hidden" name="user_group_id" value="{{userGroup.id}}">
  47. <input type="hidden" name="_csrf" value="{{ csrf() }}">
  48. <button type="submit" value="" class="btn btn-danger">
  49. 実行
  50. </button>
  51. </form>
  52. </div>
  53. </div>
  54. <!-- /.modal-content -->
  55. </div>
  56. <!-- /.modal-dialog -->
  57. </div>
  58. <h2>ユーザー一覧</h2>
  59. <table class="table table-hover table-striped table-bordered table-user-list">
  60. <thead>
  61. <tr>
  62. <th width="100px">#</th>
  63. <th>
  64. <code>username</code>
  65. </th>
  66. <th>名前</th>
  67. <th width="100px">作成日</th>
  68. <th width="150px">最終ログイン</th>
  69. <th width="90px">操作</th>
  70. </tr>
  71. </thead>
  72. <tbody>
  73. {% for sRelation in userGroupRelations %}
  74. {% set sUser = sRelation.relatedUser%}
  75. <tr>
  76. <td>
  77. <img src="{{ sRelation.relatedUser|picture }}" class="picture picture-rounded" />
  78. </td>
  79. <td>
  80. <strong>{{ sRelation.relatedUser.username }}</strong>
  81. </td>
  82. <td>{{ sRelation.relatedUser.name }}</td>
  83. <td>{{ sRelation.relatedUser.createdAt|date('Y-m-d', sRelation.relatedUser.createdAt.getTimezoneOffset()) }}</td>
  84. <td>
  85. {% if sRelation.relatedUser.lastLoginAt %} {{ sRelation.relatedUser.lastLoginAt|date('Y-m-d H:i', sRelation.relatedUser.createdAt.getTimezoneOffset()) }} {% endif %}
  86. </td>
  87. <td>
  88. <div class="btn-group admin-user-menu">
  89. <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
  90. 編集
  91. <span class="caret"></span>
  92. </button>
  93. <ul class="dropdown-menu" role="menu">
  94. <li class="dropdown-header">編集メニュー</li>
  95. <li>
  96. <a href="">編集</a>
  97. </li>
  98. <li class="divider"></li>
  99. <li class="dropdown-button">
  100. <form action="/admin/user-group-relation/{{userGroup.name}}/remove-relation/{{ sRelation.relatedUser._id.toString() }}" method="post">
  101. <input type="hidden" name="_csrf" value="{{ csrf() }}">
  102. <button type="submit" class="btn btn-block btn-danger">グループから外す</button>
  103. </form>
  104. </li>
  105. </ul>
  106. </div>
  107. </td>
  108. </tr>
  109. {% endfor %}
  110. <tr>
  111. <td></td>
  112. <td><button type="button" class="btn btn-primary" data-target="#admin-add-user-group-relation-modal" data-toggle="modal"><i class="fa fa-plus"></i></button></td>
  113. <td></td>
  114. <td></td>
  115. <td></td>
  116. <td></td>
  117. </tr>
  118. </tbody>
  119. </table>
  120. <!-- {% include '../widget/pager.html' with {path: "/admin/user-group-detail", pager: pager} %} -->
  121. </div>
  122. </div>
  123. </div>
  124. {% endblock content_main %}
  125. {% block content_footer %}
  126. {% endblock content_footer %}