list.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. {% extends "misago/admin/generic/list.html" %}
  2. {% load i18n %}
  3. {% block page-actions %}
  4. <div class="page-actions">
  5. <a href="{% url 'misago:admin:users:warnings:new' %}" class="btn btn-success">
  6. <span class="fa fa-plus-circle"></span>
  7. {% trans "New level" %}
  8. </a>
  9. </div>
  10. {% endblock %}
  11. {% block table-header %}
  12. <th>{% trans "Warning level" %}</th>
  13. <th style="width: 20%">{% trans "Length" %}</th>
  14. <th style="width: 20%;">{% trans "Replying" %}</th>
  15. <th style="width: 20%;">{% trans "Starting threads" %}</th>
  16. {% for action in extra_actions %}
  17. <th style="width: 1%;">&nbsp;</th>
  18. {% endfor %}
  19. <th style="width: 1%;">&nbsp;</th>
  20. <th style="width: 1%;">&nbsp;</th>
  21. <th style="width: 1%;">&nbsp;</th>
  22. <th style="width: 1%;">&nbsp;</th>
  23. {% endblock table-header %}
  24. {% block table-row %}
  25. <td class="item-name">
  26. #{{ forloop.counter }} {{ item }}
  27. </td>
  28. <td>{{ item.length }}</td>
  29. <td>
  30. {% if item.restricts_posting_replies == 0 %}
  31. <div class="text-success">
  32. <span class="fa fa-check-circle"></span>
  33. {% trans "Not restricted" %}
  34. </div>
  35. {% elif item.restricts_posting_replies == 1 %}
  36. <div class="text-warning">
  37. <span class="fa fa-exclamation-circle"></span>
  38. {% trans "Moderated" %}
  39. </div>
  40. {% else %}
  41. <div class="text-danger">
  42. <span class="fa fa-times-circle"></span>
  43. {% trans "Forbidden" %}
  44. </div>
  45. {% endif %}
  46. </td>
  47. <td>
  48. {% if item.restricts_posting_threads == 0 %}
  49. <div class="text-success">
  50. <span class="fa fa-check-circle"></span>
  51. {% trans "Not restricted" %}
  52. </div>
  53. {% elif item.restricts_posting_threads == 1 %}
  54. <div class="text-warning">
  55. <span class="fa fa-exclamation-circle"></span>
  56. {% trans "Moderated" %}
  57. </div>
  58. {% else %}
  59. <div class="text-danger">
  60. <span class="fa fa-times-circle"></span>
  61. {% trans "Forbidden" %}
  62. </div>
  63. {% endif %}
  64. </td>
  65. {% for action in extra_actions %}
  66. <td class="row-action">
  67. <a href="{% url action.link rank_id=item.id %}" class="btn btn-{% if action.style %}{{ action.style }}{% else %}default{% endif %} tooltip-top" title="{{ action.name }}">
  68. <span class="{{ action.icon }}"></span>
  69. </a>
  70. </td>
  71. {% endfor %}
  72. <td class="row-action">
  73. {% if not forloop.last %}
  74. <form action="{% url 'misago:admin:users:warnings:down' warning_id=item.id %}" method="post">
  75. <button class="btn btn-default tooltip-top" title="{% trans "Move down" %}">
  76. {% csrf_token %}
  77. <span class="fa fa-chevron-down"></span>
  78. </button>
  79. </form>
  80. {% else %}
  81. &nbsp;
  82. {% endif %}
  83. </td>
  84. <td class="row-action">
  85. {% if not forloop.first %}
  86. <form action="{% url 'misago:admin:users:warnings:up' warning_id=item.id %}" method="post">
  87. <button class="btn btn-default tooltip-top" title="{% trans "Move up" %}">
  88. {% csrf_token %}
  89. <span class="fa fa-chevron-up"></span>
  90. </button>
  91. </form>
  92. {% else %}
  93. &nbsp;
  94. {% endif %}
  95. </td>
  96. <td class="row-action">
  97. <a href="{% url 'misago:admin:users:warnings:edit' warning_id=item.id %}" class="btn btn-primary tooltip-top" title="{% trans "Edit" %}">
  98. <span class="fa fa-pencil"></span>
  99. </a>
  100. </td>
  101. <td class="row-action">
  102. <form action="{% url 'misago:admin:users:warnings:delete' warning_id=item.id %}" method="post" class="delete-prompt">
  103. <button class="btn btn-danger tooltip-top" title="{% trans "Delete" %}">
  104. {% csrf_token %}
  105. <span class="fa fa-times"></span>
  106. </button>
  107. </form>
  108. </td>
  109. {% endblock %}
  110. {% block emptylist %}
  111. <td colspan="{{ 8|add:extra_actions_len }}">
  112. <p>{% trans "No warning levels are currently defined." %}</p>
  113. </td>
  114. {% endblock emptylist %}
  115. {% block javascripts %}
  116. <script type="text/javascript">
  117. $(function() {
  118. $('.delete-prompt').submit(function() {
  119. var decision = confirm("{% trans "Are you sure you want to delete this warning level?" %}");
  120. return decision;
  121. });
  122. });
  123. </script>
  124. {% endblock %}