list.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. {% extends "misago/admin/generic/list.html" %}
  2. {% load i18n misago_admin_form misago_avatars %}
  3. {% block page-actions %}
  4. <div class="col-auto page-action">
  5. <a href="{% url 'misago:admin:users:accounts:new' %}" class="btn btn-primary">
  6. <span class="fa fa-plus-circle"></span>
  7. {% trans "New user" %}
  8. </a>
  9. </div>
  10. {% endblock %}
  11. {% block table-header %}
  12. <th style="width: 1%;">&nbsp;</th>
  13. <th>{% trans "User" %}</th>
  14. <th style="width: 1%;">&nbsp;</th>
  15. <th style="width: 1%;">&nbsp;</th>
  16. <th style="width: 200px;">{% trans "E-mail" %}</th>
  17. <th style="width: 128px;">{% trans "IP Address" %}</th>
  18. <th style="width: 150px;">{% trans "Rank" %}</th>
  19. <th style="width: 200px;">{% trans "Joined" %}</th>
  20. <th style="width: 128px;">{% trans "Posts" %}</th>
  21. {% for action in extra_actions %}
  22. <th style="width: 1%;">&nbsp;</th>
  23. {% endfor %}
  24. <th style="width: 1%;">&nbsp;</th>
  25. {% endblock table-header %}
  26. {% block table-row %}
  27. <td>
  28. <a href="{{ item.get_absolute_url }}">
  29. <img src="{{ item|avatar:24 }}" alt="{% trans "Avatar" %}" width="24" height="24">
  30. </a>
  31. </td>
  32. <td class="item-name {% if item.requires_activation %}text-muted{% endif %}">
  33. {% if item.is_deleting_account %}
  34. <a href="{{ item.get_absolute_url }}" title="{% trans "Is deleting their account" %}">
  35. <del>{{ item }}</del>
  36. </a>
  37. {% elif not item.is_active %}
  38. <a href="{{ item.get_absolute_url }}" title="{% trans "Is disabled by administrator" %}">
  39. <del>{{ item }}</del>
  40. </a>
  41. {% else %}
  42. <a href="{{ item.get_absolute_url }}">
  43. {{ item }}
  44. </a>
  45. {% endif %}
  46. </td>
  47. <td class="lead text-muted">
  48. {% if item.requires_activation_by_admin %}
  49. <span class="fa fa-eye tooltip-top" title="{% trans "Requires activation by administrator" %}"></span>
  50. {% elif item.requires_activation_by_user %}
  51. <span class="fa fa-ticket tooltip-top" title="{% trans "Has to activate account" %}"></span>
  52. {% else %}
  53. &nbsp;
  54. {% endif %}
  55. </td>
  56. <td class="lead text-muted">
  57. {% if item.is_superuser %}
  58. <span class="fa fa-star tooltip-top" title="{% trans "Super administrator" %}"></span>
  59. {% elif item.is_staff %}
  60. <span class="fa fa-star-half-o tooltip-top" title="{% trans "Administrator" %}"></span>
  61. {% else %}
  62. &nbsp;
  63. {% endif %}
  64. </td>
  65. <td>
  66. <a href="mailto:{{ item.email }}">{{ item.email }}</a>
  67. </td>
  68. <td>
  69. {% if item.joined_from_ip %}
  70. {{ item.joined_from_ip }}
  71. {% else %}
  72. <i>{% trans "IP removed" %}</i>
  73. {% endif %}
  74. </td>
  75. <td>
  76. {{ item.rank }}
  77. </td>
  78. <td>
  79. <abbr class="moment" data-iso="{{ item.joined_on.isoformat }}" data-format="LL"></abbr>
  80. </td>
  81. <td>
  82. {{ item.posts }}
  83. </td>
  84. {% for action in extra_actions %}
  85. <td class="row-action">
  86. <a href="{% url action.link pk=item.pk %}" class="btn btn-{% if action.style %}{{ action.style }}{% else %}default{% endif %} tooltip-top" title="{{ action.name }}">
  87. <span class="{{ action.icon }}"></span>
  88. </a>
  89. </td>
  90. {% endfor %}
  91. <td class="row-action">
  92. <a href="{% url 'misago:admin:users:accounts:edit' pk=item.pk %}" class="btn btn-primary tooltip-top" title="{% trans "Edit user" %}">
  93. <span class="fa fa-pencil"></span>
  94. </a>
  95. </td>
  96. {% endblock table-row %}
  97. {% block emptylist %}
  98. <td colspan="{{ 11|add:extra_actions_len }}">
  99. <p>{% trans "No users matching search criteria have been found." %}</p>
  100. </td>
  101. {% endblock emptylist %}
  102. {% block modal-title %}
  103. {% trans "Search users" %}
  104. {% endblock modal-title %}
  105. {% block modal-body %}
  106. <div class="row">
  107. <div class="col-md-6">
  108. {% form_row search_form.username %}
  109. </div>
  110. <div class="col-md-6">
  111. {% form_row search_form.email %}
  112. </div>
  113. </div>
  114. <div class="row">
  115. <div class="col-md-6">
  116. {% form_row search_form.rank %}
  117. </div>
  118. <div class="col-md-6">
  119. {% form_row search_form.role %}
  120. </div>
  121. </div>
  122. <div class="row">
  123. <div class="col-md-12">
  124. {% form_row search_form.profilefields %}
  125. </div>
  126. </div>
  127. <div class="row">
  128. <div class="col-md-6">
  129. {% form_row search_form.inactive %}
  130. </div>
  131. <div class="col-md-6">
  132. {% form_row search_form.disabled %}
  133. </div>
  134. </div>
  135. <div class="row">
  136. <div class="col-md-6">
  137. {% form_row search_form.is_deleting_account %}
  138. </div>
  139. <div class="col-md-6">
  140. {% form_row search_form.is_staff %}
  141. </div>
  142. </div>
  143. {% endblock modal-body %}