topic_horizontal.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. {% extends theme("layout.html") %}
  2. {% set page_title = _("%(title)s - Topic", title=topic.title) %}
  3. {% set active_forum_nav=True %}
  4. {% block content %}
  5. {% from theme('macros.html') import render_pagination, form_field, generate_obj_id, generate_post_url %}
  6. <div class="topic-view">
  7. <ol class="breadcrumb flaskbb-breadcrumb">
  8. <li><a href="{{ url_for('forum.index') }}">{% trans %}Forum{% endtrans %}</a></li>
  9. <li><a href="{{ topic.forum.category.url }}">{{ topic.forum.category.title }}</a></li>
  10. <li><a href="{{ topic.forum.url }}">{{ topic.forum.title }}</a></li>
  11. <li class="active">{{ topic.title }}</li>
  12. </ol>
  13. {% include theme('forum/topic_controls.html') %}
  14. {% if topic.hidden %}
  15. <div class="alert alert-warning">
  16. <span class="fa fa-user-secret"></span>
  17. {{ gettext("This topic is hidden (%(when)s by %(who)s)", who=topic.hidden_by.username, when=format_date(topic.hidden_at)) }}
  18. </div>
  19. {% endif %}
  20. <div class="panel topic-panel">
  21. <div class="panel-heading topic-head">
  22. <a href="{{ topic.url }}">{{ topic.title }}</a>
  23. </div>
  24. <div class="panel-body topic-body">
  25. {% for post, user in posts.items %}
  26. <div id="{{ post.id }}" class="row post-row clearfix">
  27. <div class="author author-horizontal col-md-12 col-sm-12 col-xs-12">
  28. <div class="pull-left">
  29. {% if user.avatar %}
  30. <div class="author-box">
  31. <div class="author-avatar hidden-xs"><img src="{{ user.avatar }}" alt="avatar"></div>
  32. </div>
  33. {% endif %}
  34. <div class="author-box">
  35. <!-- Registered User -->
  36. <div class="author-name"><h4><a href="{{ user.url }}">{{ user.username }}</a></h4></div>
  37. <!-- check whether user is online or not -->
  38. {% if user|is_online %}
  39. <div class="author-online" data-toggle="tooltip" data-placement="top" title="online"></div>
  40. {% else %}
  41. <div class="author-offline" data-toggle="tooltip" data-placement="top" title="offline"></div>
  42. {% endif %}
  43. <div class="author-title"><h5>{{ user.primary_group.name }}</h5></div>
  44. {{ run_hook("flaskbb_tpl_before_post_author_info", user=user, post=post) }}
  45. </div>
  46. </div>
  47. <div class="pull-right">
  48. <div class="author-box clearfix">
  49. <div class="author-registered">{% trans %}Joined{% endtrans %}: {{ user.date_joined|format_date }}</div>
  50. <div class="author-posts">{% trans %}Posts{% endtrans %}: {{ user.post_count }}</div>
  51. {{ run_hook("flaskbb_tpl_after_post_author_info", user=user, post=post) }}
  52. </div>
  53. </div>
  54. </div>
  55. <div class="post-box post-horizontal col-md-12 col-sm-12 col-xs-12">
  56. <div class="post-meta clearfix">
  57. <div class="pull-left">
  58. <!-- Creation date / Date modified -->
  59. <a href="{{ post.url }}">
  60. {{ post.date_created|format_datetime }}
  61. </a>
  62. {% if post.user_id and post.date_modified %}
  63. <small>
  64. (Last modified: {{ post.date_modified|format_datetime }} by
  65. <a href="{{ url_for('user.profile', username=post.modified_by) }}">{{ post.modified_by }}</a>.)
  66. </small>
  67. {% endif %}
  68. </div>
  69. <!-- Post number -->
  70. <div class="pull-right">
  71. <strong>#{{ generate_obj_id(posts, loop.index, flaskbb_config["POSTS_PER_PAGE"]) }}</strong>
  72. </div>
  73. </div>
  74. <div class="post-content clearfix" id="pid{{ post.id }}">
  75. {{ post.content|markup }}
  76. <!-- Signature Begin -->
  77. {% if flaskbb_config["SIGNATURE_ENABLED"] and post.user_id and user.signature %}
  78. <div class="post-signature hidden-xs">
  79. <hr />
  80. {{ user.signature|markup }}
  81. </div>
  82. {% endif %}
  83. <!-- Signature End -->
  84. </div>
  85. <div class="post-footer clearfix">
  86. <!-- Report/Edit/Delete/Quote Post-->
  87. <div class="post-menu pull-right">
  88. {{ run_hook("flaskbb_tpl_post_menu_before", post=post) }}
  89. {% if current_user|post_reply(topic) %}
  90. <!-- Quick quote -->
  91. <a href="#" class="btn btn-icon icon-reply quote-btn" data-post-id="{{ post.id }}" data-toggle="tooltip" data-placement="top" title="Quote this post"></a>
  92. <!-- Full quote/reply -->
  93. <a href="{{ url_for('forum.reply_post', topic_id=topic.id, post_id=post.id) }}" class="btn btn-icon icon-replyall" data-toggle="tooltip" data-placement="top" title="Full Reply"></a>
  94. {% endif %}
  95. {% if current_user|edit_post(post) %}
  96. <!-- Edit Post -->
  97. <a href="{{ url_for('forum.edit_post', post_id=post.id) }}" class="btn btn-icon icon-edit" data-toggle="tooltip" data-placement="top" title="Edit this post"></a>
  98. {% endif %}
  99. {% if topic.first_post == post %}
  100. {% if current_user|delete_topic(topic) %}
  101. <form class="inline-form" method="post" action="{{ url_for('forum.delete_topic', topic_id=topic.id, slug=topic.slug) }}">
  102. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
  103. <button class="btn btn-icon icon-delete" data-toggle="tooltip" data-placement="top" title="Delete this topic"></button>
  104. </form>
  105. {% endif %}
  106. {% else %}
  107. {% if current_user|delete_post(post) %}
  108. <!-- Delete Post -->
  109. <form class="inline-form" method="post" action="{{ url_for('forum.delete_post', post_id=post.id) }}">
  110. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
  111. <button class="btn btn-icon icon-delete" data-toggle="tooltip" data-placement="top" title="Delete this post"></button>
  112. </form>
  113. {% endif %}
  114. {% endif %}
  115. {% if current_user.is_authenticated %}
  116. <!-- Report post -->
  117. <a href="{{ url_for('forum.report_post', post_id=post.id) }}" onclick="window.open(this.href, 'wio_window','width=500,height=500'); return false;" class="btn btn-icon icon-report" data-toggle="tooltip" data-placement="top" title="Report this post"></a>
  118. {% endif %}
  119. {% if current_user.permissions.get('makehidden') %}
  120. {% if topic.first_post_id == post.id %}
  121. {% if topic.hidden %}
  122. <form class="inline-form" method="post" action="{{ url_for('forum.unhide_topic', topic_id=topic.id) }}">
  123. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
  124. <button class="btn btn-icon fa fa-user" name="unhide" data-toggle="tooltip" data-placement="top" title="Unhide this topic"></button>
  125. </form>
  126. {% else %}
  127. <form class="inline-form" method="post" action="{{ url_for('forum.hide_topic', topic_id=topic.id) }}">
  128. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
  129. <button class="btn btn-icon fa fa-user-secret" name="hide" data-toggle="tooltip" data-placement="top" title="Hide this topic"></button>
  130. </form>
  131. {% endif %}
  132. {% else %}
  133. {% if post.hidden %}
  134. <form class="inline-form" method="post" action="{{ url_for('forum.unhide_post', post_id=post.id) }}">
  135. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
  136. <button class="btn btn-icon fa fa-user" name="unhide" data-toggle="tooltip" data-placement="top" title="Unhide this post"></button>
  137. </form>
  138. {% else %}
  139. <form class="inline-form" method="post" action="{{ url_for('forum.hide_post', post_id=post.id) }}">
  140. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
  141. <button class="btn btn-icon fa fa-user-secret" name="hide" data-toggle="tooltip" data-placement="top" title="Hide this post"></button>
  142. </form>
  143. {% endif %}
  144. {% endif %}
  145. {% endif %}
  146. {{ run_hook("flaskbb_tpl_post_menu_after", post=post) }}
  147. </div> <!-- end post-menu -->
  148. </div> <!-- end footer -->
  149. </div>
  150. </div>
  151. {% endfor %}
  152. </div> <!-- end topic-body -->
  153. </div> <!-- end topic-panel -->
  154. {% include theme('forum/topic_controls.html') %}
  155. {% from theme("macros.html") import render_field, render_quickreply, render_submit_field %}
  156. {% if form %}
  157. <form class="form" action="#" method="post">
  158. {{ form.hidden_tag() }}
  159. <div class="row">
  160. <div class="col-md-offset-2 col-sm-offset-3 col-md-10 col-sm-9 col-xs-12">
  161. <div class="editor-box">
  162. <div class="editor quickreply">
  163. {{ render_quickreply(form.content, div_class="new-message", rows=7, cols=75, placeholder="", **{'data-provide': 'markdown', 'data-autofocus': 'false', 'class': 'flaskbb-editor'}) }}
  164. </div>
  165. <div class="editor-submit">
  166. {{ render_submit_field(form.submit, input_class="btn btn-success pull-right") }}
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. </form>
  172. {% include theme('editor_help.html') %}
  173. {% endif %}
  174. </div>
  175. {% include theme('confirm_dialog.html') %}
  176. {% endblock %}