The version of vichan running on lainchan.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

216 lines
5.6KB

  1. {% for board_posts in posts %}
  2. <fieldset>
  3. <legend>
  4. <a href="?/{{ config.board_path|sprintf(board_posts.board.uri) }}{{ config.file_index }}">
  5. {{ config.board_abbreviation|sprintf(board_posts.board.uri) }}
  6. -
  7. {{ board_posts.board.title|e }}
  8. </a>
  9. </legend>
  10. {{ board_posts.posts|join('<hr>') }}
  11. </fieldset>
  12. {% endfor %}
  13. {% if mod|hasPermission(config.mod.view_notes) %}
  14. <fieldset id="notes">
  15. <legend>
  16. {% set notes_on_record = 'note' ~ (notes|count != 1 ? 's' : '') ~ ' on record' %}
  17. <legend>{{ notes|count }} {% trans notes_on_record %}</legend>
  18. </legend>
  19. {% if notes|count > 0 %}
  20. <table class="modlog">
  21. <tr>
  22. <th>{% trans 'Staff' %}</th>
  23. <th>{% trans 'Note' %}</th>
  24. <th>{% trans 'Date' %}</th>
  25. {% if mod|hasPermission(config.mod.remove_notes) %}
  26. <th>{% trans 'Actions' %}</th>
  27. {% endif %}
  28. </tr>
  29. {% for note in notes %}
  30. <tr>
  31. <td class="minimal">
  32. {% if note.username %}
  33. <a href="?/new_PM/{{ note.username|e }}">{{ note.username|e }}</a>
  34. {% else %}
  35. <em>{% trans 'deleted?' %}</em>
  36. {% endif %}
  37. </td>
  38. <td>
  39. {{ note.body }}
  40. </td>
  41. <td class="minimal">
  42. {{ note.time|date(config.post_date) }}
  43. </td>
  44. {% if mod|hasPermission(config.mod.remove_notes) %}
  45. <td class="minimal">
  46. <a href="?/IP/{{ ip|url_encode(true) }}/remove_note/{{ note.id }}">
  47. <small>[{% trans 'remove' %}]</small>
  48. </a>
  49. </td>
  50. {% endif %}
  51. </tr>
  52. {% endfor %}
  53. </table>
  54. {% endif %}
  55. {% if mod|hasPermission(config.mod.create_notes) %}
  56. <form action="" method="post" style="margin:0">
  57. <input type="hidden" name="token" value="{{ security_token }}">
  58. <table>
  59. <tr>
  60. <th>{% trans 'Staff' %}</th>
  61. <td>{{ mod.username|e }}</td>
  62. </tr>
  63. <tr>
  64. <th>
  65. <label for="note">{% trans 'Note' %}</label>
  66. </th>
  67. <td>
  68. <textarea id="note" name="note" rows="5" cols="30"></textarea>
  69. </td>
  70. </tr>
  71. <tr>
  72. <td></td>
  73. <td><input type="submit" value="{% trans 'New note' %}"></td>
  74. </tr>
  75. </table>
  76. </form>
  77. {% endif %}
  78. </fieldset>
  79. {% endif %}
  80. {% if bans|count > 0 and mod|hasPermission(config.mod.view_ban) %}
  81. <fieldset id="bans">
  82. {% set bans_on_record = 'ban' ~ (bans|count != 1 ? 's' : '') ~ ' on record' %}
  83. <legend>{{ bans|count }} {% trans bans_on_record %}</legend>
  84. {% for ban in bans %}
  85. <form action="" method="post" style="text-align:center">
  86. <input type="hidden" name="token" value="{{ security_token }}">
  87. <table style="width:400px;margin-bottom:10px;border-bottom:1px solid #ddd;padding:5px">
  88. <tr>
  89. <th>{% trans 'Status' %}</th>
  90. <td>
  91. {% if config.mod.view_banexpired and ban.expires != 0 and ban.expires < time() %}
  92. {% trans 'Expired' %}
  93. {% else %}
  94. {% trans 'Active' %}
  95. {% endif %}
  96. </td>
  97. </tr>
  98. <tr>
  99. <th>{% trans 'IP' %}</th>
  100. <td>{{ ban.mask }}</td>
  101. </tr>
  102. <tr>
  103. <th>{% trans 'Reason' %}</th>
  104. <td>
  105. {% if ban.reason %}
  106. {{ ban.reason }}
  107. {% else %}
  108. <em>{% trans 'no reason' %}</em>
  109. {% endif %}
  110. </td>
  111. </tr>
  112. <tr>
  113. <th>{% trans 'Board' %}</th>
  114. <td>
  115. {% if ban.board %}
  116. {{ config.board_abbreviation|sprintf(ban.board) }}
  117. {% else %}
  118. <em>{% trans 'all boards' %}</em>
  119. {% endif %}
  120. </td>
  121. </tr>
  122. <tr>
  123. <th>{% trans 'Set' %}</th>
  124. <td>{{ ban.created|date(config.post_date) }}</td>
  125. </tr>
  126. <tr>
  127. <th>{% trans 'Expires' %}</th>
  128. <td>
  129. {% if ban.expires %}
  130. {{ ban.expires|date(config.post_date) }}
  131. {% else %}
  132. <em>{% trans 'never' %}</em>
  133. {% endif %}
  134. </td>
  135. </tr>
  136. <tr>
  137. <th>{% trans 'Seen' %}</th>
  138. <td>
  139. {% if ban.seen %}
  140. {% trans 'Yes' %}
  141. {% else %}
  142. {% trans 'No' %}
  143. {% endif %}
  144. </td>
  145. </tr>
  146. <tr>
  147. <th>{% trans 'Staff' %}</th>
  148. <td>
  149. {% if ban.username %}
  150. {{ ban.username|e }}
  151. {% else %}
  152. <em>{% trans 'deleted?' %}</em>
  153. {% endif %}
  154. </td>
  155. </tr>
  156. </table>
  157. <input type="hidden" name="ban_id" value="{{ ban.id }}">
  158. <input type="submit" name="unban" value="{% trans 'Remove ban' %}">
  159. </form>
  160. {% endfor %}
  161. </fieldset>
  162. {% endif %}
  163. {% if mod|hasPermission(config.mod.ban) %}
  164. <fieldset>
  165. <legend>{% trans 'New ban' %}</legend>
  166. {% set redirect = '?/IP/' ~ ip ~ '#bans' %}
  167. {% include 'mod/ban_form.html' %}
  168. </fieldset>
  169. {% endif %}
  170. {% if logs|count > 0 %}
  171. <fieldset id="history">
  172. <legend>History</legend>
  173. <table class="modlog" style="width:100%">
  174. <tr>
  175. <th>{% trans 'Staff' %}</th>
  176. <th>{% trans 'Time' %}</th>
  177. <th>{% trans 'Board' %}</th>
  178. <th>{% trans 'Action' %}</th>
  179. </tr>
  180. {% for log in logs %}
  181. <tr>
  182. <td class="minimal">
  183. {% if log.username %}
  184. <a href="?/log:{{ log.username|e }}">{{ log.username|e }}</a>
  185. {% elseif log.mod == -1 %}
  186. <em>system</em>
  187. {% else %}
  188. <em>{% trans 'deleted?' %}</em>
  189. {% endif %}
  190. </td>
  191. <td class="minimal">
  192. <span title="{{ log.time|date(config.post_date) }}">{{ log.time|ago }}</span>
  193. </td>
  194. <td class="minimal">
  195. {% if log.board %}
  196. <a href="?/{{ config.board_path|sprintf(log.board) }}{{ config.file_index }}">{{ config.board_abbreviation|sprintf(log.board) }}</a>
  197. {% else %}
  198. -
  199. {% endif %}
  200. </td>
  201. <td>
  202. {{ log.text }}
  203. </td>
  204. </tr>
  205. {% endfor %}
  206. </table>
  207. </fieldset>
  208. {% endif %}