thread.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. {% load i18n misago_capture %}
  2. <li class="list-group-item thread-{{ thread.is_read|yesno:'read,new' }}">
  3. <div class="thread-icon">
  4. {% if thread.is_read %}
  5. <a href="{{ thread.get_last_post_url }}" class="read-status item-read" title="{% trans "This thread has no new posts." %}">
  6. <span class="material-icon">
  7. chat_bubble_outline
  8. </span>
  9. </a>
  10. {% else %}
  11. <a href="{{ thread.get_new_post_url }}" class="read-status item-new" title="{% trans "This thread has new posts." %}">
  12. <span class="material-icon">
  13. chat_bubble
  14. </span>
  15. </a>
  16. {% endif %}
  17. <div class="thread-flags">
  18. {% if thread.weight == 2 %}
  19. <span class="thread-pinned-globally">
  20. <span class="material-icon">
  21. bookmark
  22. </span>
  23. </span>
  24. {% elif thread.weight %}
  25. <span class="thread-pinned-locally">
  26. <span class="material-icon">
  27. bookmark_border
  28. </span>
  29. </span>
  30. {% endif %}
  31. {% if thread.is_unapproved %}
  32. <span class="thread-unapproved">
  33. <span class="material-icon">
  34. remove_circle
  35. </span>
  36. </span>
  37. {% elif thread.has_unapproved_posts %}
  38. <span class="thread-unapproved-posts">
  39. <span class="material-icon">
  40. remove_circle_outline
  41. </span>
  42. </span>
  43. {% endif %}
  44. {% if thread.is_hidden %}
  45. <span class="thread-hidden">
  46. <span class="material-icon">
  47. visibility_off
  48. </span>
  49. </span>
  50. {% endif %}
  51. {% if thread.is_closed %}
  52. <span class="thread-closed">
  53. <span class="material-icon">
  54. lock_outline
  55. </span>
  56. </span>
  57. {% endif %}
  58. </div>
  59. </div>
  60. <div class="thread-main">
  61. <a href="{{ thread.get_absolute_url }}" class="item-title thread-title">
  62. {{ thread.title }}
  63. </a>
  64. <ul class="thread-details-full list-inline">
  65. {% if not thread.is_read %}
  66. <li class="thread-new-posts" title="{% trans "Go to first unread post" %}">
  67. <a href="{{ thread.get_new_post_url }}">
  68. <span class="material-icon">
  69. comment
  70. </span>
  71. <span class="icon-legend">
  72. {% trans "New posts" %}
  73. </span>
  74. </a>
  75. </li>
  76. {% endif %}
  77. {% if thread.weight == 2 %}
  78. <li class="thread-pinned-globally">
  79. <span class="material-icon">
  80. bookmark
  81. </span>
  82. <span class="icon-legend">
  83. {% trans "Pinned globally" %}
  84. </span>
  85. </li>
  86. {% elif thread.weight %}
  87. <li class="thread-pinned-locally">
  88. <span class="material-icon">
  89. bookmark_border
  90. </span>
  91. <span class="icon-legend">
  92. {% trans "Pinned locally" %}
  93. </span>
  94. </li>
  95. {% endif %}
  96. {% if thread.is_unapproved %}
  97. <li class="thread-unapproved">
  98. <span class="material-icon">
  99. remove_circle
  100. </span>
  101. <span class="icon-legend">
  102. {% trans "Unapproved" %}
  103. </span>
  104. </li>
  105. {% elif thread.has_unapproved_posts %}
  106. <li class="thread-unapproved-posts">
  107. <span class="material-icon">
  108. remove_circle_outline
  109. </span>
  110. <span class="icon-legend">
  111. {% trans "Unapproved posts" %}
  112. </span>
  113. </span>
  114. {% endif %}
  115. {% if thread.is_hidden %}
  116. <li class="thread-hidden">
  117. <span class="material-icon">
  118. visibility_off
  119. </span>
  120. <span class="icon-legend">
  121. {% trans "Hidden" %}
  122. </span>
  123. </li>
  124. {% endif %}
  125. {% if thread.is_closed %}
  126. <li class="thread-closed">
  127. <span class="material-icon">
  128. lock_outline
  129. </span>
  130. <span class="icon-legend">
  131. {% trans "Closed" %}
  132. </span>
  133. </li>
  134. {% endif %}
  135. {% if thread.top_category and not hide_path %}
  136. <li class="thread-path">
  137. <a href="{{ thread.top_category.get_absolute_url }}{% if list_type != 'all' %}{{ list_type }}/{% endif %}" class="thread-category{% if thread.top_category.css_class %} thread-category-{{ thread.top_category.css_class }}{% endif %}">
  138. {{ thread.top_category.name }}
  139. </a>
  140. {% if thread.top_category != thread.category %}
  141. <span class="path-separator material-icon">
  142. arrow_forward
  143. </span>
  144. <a href="{{ thread.category.get_absolute_url }}{% if list_type != 'all' %}{{ list_type }}/{% endif %}" class="thread-category{% if thread.category.css_class %} thread-category-{{ thread.category.css_class }}{% endif %}">
  145. {{ thread.category.name }}
  146. </a>
  147. {% endif %}
  148. </li>
  149. {% endif %}
  150. <li class="thread-replies">
  151. <span class="material-icon">
  152. forum
  153. </span>
  154. <span class="icon-legend">
  155. {% blocktrans trimmed count replies=thread.replies %}
  156. {{ replies }} reply
  157. {% plural %}
  158. {{ replies }} replies
  159. {% endblocktrans %}
  160. </span>
  161. </li>
  162. <li class="thread-last-reply">
  163. {% capture trimmed as last_poster %}
  164. {% if thread.last_poster_id %}
  165. <a href="{% url 'misago:user' slug=thread.last_poster_slug pk=thread.last_poster_id %}" class="poster-title">{{ thread.last_poster_name }}</a>
  166. {% else %}
  167. <span class="poster-title">{{ thread.last_poster_name }}</span>
  168. {% endif %}
  169. {% endcapture %}
  170. {% blocktrans trimmed with user=last_poster|safe date=thread.last_post_on|date %}
  171. last reply by {{ user }} {{ date }}
  172. {% endblocktrans %}
  173. </li>
  174. </ul>
  175. <ul class="thread-details-compact list-inline">
  176. {% if thread.top_category and not hide_path %}
  177. {% if thread.top_category != thread.category %}
  178. <li class="thread-path">
  179. <a href="{{ thread.category.get_absolute_url }}{% if list_type != 'all' %}{{ list_type }}/{% endif %}" class="thread-category{% if thread.category.css_class %} thread-category-{{ thread.category.css_class }}{% endif %}">
  180. {{ thread.category.name }}
  181. </a>
  182. </li>
  183. {% else %}
  184. <li class="thread-path">
  185. <a href="{{ thread.top_category.get_absolute_url }}{% if list_type != 'all' %}{{ list_type }}/{% endif %}" class="thread-category{% if thread.top_category.css_class %} thread-category-{{ thread.top_category.css_class }}{% endif %}">
  186. {{ thread.top_category.name }}
  187. </a>
  188. </li>
  189. {% endif %}
  190. {% endif %}
  191. <li class="thread-replies-count">
  192. <span class="material-icon">
  193. forum
  194. </span>
  195. <span class="icon-legend">
  196. {{ thread.replies }}
  197. </span>
  198. </li>
  199. <li class="thread-last-reply-clock">
  200. <span class="material-icon">
  201. schedule
  202. </span>
  203. <span class="icon-legend">
  204. {{ thread.last_post_on|date }}
  205. </span>
  206. </li>
  207. </ul>
  208. </div>
  209. <div class="clearfix"></div>
  210. </li>