list.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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:ranks:new' %}" class="btn btn-success">
  6. <span class="fa fa-plus-circle"></span>
  7. {% trans "New rank" %}
  8. </a>
  9. </div>
  10. {% endblock %}
  11. {% block table-header %}
  12. <th style="width: 25%;">{% trans "Rank" %}</th>
  13. <th>{% trans "Title" %}</th>
  14. <th style="width: 120px;">{% trans "Special" %}</th>
  15. {% for action in extra_actions %}
  16. <th style="width: 1%;">&nbsp;</th>
  17. {% endfor %}
  18. <th style="width: 1%;">&nbsp;</th>
  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. <th style="width: 1%;">&nbsp;</th>
  24. {% endblock table-header %}
  25. {% block table-row %}
  26. <td class="item-name">
  27. {{ item }}
  28. </td>
  29. <td>
  30. {% if item.title %}
  31. {% trans item.title %}
  32. {% else %}
  33. <i class="text-muted">{% trans "No title set" %}</i>
  34. {% endif %}
  35. </td>
  36. <td class="lead text-muted">
  37. {% if item.is_tab %}
  38. <div class="fa fa-list tooltip-top" title="{% trans "Has page on users list." %}"></div>
  39. {% endif %}
  40. {% if item.is_on_index %}
  41. <div class="fa fa-bookmark tooltip-top" title="{% trans "Users online displayed on index." %}"></div>
  42. {% endif %}
  43. {% if item.is_default %}
  44. <div class="fa fa-star tooltip-top" title="{% trans "This is default rank assigned to new members." %}"></div>
  45. {% endif %}
  46. </td>
  47. {% for action in extra_actions %}
  48. <td class="row-action">
  49. <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 }}">
  50. <span class="{{ action.icon }}"></span>
  51. </a>
  52. </td>
  53. {% endfor %}
  54. <td class="row-action">
  55. <a href="{% url 'misago:admin:users:ranks:users' rank_id=item.id %}" class="btn btn-primary tooltip-top" title="{% trans "Users with rank" %}">
  56. <span class="fa fa-users"></span>
  57. </a>
  58. </td>
  59. <td class="row-action">
  60. {% if not item.is_default %}
  61. <form action="{% url 'misago:admin:users:ranks:default' rank_id=item.id %}" method="post">
  62. <button class="btn btn-warning tooltip-top" title="{% trans "Make default" %}">
  63. {% csrf_token %}
  64. <span class="fa fa-star"></span>
  65. </button>
  66. </form>
  67. {% else %}
  68. &nbsp;
  69. {% endif %}
  70. </td>
  71. <td class="row-action">
  72. {% if not forloop.last %}
  73. <form action="{% url 'misago:admin:users:ranks:down' rank_id=item.id %}" method="post">
  74. <button class="btn btn-default tooltip-top" title="{% trans "Move down" %}">
  75. {% csrf_token %}
  76. <span class="fa fa-chevron-down"></span>
  77. </button>
  78. </form>
  79. {% else %}
  80. &nbsp;
  81. {% endif %}
  82. </td>
  83. <td class="row-action">
  84. {% if not forloop.first %}
  85. <form action="{% url 'misago:admin:users:ranks:up' rank_id=item.id %}" method="post">
  86. <button class="btn btn-default tooltip-top" title="{% trans "Move up" %}">
  87. {% csrf_token %}
  88. <span class="fa fa-chevron-up"></span>
  89. </button>
  90. </form>
  91. {% else %}
  92. &nbsp;
  93. {% endif %}
  94. </td>
  95. <td class="row-action">
  96. <a href="{% url 'misago:admin:users:ranks:edit' rank_id=item.id %}" class="btn btn-primary tooltip-top" title="{% trans "Edit" %}">
  97. <span class="fa fa-pencil"></span>
  98. </a>
  99. </td>
  100. <td class="row-action">
  101. <form action="{% url 'misago:admin:users:ranks:delete' rank_id=item.id %}" method="post" class="delete-prompt">
  102. <button class="btn btn-danger tooltip-top" title="{% trans "Delete" %}">
  103. {% csrf_token %}
  104. <span class="fa fa-times"></span>
  105. </button>
  106. </form>
  107. </td>
  108. {% endblock %}
  109. {% block emptylist %}
  110. <td colspan="{{ 8|add:extra_actions_len }}">
  111. <p>{% trans "No ranks are currently defined." %}</p>
  112. </td>
  113. {% endblock emptylist %}
  114. {% block javascripts %}
  115. <script type="text/javascript">
  116. $(function() {
  117. $('.delete-prompt').submit(function() {
  118. var decision = confirm("{% trans "Are you sure you want to delete this rank?" %}");
  119. return decision;
  120. });
  121. });
  122. </script>
  123. {% endblock %}