thread.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. {% extends "cranefly/layout.html" %}
  2. {% load i18n %}
  3. {% load url from future %}
  4. {% import "_forms.html" as form_theme with context %}
  5. {% import "cranefly/editor.html" as editor with context %}
  6. {% import "cranefly/macros.html" as macros with context %}
  7. {% block title %}{{ macros.page_title(title=thread.name,parent=forum.name,page=pagination['page']) }}{% endblock %}
  8. {% block breadcrumb %}{{ super() }} <span class="divider">/</span></li>
  9. {% for parent in parents %}
  10. <li><a href="{{ parent.type|url(forum=parent.pk, slug=parent.slug) }}">{{ parent.name }}</a> <span class="divider">/</span></li>
  11. {% endfor %}
  12. <li class="active">{{ thread.name }}
  13. {%- endblock %}
  14. {% block content %}
  15. <div class="page-header">
  16. <ul class="breadcrumb">
  17. {{ self.breadcrumb() }}</li>
  18. </ul>
  19. <h1>{{ thread.name }}</h1>
  20. <ul class="unstyled thread-info">
  21. {% if thread.moderated %}<li><i class="icon-eye-close"></i> {% trans %}Not Reviewed{% endtrans %}</li>{% endif %}
  22. <li><i class="icon-time"></i> {{ thread.last|reltimesince }}</li>
  23. <li><i class="icon-user"></i> {% if thread.start_poster_id %}<a href="{% url 'user' user=thread.start_poster_id, username=thread.start_poster_slug %}">{{ thread.start_poster_name }}</a>{% else %}{{ thread.start_poster_name }}{% endif %}</li>
  24. <li><i class="icon-comment"></i> {% if thread.replies > 0 -%}
  25. {% trans count=thread.replies, replies=thread.replies|intcomma %}One reply{% pluralize %}{{ replies }} replies{% endtrans %}
  26. {%- else -%}
  27. {% trans %}No replies{% endtrans %}
  28. {%- endif %}</li>
  29. </ul>
  30. </div>
  31. {% if message %}{{ macros.draw_message(message) }}{% endif %}
  32. <div class="list-nav">
  33. {{ pager() }}
  34. {% if user.is_authenticated() %}
  35. <ul class="nav nav-pills pull-right">
  36. {% if ignored_posts %}
  37. <li class="discourage"><form action="{% url 'thread_show_hidden' thread=thread.pk, slug=thread.slug %}" class="form-inline" method="post"><input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}"><button type="submit" class="btn"><i class="icon-eye-open"></i> {% trans %}Show Hidden Replies{% endtrans %}</button></form></li>
  38. {% endif %}
  39. {% if watcher %}
  40. {% if watcher.email %}
  41. <li class="success"><form action="{% url 'thread_unwatch_email' thread=thread.pk, slug=thread.slug %}" method="post"><input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}"><input type="hidden" name="retreat" value="{{ request_path }}"><button type="submit" class="btn tooltip-top" title="{% trans %}Don't e-mail me anymore if anyone replies to this thread{% endtrans %}"><i class="icon-envelope"></i></button></form></li>
  42. {% else %}
  43. <li class="info"><form action="{% url 'thread_watch_email' thread=thread.pk, slug=thread.slug %}" method="post"><input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}"><input type="hidden" name="retreat" value="{{ request_path }}"><button type="submit" class="btn tooltip-top" title="{% trans %}E-mail me if anyone replies{% endtrans %}"><i class="icon-envelope"></i></button></form></li>
  44. {% endif %}
  45. <li class="success"><form action="{% url 'thread_unwatch' thread=thread.pk, slug=thread.slug %}" method="post"><input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}"><input type="hidden" name="retreat" value="{{ request_path }}"><button type="submit" class="btn tooltip-top" title="{% trans %}Remove thread from watched list{% endtrans %}"><i class="icon-bookmark"></i></button></form></li>
  46. {% else %}
  47. <li class="info"><form action="{% url 'thread_watch_email' thread=thread.pk, slug=thread.slug %}" method="post"><input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}"><input type="hidden" name="retreat" value="{{ request_path }}"><button type="submit" class="btn tooltip-top" title="{% trans %}Add thread to watched list and e-mail me if anyone replies{% endtrans %}"><i class="icon-envelope"></i></button></form></li>
  48. <li class="info"><form action="{% url 'thread_watch' thread=thread.pk, slug=thread.slug %}" method="post"><input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}"><input type="hidden" name="retreat" value="{{ request_path }}"><button type="submit" class="btn tooltip-top" title="{% trans %}Add thread to watched list{% endtrans %}"><i class="icon-bookmark"></i></button></form></li>
  49. {% endif %}
  50. {% if acl.threads.can_reply(forum, thread) %}
  51. <li class="primary"><a href="{% url 'thread_reply' thread=thread.pk, slug=thread.slug %}"><i class="icon-pencil"></i> {% trans %}Reply{% endtrans %}</a></li>
  52. {% endif %}
  53. </ul>
  54. {% endif %}
  55. </div>
  56. <div class="posts-list">
  57. {% for post in posts %}
  58. <div id="post-{{ post.pk }}"></div>
  59. {% if post.message %}{{ macros.draw_message(post.message) }}{% endif %}
  60. {% if post.deleted and not acl.threads.can_see_deleted_posts(forum) %}
  61. <div id="post-{{ post.pk }}" class="well well-post well-post-deleted{% if post.user and post.user.rank and post.user.rank.style %} {{ post.user.rank.style }}{% endif %}">
  62. <div class="post-author">
  63. <div class="post-bit">
  64. {% if post.user_id %}
  65. <a href="{% url 'user' user=post.user.pk, username=post.user.username_slug %}" class="lead">{{ post.user.username }}</a>
  66. {% else %}
  67. <span class="lead">{{ post.user_name }}</span>
  68. {% endif %}
  69. </div>
  70. </div>
  71. <div class="post-extra">
  72. <a href="{% if pagination['page'] > 1 -%}
  73. {% url 'thread' thread=thread.pk, slug=thread.slug, page=pagination['page'] %}
  74. {%- else -%}
  75. {% url 'thread' thread=thread.pk, slug=thread.slug %}
  76. {%- endif %}#post-{{ post.pk }}" class="post-perma pull-right tooltip-left" title="{% trans %}Direct link to this post{% endtrans %}">#{{ pagination['start'] + loop.index }}</a>
  77. </div>
  78. <div class="post-content">
  79. {% trans user=edit_user(post), date=post.edit_date|reltimesince|low %}{{ user }} has deleted this reply {{ date }}{% endtrans %}
  80. </div>
  81. </div>
  82. {% elif post.ignored %}
  83. <div class="well well-post well-post-deleted{% if post.user and post.user.rank and post.user.rank.style %} {{ post.user.rank.style }}{% endif %}">
  84. <div class="post-author">
  85. <div class="post-bit">
  86. <span class="lead">{% trans %}Hidden Reply{% endtrans %}</span>
  87. </div>
  88. </div>
  89. <div class="post-extra">
  90. <a href="{% if pagination['page'] > 1 -%}
  91. {% url 'thread' thread=thread.pk, slug=thread.slug, page=pagination['page'] %}
  92. {%- else -%}
  93. {% url 'thread' thread=thread.pk, slug=thread.slug %}
  94. {%- endif %}#post-{{ post.pk }}" class="post-perma pull-right tooltip-left" title="{% trans %}Direct link to this post{% endtrans %}">#{{ pagination['start'] + loop.index }}</a>
  95. </div>
  96. <div class="post-content">
  97. {% trans %}This reply was posted by user that is on your ignored list.{% endtrans %}
  98. </div>
  99. </div>
  100. {% else %}
  101. <div id="post-{{ post.pk }}" class="well well-post{% if post.user and post.user.rank and post.user.rank.style %} {{ post.user.rank.style }}{% endif %}">
  102. <div class="post-author">
  103. <img src="{% if post.user_id %}{{ post.user.get_avatar(80) }}{% else %}{{ macros.avatar_guest(80) }}{% endif %}" alt="" class="avatar-normal">
  104. <div class="post-bit">
  105. {% if post.user_id %}
  106. <a href="{% url 'user' user=post.user.pk, username=post.user.username_slug %}" class="lead">{{ post.user.username }}</a>
  107. {% if post.user.get_title() %}<p class="user-title">{{ _(post.user.get_title()) }}</p>{% endif %}
  108. {% else %}
  109. <span class="lead">{{ post.user_name }}</span>
  110. <p class="user-title">{% trans %}Unregistered{% endtrans %}</p>
  111. {% endif %}
  112. <p class="post-date">{{ post.date|reltimesince|low }}</p>
  113. </div>
  114. </div>
  115. <div class="post-extra">
  116. {% if user.is_authenticated() and posts_form %}
  117. <label class="checkbox post-checkbox"><input form="posts_form" name="{{ posts_form['list_items']['html_name'] }}" type="checkbox" class="checkbox-member" value="{{ post.pk }}"{% if posts_form['list_items']['has_value'] and ('' ~ post.pk) in posts_form['list_items']['value'] %} checked="checked"{% endif %}></label>
  118. {% endif %}
  119. <a href="{% if pagination['page'] > 1 -%}
  120. {% url 'thread' thread=thread.pk, slug=thread.slug, page=pagination['page'] %}
  121. {%- else -%}
  122. {% url 'thread' thread=thread.pk, slug=thread.slug %}
  123. {%- endif %}#post-{{ post.pk }}" class="post-perma pull-right tooltip-left" title="{% trans %}Direct link to this post{% endtrans %}">#{{ pagination['start'] + loop.index }}</a>
  124. {% if not post.is_read %}
  125. <span class="label label-warning pull-right">
  126. {% trans %}New{% endtrans %}
  127. </span>
  128. {% endif %}
  129. {% if post.moderated %}
  130. <span class="label label-purple pull-right">
  131. {% trans %}Unreviewed{% endtrans %}
  132. </span>
  133. {% endif %}
  134. {% if post.reported %}
  135. <span class="label label-important pull-right">
  136. {% trans %}Reported{% endtrans %}
  137. </span>
  138. {% endif %}
  139. {% if post.deleted %}
  140. <span class="label label-inverse pull-right">
  141. {% trans %}Deleted{% endtrans %}
  142. </span>
  143. {% endif %}
  144. {% if post.protected and acl.threads.can_protect(forum) %}
  145. <span class="label label-info pull-right">
  146. {% trans %}Protected{% endtrans %}
  147. </span>
  148. {% endif %}
  149. {% if acl.threads.can_see_post_score(forum) %}
  150. <ul class="nav nav-pills post-rating pull-right">
  151. {% if user.is_authenticated() and user.pk != post.user_id and acl.threads.can_upvote_posts(forum) %}
  152. <li{% if post.karma_vote and post.karma_vote.score > 0 %} class="active"{% endif %}><form action="{% url 'post_upvote' thread=thread.pk, slug=thread.slug, post=post.pk %}" method="post"><button type="submit" class="btn btn-upvote"{% if post.karma_vote and post.karma_vote.score > 0 %} disabled="disabled"{% endif %}><i class="icon-thumbs-up"></i></button><input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}"></form></li>
  153. {% endif %}
  154. <li><{% if acl.threads.can_see_post_votes(forum) %}a href="{% url 'post_votes' thread=thread.pk, slug=thread.slug, post=post.pk %}"{% else %}span{% endif %} class="label{% if (post.upvotes - post.downvotes) > 0 %} label-success{% elif (post.upvotes - post.downvotes) < 0 %} label-important{% endif %}{% if acl.threads.can_see_post_score(forum) == 2 %} tooltip-left{% endif %}"{% if acl.threads.can_see_post_score(forum) == 2 %} title="+{{ post.upvotes }} / -{{ post.downvotes }}"{% endif %}>{% if (post.upvotes - post.downvotes) > 0 %}+{% endif %}{{ post.upvotes - post.downvotes }}</{% if acl.threads.can_see_post_votes(forum) %}a{% else %}span{% endif %}></li>
  155. {% if user.is_authenticated() and user.pk != post.user_id and acl.threads.can_downvote_posts(forum) %}
  156. <li{% if post.karma_vote and post.karma_vote.score < 0 %} class="active"{% endif %}><form action="{% url 'post_downvote' thread=thread.pk, slug=thread.slug, post=post.pk %}" method="post"><button type="submit" class="btn btn-downvote"{% if post.karma_vote and post.karma_vote.score < 0 %} disabled="disabled"{% endif %}><i class="icon-thumbs-down"></i></button><input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}"></form></li>
  157. {% endif %}
  158. </ul>
  159. {% endif %}
  160. </div>
  161. <div class="post-content">
  162. <div class="markdown">
  163. {{ post.post_preparsed|markdown_final|safe }}
  164. </div>
  165. {% if post.user.signature %}
  166. <div class="post-foot">
  167. {% if post.user.signature %}
  168. <div class="signature">
  169. <div class="markdown">
  170. {{ post.user.signature_preparsed|markdown_final|safe }}
  171. </div>
  172. </div>
  173. {% endif %}
  174. </div>
  175. {% endif %}
  176. </div>
  177. <div class="post-nav">
  178. {% if post.edits %}
  179. {% if acl.threads.can_see_changelog(user, forum, post) %}
  180. <a href="{% url 'changelog' thread=thread.pk, slug=thread.slug, post=post.pk %}" class="changelog tooltip-bottom" title="{% trans %}Show changelog{% endtrans %}">{% trans count=post.edits %}One edit{% pluralize %}{{ count }} edits{% endtrans %}</a>
  181. {% else %}
  182. <span class="changelog">{% trans count=post.edits %}One edit{% pluralize %}{{ count }} edits{% endtrans %}</span>
  183. {% endif %}
  184. {% endif %}
  185. {% if user.is_authenticated() %}
  186. <ul class="nav nav-pills pull-right">
  187. {% if post.pk == thread.start_post_id %}
  188. {% if acl.threads.can_delete_thread(user, forum, thread, post) == 2 -%}
  189. <li class="tooltip-top" title="{% trans %}Delete this thread for good{% endtrans %}"><form action="{% url 'thread_delete' thread=thread.pk, slug=thread.slug %}" class="prompt-delete-thread" method="post"><button type="submit" class="btn danger"><i class="icon-remove"></i></button><input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}"></form></li>{% endif %}
  190. {% if not post.deleted and acl.threads.can_delete_thread(user, forum, thread, post) -%}
  191. <li><form action="{% url 'thread_hide' thread=thread.pk, slug=thread.slug %}" class="prompt-delete-thread" method="post"><button type="submit" class="btn danger"><i class="icon-trash"></i> {% trans %}Delete{% endtrans %}</button><input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}"></form></li>{% endif %}
  192. {% elif post.pk != thread.start_post_id and acl.threads.can_delete_post(user, forum, thread, post) %}
  193. {% if acl.threads.can_delete_post(user, forum, thread, post) == 2 -%}
  194. <li class="tooltip-top" title="{% trans %}Delete this reply for good{% endtrans %}"><form action="{% url 'post_delete' thread=thread.pk, slug=thread.slug, post=post.pk %}" class="prompt-delete-post" method="post"><button type="submit" class="btn danger"><i class="icon-remove"></i></button><input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}"></form></li>{% endif %}
  195. {% if not post.deleted and acl.threads.can_delete_post(user, forum, thread, post) -%}
  196. <li><form action="{% url 'post_hide' thread=thread.pk, slug=thread.slug, post=post.pk %}" class="prompt-delete-post" method="post"><button type="submit" class="btn danger"><i class="icon-trash"></i> {% trans %}Delete{% endtrans %}</button><input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}"></form></li>{% endif %}
  197. {% endif %}
  198. {% if acl.users.can_see_users_trails() -%}
  199. <li><a href="{% url 'post_info' thread=thread.pk, slug=thread.slug, post=post.pk %}"><i class="icon-qrcode"></i> {% trans %}Info{% endtrans %}</a></li>
  200. {% endif %}
  201. {% if acl.threads.can_edit_thread(user, forum, thread, post) and thread.start_post_id == post.pk -%}
  202. <li><a href="{% url 'thread_edit' thread=thread.pk, slug=thread.slug %}"><i class="icon-edit"></i> {% trans %}Edit{% endtrans %}</a></li>
  203. {% elif acl.threads.can_edit_reply(user, forum, thread, post) %}
  204. <li><a href="{% url 'post_edit' thread=thread.pk, slug=thread.slug, post=post.pk %}"><i class="icon-edit"></i> {% trans %}Edit{% endtrans %}</a></li>
  205. {%- endif %}
  206. {% if acl.threads.can_reply(forum, thread) %}<li><a href="{% url 'thread_reply' thread=thread.pk, slug=thread.slug, quote=post.pk %}"><i class="icon-comment"></i> {% trans %}Reply{% endtrans %}</a></li>{% endif %}
  207. </ul>
  208. {% endif %}
  209. </div>
  210. </div>
  211. {% endif %}
  212. {% if post.checkpoint_set.all() %}
  213. <div class="post-checkpoints">
  214. {% for checkpoint in post.checkpoint_set.all() %}
  215. <div class="checkpoint">
  216. <hr>
  217. <span>
  218. {%- if checkpoint.action == 'limit' -%}
  219. <i class="icon-lock"></i> {% trans %}This thread has reached its post limit and has been closed.{% endtrans %}
  220. {%- elif checkpoint.action == 'accepted' -%}
  221. <i class="icon-ok"></i> {% trans user=checkpoint_user(checkpoint), date=checkpoint.date|reltimesince|low %}{{ user }} accepted this thread {{ date }}{% endtrans %}
  222. {%- elif checkpoint.action == 'closed' -%}
  223. <i class="icon-lock"></i> {% trans user=checkpoint_user(checkpoint), date=checkpoint.date|reltimesince|low %}{{ user }} closed this thread {{ date }}{% endtrans %}
  224. {%- elif checkpoint.action == 'opened' -%}
  225. <i class="icon-lock"></i> {% trans user=checkpoint_user(checkpoint), date=checkpoint.date|reltimesince|low %}{{ user }} opened this thread {{ date }}{% endtrans %}
  226. {%- elif checkpoint.action == 'deleted' -%}
  227. <i class="icon-trash"></i> {% trans user=checkpoint_user(checkpoint), date=checkpoint.date|reltimesince|low %}{{ user }} deleted this thread {{ date }}{% endtrans %}
  228. {%- elif checkpoint.action == 'undeleted' -%}
  229. <i class="icon-trash"></i> {% trans user=checkpoint_user(checkpoint), date=checkpoint.date|reltimesince|low %}{{ user }} restored this thread {{ date }}{% endtrans %}
  230. {%- endif -%}
  231. </span>
  232. </div>
  233. {% endfor %}
  234. </div>
  235. {% endif %}
  236. {% endfor %}
  237. </div>
  238. {% if user.is_authenticated() and (thread_form or posts_form) %}
  239. <div class="form-actions table-footer mod-actions">
  240. {% if thread_form%}
  241. <form id="thread_form" class="form-inline pull-left" action="{% url 'thread' slug=thread.slug, thread=thread.id, page=pagination['page'] %}" method="POST">
  242. <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
  243. <input type="hidden" name="origin" value="thread_form">
  244. {{ form_theme.input_select(thread_form['thread_action'],width=3) }}
  245. <button type="submit" class="btn btn-primary">{% trans %}Go{% endtrans %}</button>
  246. </form>
  247. {% endif %}
  248. {% if posts_form%}
  249. <form id="posts_form" class="form-inline pull-right" action="{% url 'thread' slug=thread.slug, thread=thread.id, page=pagination['page'] %}" method="POST">
  250. <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
  251. <input type="hidden" name="origin" value="posts_form">
  252. {{ form_theme.input_select(posts_form['list_action'],width=3) }}
  253. <button type="submit" class="btn btn-primary">{% trans %}Go{% endtrans %}</button>
  254. </form>
  255. {% endif %}
  256. </div>
  257. {% endif %}
  258. <div class="list-nav last">
  259. {{ pager(false) }}
  260. {% if user.is_authenticated() and acl.threads.can_reply(forum, thread) %}
  261. <ul class="nav nav-pills pull-right">
  262. <li class="primary"><a href="{% url 'thread_reply' thread=thread.pk, slug=thread.slug %}"><i class="icon-pencil"></i> {% trans %}Reply{% endtrans %}</a></li>
  263. </ul>
  264. {% endif %}
  265. </div>
  266. {% if user.is_authenticated() and acl.threads.can_reply(forum, thread) %}
  267. <div class="quick-reply">
  268. <form action="{% url 'thread_reply' thread=thread.pk, slug=thread.slug %}" method="post">
  269. <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
  270. <input type="hidden" name="quick_reply" value="1">
  271. <img src="{{ user.get_avatar() }}" alt="{% trans %}Your Avatar{% endtrans %}" class="avatar-big">
  272. <div class="arrow"></div>
  273. {{ editor.editor(quick_reply.post, _('Post Reply'), extra=editor_extra()) }}
  274. </form>
  275. </div>
  276. {% endif %}
  277. {% endblock %}
  278. {% block javascripts -%}
  279. {{ super() }}
  280. {%- if user.is_authenticated() %}
  281. <script type="text/javascript">
  282. $(function () {
  283. $('#thread_form').submit(function() {
  284. if ($('#id_thread_action').val() == 'hard') {
  285. var decision = confirm("{% trans %}Are you sure you want to delete this thread? This action is not reversible!{% endtrans %}");
  286. return decision;
  287. }
  288. return true;
  289. });
  290. $('#posts_form').submit(function() {
  291. if ($('.post-checkbox[]:checked').length == 0) {
  292. alert("{% trans %}You have to select at least one post.{% endtrans %}");
  293. return false;
  294. }
  295. if ($('#id_list_action').val() == 'merge') {
  296. if ($('.post-checkbox[]:checked').length < 2) {
  297. alert("{% trans %}You have to select at least two posts you want to merge.{% endtrans %}");
  298. return false;
  299. }
  300. var decision = confirm("{% trans %}Are you sure you want to merge selected posts? This action is not reversible!{% endtrans %}");
  301. return decision;
  302. }
  303. if ($('#id_list_action').val() == 'hard') {
  304. var decision = confirm("{% trans %}Are you sure you want to delete selected posts? This action is not reversible!{% endtrans %}");
  305. return decision;
  306. }
  307. return true;
  308. });
  309. $('.prompt-delete-thread').submit(function() {
  310. var decision = confirm("{% trans %}Are you sure you want to delete this thread?{% endtrans %}");
  311. return decision;
  312. });
  313. $('.prompt-delete-post').submit(function() {
  314. var decision = confirm("{% trans %}Are you sure you want to delete this post?{% endtrans %}");
  315. return decision;
  316. });
  317. });
  318. </script>{% endif %}
  319. {% if user.is_authenticated() and acl.threads.can_reply(forum, thread) %}
  320. {{ editor.js() }}
  321. {% endif %}
  322. {%- endblock %}
  323. {% macro pager(extra=true) %}
  324. <ul class="pager pull-left">
  325. {%- if pagination['prev'] > 1 %}<li><a href="{% url 'thread' slug=thread.slug, thread=thread.id %}" class="tooltip-top" title="{% trans %}Go to first page{% endtrans %}"><i class="icon-chevron-left"></i> {% trans %}First{% endtrans %}</a></li>{% endif -%}
  326. {%- if pagination['prev'] > 0 %}<li><a href="{%- if pagination['prev'] > 1 %}{% url 'thread' slug=thread.slug, thread=thread.id, page=pagination['prev'] %}{% else %}{% url 'thread' slug=thread.slug, thread=thread.id %}{% endif %}" class="tooltip-top" title="{% trans %}Older Posts{% endtrans %}"><i class="icon-chevron-left"></i></a></li>{% endif -%}
  327. {%- if pagination['next'] > 0 %}<li><a href="{% url 'thread' slug=thread.slug, thread=thread.id, page=pagination['next'] %}" class="tooltip-top" title="{% trans %}Newest Posts{% endtrans %}"><i class="icon-chevron-right"></i></a></li>{% endif -%}
  328. {%- if pagination['next'] > 0 and pagination['next'] < pagination['total'] %}<li><a href="{% url 'thread' slug=thread.slug, thread=thread.id, page=pagination['total'] %}" class="tooltip-top" title="{% trans %}Go to last page{% endtrans %}">{% trans %}Last{% endtrans %} <i class="icon-chevron-right"></i></a></li>{% endif -%}
  329. <li class="count">
  330. {%- trans current_page=pagination['page'], pages=pagination['total'] -%}
  331. Page {{ current_page }} of {{ pages }}
  332. {%- endtrans -%}
  333. </li>
  334. {% if extra and user.is_authenticated() %}
  335. {% if not is_read %}<li class="unread"><a href="{% url 'thread_new' slug=thread.slug, thread=thread.id %}" class="tooltip-top" title="{% trans %}Go to first unread{% endtrans %}"><i class="icon-star"></i> {% trans %}First Unread{% endtrans %}</a></li>{% endif %}
  336. {% if thread.replies_moderated > 0 and acl.threads.can_approve(forum) %}<li class="moderated"><a href="{% url 'thread_moderated' slug=thread.slug, thread=thread.id %}" class="tooltip-top" title="{% trans %}Go to first post awaiting review{% endtrans %}"><i class="icon-eye-close"></i> {% trans %}First Unreviewed{% endtrans %}</a></li>{% endif %}
  337. {% if thread.replies_reported > 0 and acl.threads.can_mod_posts(thread) %}<li class="reported"><a href="{% url 'thread_reported' slug=thread.slug, thread=thread.id %}" class="tooltip-top" title="{% trans %}Go to first reported post{% endtrans %}"><i class="icon-fire"></i> {% trans %}First Reported{% endtrans %}</a></li>{% endif %}
  338. {% endif %}
  339. </ul>
  340. {% endmacro %}
  341. {% macro checkpoint_user(checkpoint) -%}
  342. {%- if checkpoint.user_id -%}
  343. {{ ('<a href="' ~ 'user'|url(user=checkpoint.user_id, username=checkpoint.user_slug) ~ '">')|safe ~ (checkpoint.user_name) ~ ("</a>")|safe }}
  344. {%- else -%}
  345. <strong>{{ checkpoint.user_name }}</strong>
  346. {%- endif -%}
  347. {%- endmacro %}
  348. {% macro edit_user(post) -%}
  349. {%- if post.edit_user_id -%}
  350. {{ ('<a href="' ~ 'user'|url(user=post.edit_user_id, username=post.edit_user_slug) ~ '">')|safe ~ (post.edit_user_name) ~ ("</a>")|safe }}
  351. {%- else -%}
  352. <strong>{{ post.edit_user_name }}</strong>
  353. {%- endif -%}
  354. {%- endmacro %}
  355. {% macro editor_extra() %}
  356. <button id="editor-preview" name="preview" type="submit" class="btn btn-success pull-right">{% trans %}Full Editor{% endtrans %}</button>
  357. {% endmacro %}