thread.html 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. {% load i18n misago_avatars misago_capture %}
  2. <li class="list-group-item {% if thread.category.css_class %}list-group-category-has-flavor list-group-item-category-{{ thread.category.css_class }}{% endif %} thread-{{ thread.is_read|yesno:'read,new' }}" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
  3. <div class="thread-details-top">
  4. {% if not thread.is_read %}
  5. <a href="{{ thread.get_new_post_url }}" class="thread-detail-new">
  6. <span class="material-icon">
  7. comment
  8. </span>
  9. <span class="detail-text">
  10. {% trans "New posts" %}
  11. </span>
  12. </a>
  13. {% endif %}
  14. {% if thread.weight == 2 %}
  15. <span class="thread-detail-pinned-globally">
  16. <span class="material-icon">
  17. bookmark
  18. </span>
  19. <span class="detail-text">
  20. {% trans "Pinned globally" %}
  21. </span>
  22. </span>
  23. {% elif thread.weight %}
  24. <span class="thread-detail-pinned-locally">
  25. <span class="material-icon">
  26. bookmark_border
  27. </span>
  28. <span class="detail-text">
  29. {% trans "Pinned locally" %}
  30. </span>
  31. </span>
  32. {% endif %}
  33. {% if thread.is_unapproved %}
  34. <span class="thread-detail-unapproved">
  35. <span class="material-icon">
  36. remove_circle
  37. </span>
  38. <span class="detail-text">
  39. {% trans "Unapproved" %}
  40. </span>
  41. </span>
  42. {% elif thread.has_unapproved_posts and thread.acl.can_approve %}
  43. <span class="thread-detail-unapproved-posts">
  44. <span class="material-icon">
  45. remove_circle_outline
  46. </span>
  47. <span class="detail-text">
  48. {% trans "Unapproved posts" %}
  49. </span>
  50. </span>
  51. {% endif %}
  52. {% if thread.has_best_answer %}
  53. <a href="{{ thread.get_best_answer_url }}" class="hidden-xs thread-detail-answered">
  54. <span class="material-icon">
  55. check_box
  56. </span>
  57. <span class="detail-text">
  58. {% trans "Answered" %}
  59. </span>
  60. </a>
  61. {% endif %}
  62. {% if thread.category != category %}
  63. <a class="item-title thread-detail-category visible-xs-inline-block {% if thread.category.css_class %}thread-detail-category-{{ thread.category.css_class }}{% endif %}" href="{{ thread.category.get_absolute_url }}">
  64. {{ thread.category.name }}
  65. </a>
  66. {% endif %}
  67. <a href="{{ thread.get_last_post_url }}" class="visible-xs-inline-block thread-detail-last-reply" title="{{ thread.last_post_on|date:'DATETIME_FORMAT' }}">
  68. {{ thread.last_post_on|date }}
  69. </a>
  70. {% if thread.last_poster_id %}
  71. <a href="{% url 'misago:user' slug=thread.last_poster_slug pk=thread.last_poster_id %}" class="visible-xs-inline-block item-title thread-last-poster">
  72. {{ thread.last_poster_name }}
  73. </a>
  74. {% else %}
  75. <span class="visible-xs-inline-block item-title thread-last-poster">
  76. {{ thread.last_poster_name }}
  77. </span>
  78. {% endif %}
  79. </div>
  80. <div class="row thread-row">
  81. <div class="col-xs-12 col-md-7 thread-main">
  82. <div class="media">
  83. <div class="media-left hidden-xs">
  84. {% if thread.starter %}
  85. <a href="{{ thread.starter.get_absolute_url }}" class="thread-starter-avatar" title="{{ thread.starter_name }}">
  86. <img src="{{ thread.starter|avatar:40 }}" width="40" height="40" alt="">
  87. </a>
  88. {% else %}
  89. <span class="thread-starter-avatar" title="{{ thread.starter_name }}">
  90. <img src="{{ BLANK_AVATAR_URL }}" width="40" height="40" alt="">
  91. </span>
  92. {% endif %}
  93. </div>
  94. <div class="media-body">
  95. <a href="{{ thread.get_absolute_url }}" class="item-title thread-title" itemprop="url">
  96. <span itemprop="name">{{ thread.title }}</span>
  97. </a>
  98. <div class="thread-details-bottom">
  99. <div class="row thread-details-bottom">
  100. <div class="col-xs-12">
  101. {% if thread.category != category %}
  102. <a class="item-title thread-detail-category hidden-xs {% if thread.category.css_class %}thread-detail-category-{{ thread.category.css_class }}{% endif %}" href="{{ thread.category.get_absolute_url }}">
  103. {{ thread.category.name }}
  104. </a>
  105. {% endif %}
  106. {% if thread.is_hidden %}
  107. <span class="thread-detail-hidden">
  108. <span class="material-icon">
  109. visibility_off
  110. </span>
  111. <span class="detail-text hidden-xs">
  112. {% trans "Hidden" %}
  113. </span>
  114. </span>
  115. {% endif %}
  116. {% if thread.is_closed %}
  117. <span class="thread-detail-closed">
  118. <span class="material-icon">
  119. lock_outline
  120. </span>
  121. <span class="detail-text hidden-xs">
  122. {% trans "Closed" %}
  123. </span>
  124. </span>
  125. {% endif %}
  126. {% if thread.has_poll %}
  127. <span class="thread-detail-poll">
  128. <span class="material-icon">
  129. assessment
  130. </span>
  131. <span class="detail-text hidden-xs">
  132. {% trans "Poll" %}
  133. </span>
  134. </span>
  135. {% endif %}
  136. {% if thread.has_best_answer %}
  137. <a href="{{ thread.get_best_answer_url }}" class="visible-xs-inline-block thread-detail-answered">
  138. <span class="material-icon">check_box</span>
  139. </a>
  140. {% endif %}
  141. <span class="thread-detail-replies">
  142. <span class="material-icon">
  143. forum
  144. </span>
  145. <span class="detail-text">
  146. {% blocktrans trimmed count replies=thread.replies %}
  147. {{ replies }} reply
  148. {% plural %}
  149. {{ replies }} replies
  150. {% endblocktrans %}
  151. </span>
  152. </span>
  153. <a href="{{ thread.get_last_post_url }}" class="visible-sm-inline-block thread-detail-last-reply" title="{{ thread.last_post_on|date:'DATETIME_FORMAT' }}">
  154. {{ thread.last_post_on|date }}
  155. </a>
  156. {% if thread.last_poster_id %}
  157. <a href="{% url 'misago:user' slug=thread.last_poster_slug pk=thread.last_poster_id %}" class="visible-sm-inline-block item-title thread-last-poster">
  158. {{ thread.last_poster_name }}
  159. </a>
  160. {% else %}
  161. <span class="visible-sm-inline-block item-title thread-last-poster">
  162. {{ thread.last_poster_name }}
  163. </span>
  164. {% endif %}
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. <div class="col-md-5 hidden-xs hidden-sm thread-last-action">
  172. <div class="media">
  173. <div class="media-left">
  174. {% if thread.last_poster %}
  175. <a href="{{ thread.last_poster.get_absolute_url }}" class="thread-last-poster-avatar" title="{{ thread.last_poster_name }}">
  176. <img src="{{ thread.last_poster|avatar:40 }}" width="40" height="40" alt="">
  177. </a>
  178. {% else %}
  179. <span class="thread-last-poster-avatar" title="{{ thread.last_poster_name }}">
  180. <img src="{{ BLANK_AVATAR_URL }}" width="40" height="40" alt="">
  181. </span>
  182. {% endif %}
  183. </div>
  184. <div class="media-body">
  185. {% if thread.last_poster %}
  186. <a href="{{ thread.last_poster.get_absolute_url }}" class="item-title thread-last-poster">
  187. {{ thread.last_poster_name }}
  188. </a>
  189. {% else %}
  190. <span class="item-title thread-last-poster">
  191. {{ thread.last_poster_name }}
  192. </span>
  193. {% endif %}
  194. <a href="{{ thread.get_last_post_url }}" class="thread-last-reply" title="{{ thread.last_post_on|date:'DATETIME_FORMAT' }}">
  195. {{ thread.last_post_on|date }}
  196. </a>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <meta itemprop="position" content="{{ paginator.before|add:forloop.counter }}">
  202. </li>