base.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. {% extends "misago/base.html" %}
  2. {% load humanize i18n misago_avatars misago_dates misago_shorthands %}
  3. {% block content %}
  4. <div class="container">
  5. {% block threads-list %}
  6. <div class="threads-list">
  7. {% block threads-panel %}
  8. <div class="table-panel">
  9. <ul class="list-group">
  10. {% for thread in threads %}
  11. <li class="list-group-item {{ thread.is_read|iffalse:"new" }}">
  12. <div class="row">
  13. <div class="col-md-7">
  14. {% if thread.is_pinned %}
  15. {% if thread.is_read %}
  16. <span class="thread-icon tooltip-top fa fa-star-o fa-lg fa-fw" title="{% trans "Pinned, has no unread posts" %}"></span>
  17. {% else %}
  18. <span class="thread-icon tooltip-top fa fa-star fa-lg fa-fw" title="{% trans "Pinned, has unread posts" %}"></span>
  19. {% endif %}
  20. {% else %}
  21. {% if thread.is_read %}
  22. <span class="thread-icon tooltip-top fa fa-circle-thin fa-lg fa-fw" title="{% trans "Thread has no unread posts" %}"></span>
  23. {% else %}
  24. <span class="thread-icon tooltip-top fa fa-circle fa-lg fa-fw" title="{% trans "Thread has unread posts" %}"></span>
  25. {% endif %}
  26. {% endif %}
  27. {% if thread.is_read %}
  28. <a href="{{ thread.get_absolute_url }}" class="item-title">
  29. {% else %}
  30. <a href="{{ thread.get_new_reply_url }}" class="item-title">
  31. {% endif %}
  32. {{ thread }}
  33. </a>
  34. </div>
  35. {% block thread-extra %}
  36. <div class="col-md-5 thread-stats">
  37. {% if threads_actions %}
  38. <a href="#" class="thread-check">
  39. <span class="fa fa-check"></span>
  40. <input type="checkbox" form="threads-actions" name="item" value="{{ thread.pk }}"{% if thread.pk in selected_threads %}checked="checked"{% endif %}>
  41. </a>
  42. {% endif %}
  43. {% block thread-stats %}
  44. <a href="{{ thread.get_last_reply_url }}" class="last-post">
  45. <span class="dynamic time-ago-compact tooltip-top" data-timestamp="{{ thread.last_post_on|date:"c" }}" title="{% blocktrans with last_post=thread.last_post_on|date:"DATETIME_FORMAT" %}Last post from {{ last_post }}{% endblocktrans %}">{{ thread.last_post_on|compact_date|lower }}</span>
  46. </a>
  47. {% if thread.last_poster_id %}
  48. <a href="{% url USER_PROFILE_URL user_slug=thread.last_poster_slug user_id=thread.last_poster_id %}" class="thread-author tooltip-top" title="{% blocktrans with user=thread.last_poster_name %}Last post by {{ user }}{% endblocktrans %}">
  49. <img src="{{ thread.last_poster_id|avatar:25 }}" alt="{% trans "Avatar" %}" class="avatar">
  50. </a>
  51. {% else %}
  52. <span class="thread-author tooltip-top" title="{% blocktrans with user=thread.last_poster_name %}Last post by {{ user }}{% endblocktrans %}">
  53. <img src="{% blankavatar 25 %}" alt="{% trans "Avatar" %}" class="avatar">
  54. </span>
  55. {% endif %}
  56. {% if thread.is_read %}
  57. <div class="thread-replies thread-read">
  58. <a href="{{ thread.get_new_reply_url }}" class="tooltip-top" title="{% blocktrans trimmed with replies=thread.replies|intcomma count counter=thread.replies %}{{ replies }} reply{% plural %}{{ replies }} replies{% endblocktrans %}">
  59. {{ thread.replies|intcomma }}
  60. </a>
  61. </div>
  62. {% elif thread.is_new %}
  63. <div class="thread-replies new-replies">
  64. <a href="{{ thread.get_new_reply_url }}" class="label label-success tooltip-top" title="{% blocktrans trimmed with replies=thread.replies|intcomma count counter=thread.replies %}New thread with {{ replies }} reply{% plural %}New thread with {{ replies }} replies{% endblocktrans %}">
  65. <span class="fa fa-plus-circle fa-fw"></span>
  66. {{ thread.replies|default:1|intcomma }}
  67. </a>
  68. </div>
  69. {% else %}
  70. <div class="thread-replies new-replies">
  71. <a href="{{ thread.get_new_reply_url }}" class="label label-primary tooltip-top" title="{% blocktrans trimmed with replies=thread.unread_replies|intcomma count counter=thread.unread_replies %}{{ replies }} unread reply{% plural %}{{ replies }} unread replies{% endblocktrans %}">
  72. <span class="fa fa-signal fa-fw"></span>
  73. {{ thread.unread_replies|intcomma }}
  74. </a>
  75. </div>
  76. {% endif %}
  77. {% if show_threads_locations %}
  78. <div class="thread-location tooltip-top" title="{% trans "Thread location" %}">
  79. <span class="fa fa-reorder fa-lg"></span>
  80. <a href="{{ thread.forum.get_absolute_url }}">{{ thread.forum }}</a>
  81. </div>
  82. {% endif %}
  83. <ul class="list-unstyled thread-flags">
  84. {% if thread.has_reported_posts %}
  85. <li class="tooltip-top" title="{% trans "Reported posts" %}">
  86. <span class="fa fa-exclamation-triangle fa-fw fa-lg"></span>
  87. </li>
  88. {% endif %}
  89. {% if thread.has_moderated_posts and not thread.is_moderated and thread.forum_id in user.acl.moderated_forums %}
  90. <li class="tooltip-top" title="{% trans "Moderated posts" %}">
  91. <button type="button" class="btn-show-moderated" data-moderated-url="{{ thread.get_moderated_url }}">
  92. <span class="fa fa-question-circle fa-fw fa-lg"></span>
  93. </button>
  94. </li>
  95. {% endif %}
  96. {% if thread.is_poll %}
  97. <li class="tooltip-top" title="{% trans "Poll" %}">
  98. <span class="fa fa-bar-chart-o fa-fw fa-lg"></span>
  99. </li>
  100. {% endif %}
  101. {% if thread.is_moderated %}
  102. <li class="tooltip-top" title="{% trans "Moderated" %}">
  103. <button type="button" class="btn-show-moderated" data-moderated-url="{{ thread.get_moderated_url }}">
  104. <span class="fa fa-question-circle fa-fw fa-lg"></span>
  105. </button>
  106. </li>
  107. {% endif %}
  108. {% if thread.is_closed %}
  109. <li class="tooltip-top" title="{% trans "Closed" %}">
  110. <span class="fa fa-lock fa-fw fa-lg"></span>
  111. </li>
  112. {% endif %}
  113. {% if thread.is_hidden %}
  114. <li class="tooltip-top" title="{% trans "Hidden" %}">
  115. <span class="fa fa-eye-slash fa-fw fa-lg"></span>
  116. </li>
  117. {% endif %}
  118. {% if thread.label %}
  119. <li>
  120. <span class="label label-solo label-{{ thread.label.css_class|default:"default" }}">
  121. {{ thread.label }}
  122. </span>
  123. </li>
  124. {% endif %}
  125. </ul>
  126. {% endblock thread-stats %}
  127. </div>
  128. {% endblock thread-extra %}
  129. </div>
  130. </li>
  131. {% empty %}
  132. <li class="list-group-item message-row">
  133. {% block no-threads %}{% endblock no-threads %}
  134. </li>
  135. {% endfor %}
  136. </ul>
  137. </div>
  138. {% endblock threads-panel %}
  139. </div>
  140. {% endblock threads-list %}
  141. </div>
  142. <div id="reply-form-placeholder"></div>
  143. {% endblock content %}
  144. {% block javascripts %}
  145. {{ block.super }}
  146. {% if user.acl.moderated_forums %}
  147. <script lang="JavaScript">
  148. $(function() {
  149. $('.btn-show-moderated').click(function() {
  150. Misago.Modal.get($(this).data('moderated-url'));
  151. });
  152. });
  153. </script>
  154. {% endif %}
  155. {% endblock javascripts %}