replies.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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>{{ thread }}</h1>
  23. <ul class="list-inline page-details">
  24. <li class="tooltip-bottom" title="{% trans "Thread author" %}">
  25. {% if thread.starter_id %}
  26. <a href="{% url USER_PROFILE_URL user_slug=thread.starter_slug user_id=thread.starter_id %}">
  27. <img src="{{ thread.starter_id|avatar:20 }}" alt="{% trans "Avatar" %}"> {{ thread.starter_name }}
  28. </a>
  29. {% else %}
  30. <span class="fa fa-user"></span> {{ thread.starter_name }}
  31. {% endif %}
  32. <li>
  33. <li>
  34. <span class="fa fa-comment"></span> {% blocktrans trimmed with replies=thread.replies|intcomma count counter=thread.replies %}
  35. {{ replies }} reply
  36. {% plural %}
  37. {{ replies }} replies
  38. {% endblocktrans %}
  39. <li>
  40. <li class="tooltip-bottom" title="{% blocktrans with last_post=thread.last_post_on %}Last post from {{ last_post }}{% endblocktrans %}">
  41. <span class="fa fa-clock-o"></span>
  42. <abbr class="dynamic time-ago" data-timestamp="{{ thread.last_post_on|date:"c" }}">
  43. {{ thread.last_post_on|date }}
  44. </abbr>
  45. </li>
  46. </ul>
  47. </div>
  48. </div>
  49. <div class="container">
  50. <div class="table-actions">
  51. {% include "misago/thread/pagination.html" %}
  52. {% if thread.acl.can_review and thread.has_moderated_posts %}
  53. <button type="button" class="btn btn-default btn-show-moderated">
  54. <span class="fa fa-question-circle fa-fw fa-lg"></span>
  55. {% trans "Unapproved posts" %}
  56. </button>
  57. {% endif %}
  58. {% if thread.acl.can_see_reports and thread.has_reported_posts %}
  59. <a href="{{ thread.get_moderated_url }}" class="btn btn-default btn-show-reported">
  60. <span class="fa fa-exclamation-triangle fa-fw fa-lg"></span>
  61. {% trans "Reported posts" %}
  62. </a>
  63. {% endif %}
  64. {% if thread_actions %}
  65. {% include "misago/thread/thread_actions.html" %}
  66. {% endif %}
  67. </div>
  68. <div class="posts-list">
  69. {% for post in posts %}
  70. {% include "misago/thread/post.html" %}
  71. {% endfor %}
  72. </div>
  73. <div class="table-actions">
  74. {% include "misago/thread/pagination.html" %}
  75. </div>
  76. <div class="reply-to-thread text-center">
  77. {% if thread_reply_message %}
  78. <p class="lead">
  79. <span class="fa fa-ban fa-fw fa-lg"></span>
  80. {{ thread_reply_message }}
  81. </p>
  82. {% else %}
  83. <button type="button" class="btn btn-success btn-lg">
  84. <span class="fa fa-plus-circle fa-fw fa-lg"></span>
  85. {% trans "Reply to thread" %}
  86. </button>
  87. {% endif %}
  88. </div>
  89. </div>
  90. </div>
  91. <div id="reply-form-placeholder"></div>
  92. {% endblock %}
  93. {% block javascripts %}
  94. {{ block.super }}
  95. <script lang="JavaScript">
  96. $(function() {
  97. Misago.Onebox.activate($('.post-body'));
  98. });
  99. </script>
  100. {% if user.is_authenticated %}
  101. {% include "misago/thread/actions_js.html" %}
  102. {% if forum.acl.can_hide_events %}
  103. {% include "misago/thread/events_js.html" %}
  104. {% endif %}
  105. {% if thread.acl.can_review and thread.has_moderated_posts %}
  106. <script lang="JavaScript">
  107. $(function() {
  108. $('.btn-show-moderated').click(function() {
  109. Misago.Modal.get("{{ thread.get_moderated_url }}");
  110. });
  111. });
  112. </script>
  113. {% endif %}
  114. {% if thread.acl.can_see_reports and thread.has_reported_posts %}
  115. <script lang="JavaScript">
  116. $(function() {
  117. $('.btn-show-reported').click(function() {
  118. Misago.Modal.get("{{ thread.get_reported_url }}");
  119. });
  120. });
  121. </script>
  122. {% endif %}
  123. {% if thread.acl.can_reply %}
  124. <script lang="JavaScript">
  125. $(function() {
  126. Misago.reply_thread = function(extra_on_load) {
  127. if (extra_on_load == undefined) {
  128. extra_on_load = function() {};
  129. }
  130. Misago.Posting.load({
  131. api_url: "{% url 'misago:reply_thread' forum_id=forum.id thread_id=thread.id %}",
  132. on_load: function() {
  133. $('.reply-to-thread').hide();
  134. extra_on_load();
  135. },
  136. on_cancel: function() {
  137. $('.reply-to-thread').show();
  138. }
  139. });
  140. }
  141. $('.reply-to-thread button').click(function() {
  142. if (!Misago.Posting.is_open()) {
  143. Misago.reply_thread();
  144. }
  145. });
  146. });
  147. </script>
  148. {% endif %}
  149. {% endif %}
  150. {% endblock javascripts %}