replies.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. {% extends "misago/base.html" %}
  2. {% load humanize i18n misago_avatars misago_stringutils %}
  3. {% block title %}{{ thread }}{% if page.number > 1 %} ({% blocktrans with page=page.number %}Page {{ page }}{% endblocktrans %}){% endif %} | {{ block.super }}{% endblock title %}
  4. {% block meta-description %}{% if thread.first_post.is_valid %}{{ thread.first_post.short|striplinebreaks }} {% endif %}{% blocktrans trimmed with replies=thread.replies started=thread.started_on|date last_post=thread.last_post_on|date count counter=thread.replies %}
  5. {{ replies }} reply since {{ started }}. Last post on {{ last_post }}.
  6. {% plural %}
  7. {{ replies }} replies since {{ started }}. Last post on {{ last_post }}.
  8. {% endblocktrans %}{% endblock meta-description %}
  9. {% block content %}
  10. <div{% if forum.css %} class="page-{{ forum.css_class }}"{% endif %}>
  11. <div class="page-header">
  12. <div class="container">
  13. {% if path %}
  14. <ol class="breadcrumb">
  15. {% for crumb in path %}
  16. <li>
  17. <a href="{{ crumb.get_absolute_url }}">{{ crumb }}</a>{% if not forloop.last %}<span class="fa fa-chevron-right"></span>{% endif %}
  18. </li>
  19. {% endfor %}
  20. </ol>
  21. {% endif %}
  22. <h1 id="thread-title">{{ thread }}</h1>
  23. <ul class="list-inline page-details">
  24. {% block page-details %}
  25. <li class="tooltip-bottom" title="{% trans "Thread author" %}">
  26. {% if thread.starter_id %}
  27. <a href="{% url USER_PROFILE_URL user_slug=thread.starter_slug user_id=thread.starter_id %}">
  28. <img src="{{ thread.starter_id|avatar:20 }}" alt="{% trans "Avatar" %}"> {{ thread.starter_name }}
  29. </a>
  30. {% else %}
  31. <span class="fa fa-user"></span> {{ thread.starter_name }}
  32. {% endif %}
  33. <li>
  34. <li>
  35. <span class="fa fa-comment"></span> {% blocktrans trimmed with replies=thread.replies|intcomma count counter=thread.replies %}
  36. {{ replies }} reply
  37. {% plural %}
  38. {{ replies }} replies
  39. {% endblocktrans %}
  40. <li>
  41. <li class="tooltip-bottom" title="{% blocktrans with last_post=thread.last_post_on %}Last post from {{ last_post }}{% endblocktrans %}">
  42. <span class="fa fa-clock-o"></span>
  43. <abbr class="dynamic time-ago" data-timestamp="{{ thread.last_post_on|date:"c" }}">
  44. {{ thread.last_post_on|date }}
  45. </abbr>
  46. </li>
  47. {% endblock page-details %}
  48. </ul>
  49. </div>
  50. </div>
  51. <div class="container">
  52. <div class="table-actions">
  53. {% block thread-nav %}
  54. {% include "misago/thread/pagination.html" %}
  55. {% if thread.acl.can_review and thread.has_moderated_posts %}
  56. <button type="button" class="btn btn-default btn-show-moderated">
  57. <span class="fa fa-question-circle fa-fw fa-lg"></span>
  58. {% trans "Unapproved posts" %}
  59. </button>
  60. {% endif %}
  61. {% if thread.acl.can_see_reports and thread.has_reported_posts %}
  62. <button type="button" class="btn btn-default btn-show-reported">
  63. <span class="fa fa-exclamation-triangle fa-fw fa-lg"></span>
  64. {% trans "Reported posts" %}
  65. </button>
  66. {% endif %}
  67. {% endblock thread-nav %}
  68. {% block thread-actions %}
  69. {% if thread_actions %}
  70. {% include "misago/thread/thread_actions.html" %}
  71. {% endif %}
  72. {% endblock thread-actions %}
  73. </div>
  74. <div class="posts-list">
  75. {% for post in posts %}
  76. {% include "misago/thread/post.html" %}
  77. {% endfor %}
  78. </div>
  79. <div class="table-actions">
  80. {% block thread-nav-down %}
  81. {% include "misago/thread/pagination.html" %}
  82. {% endblock thread-nav-down %}
  83. {% block post-actions %}
  84. {% if posts_actions %}
  85. {% include "misago/thread/posts_actions.html" %}
  86. {% endif %}
  87. {% endblock post-actions %}
  88. </div>
  89. <div class="reply-to-thread text-center">
  90. {% if thread_reply_message %}
  91. <p class="lead">
  92. <span class="fa fa-ban fa-fw fa-lg"></span>
  93. {{ thread_reply_message }}
  94. </p>
  95. {% else %}
  96. <button type="button" class="btn btn-success btn-lg">
  97. <span class="fa fa-plus-circle fa-fw fa-lg"></span>
  98. {% trans "Reply to thread" %}
  99. </button>
  100. {% endif %}
  101. </div>
  102. </div>
  103. </div>
  104. <div id="reply-form-placeholder"></div>
  105. {% endblock %}
  106. {% block javascripts %}
  107. {{ block.super }}
  108. <script lang="JavaScript">
  109. $(function() {
  110. Misago.Onebox.activate($('.post-body'));
  111. });
  112. </script>
  113. {% if user.is_authenticated %}
  114. {% include "misago/thread/actions_js.html" %}
  115. {% if forum.acl.can_hide_events %}
  116. {% include "misago/thread/events_js.html" %}
  117. {% endif %}
  118. {% if thread.acl.can_review and thread.has_moderated_posts %}
  119. <script lang="JavaScript">
  120. $(function() {
  121. $('.btn-show-moderated').click(function() {
  122. Misago.Modal.get("{{ thread.get_moderated_url }}");
  123. });
  124. });
  125. </script>
  126. {% endif %}
  127. {% if thread.acl.can_see_reports and thread.has_reported_posts %}
  128. <script lang="JavaScript">
  129. $(function() {
  130. $('.btn-show-reported').click(function() {
  131. Misago.Modal.get("{{ thread.get_reported_url }}");
  132. });
  133. });
  134. </script>
  135. {% endif %}
  136. {% if thread.acl.can_reply %}
  137. <script lang="JavaScript">
  138. $(function() {
  139. Misago.reply_thread = function(extra_on_load) {
  140. if (extra_on_load == undefined) {
  141. extra_on_load = function() {};
  142. }
  143. Misago.Posting.load({
  144. api_url: "{{ thread.get_reply_api_url }}",
  145. on_load: function() {
  146. $('.reply-to-thread').hide();
  147. extra_on_load();
  148. },
  149. on_cancel: function() {
  150. $('.reply-to-thread').show();
  151. }
  152. });
  153. }
  154. $('.reply-to-thread button').click(function() {
  155. if (!Misago.Posting.is_open()) {
  156. Misago.reply_thread();
  157. }
  158. });
  159. });
  160. </script>
  161. {% endif %}
  162. {% endif %}
  163. {% endblock javascripts %}