list.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. {% extends "misago/admin/generic/list.html" %}
  2. {% load i18n misago_avatars misago_forms %}
  3. {% block page-actions %}
  4. <div class="page-actions">
  5. <a href="{% url 'misago:admin:users:accounts:new' %}" class="btn btn-success">
  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: 150px;">{% trans "Rank" %}</th>
  18. <th style="width: 200px;">{% trans "Joined" %}</th>
  19. <th style="width: 128px;">{% trans "Posts" %}</th>
  20. {% for action in extra_actions %}
  21. <th style="width: 1%;">&nbsp;</th>
  22. {% endfor %}
  23. <th style="width: 1%;">&nbsp;</th>
  24. {% endblock table-header %}
  25. {% block table-row %}
  26. <td>
  27. <a href="{{ item.get_absolute_url }}">
  28. <img src="{{ item|avatar:24 }}" alt="{% trans "Avatar" %}" width="24" height="24">
  29. </a>
  30. </td>
  31. <td class="item-name {% if item.requires_activation %}text-muted{% endif %}">
  32. <a href="{{ item.get_absolute_url }}">{{ item }}</a>
  33. </td>
  34. <td class="lead text-muted">
  35. {% if item.requires_activation_by_admin %}
  36. <span class="fa fa-eye tooltip-top" title="{% trans "Requires activation by administrator" %}"></span>
  37. {% elif item.requires_activation_by_user %}
  38. <span class="fa fa-ticket tooltip-top" title="{% trans "Has to activate account" %}"></span>
  39. {% else %}
  40. &nbsp;
  41. {% endif %}
  42. </td>
  43. <td class="lead text-muted">
  44. {% if item.is_superuser %}
  45. <span class="fa fa-star tooltip-top" title="{% trans "Super administrator" %}"></span>
  46. {% elif item.is_staff %}
  47. <span class="fa fa-star-half-o tooltip-top" title="{% trans "Administrator" %}"></span>
  48. {% else %}
  49. &nbsp;
  50. {% endif %}
  51. </td>
  52. <td>
  53. <a href="mailto:{{ item.email }}">{{ item.email }}</a>
  54. </td>
  55. <td>
  56. {{ item.rank }}
  57. </td>
  58. <td>
  59. <abbr class="tooltip-top dynamic time-ago" title="{{ item.joined_on }}" data-timestamp="{{ item.joined_on|date:"c" }}">
  60. {{ item.joined_on|date }}
  61. </abbr>
  62. </td>
  63. <td>
  64. {{ item.posts }}
  65. </td>
  66. {% for action in extra_actions %}
  67. <td class="row-action">
  68. <a href="{% url action.link user_id=item.id %}" class="btn btn-{% if action.style %}{{ action.style }}{% else %}default{% endif %} tooltip-top" title="{{ action.name }}">
  69. <span class="{{ action.icon }}"></span>
  70. </a>
  71. </td>
  72. {% endfor %}
  73. <td class="row-action">
  74. <a href="{% url 'misago:admin:users:accounts:edit' user_id=item.id %}" class="btn btn-primary tooltip-top" title="{% trans "Edit user" %}">
  75. <span class="fa fa-pencil"></span>
  76. </a>
  77. </td>
  78. {% endblock table-row %}
  79. {% block emptylist %}
  80. <td colspan="{{ 11|add:extra_actions_len }}">
  81. <p>{% trans "No users matching search criteria have been found." %}</p>
  82. </td>
  83. {% endblock emptylist %}
  84. {% block modal-title %}
  85. {% trans "Search users" %}
  86. {% endblock modal-title %}
  87. {% block modal-body %}
  88. <div class="row">
  89. <div class="col-md-6">
  90. {% form_row search_form.username %}
  91. </div>
  92. <div class="col-md-6">
  93. {% form_row search_form.email %}
  94. </div>
  95. </div>
  96. <div class="row">
  97. <div class="col-md-6">
  98. {% form_row search_form.rank %}
  99. </div>
  100. <div class="col-md-6">
  101. {% form_row search_form.role %}
  102. </div>
  103. </div>
  104. <div class="row">
  105. <div class="col-md-6">
  106. {% form_row search_form.inactive %}
  107. </div>
  108. <div class="col-md-6">
  109. {% form_row search_form.is_staff %}
  110. </div>
  111. </div>
  112. {% endblock modal-body %}