topic_horizontal.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. <div class="panel topic-panel">
  15. <div class="panel-heading topic-head">
  16. <a href="{{ topic.url }}">{{ topic.title }}</a>
  17. </div>
  18. <div class="panel-body topic-body">
  19. {% for post, user in posts.items %}
  20. <div id="{{ post.id }}" class="row post-row clearfix">
  21. <div class="author author-horizontal col-md-12 col-sm-12 col-xs-12">
  22. <div class="pull-left">
  23. {% if user.avatar %}
  24. <div class="author-box">
  25. <div class="author-avatar hidden-xs"><img src="{{ user.avatar }}" alt="avatar"></div>
  26. </div>
  27. {% endif %}
  28. <div class="author-box">
  29. <!-- Registered User -->
  30. <div class="author-name"><h4><a href="{{ user.url }}">{{ user.username }}</a></h4></div>
  31. <!-- check whether user is online or not -->
  32. {% if user|is_online %}
  33. <div class="author-online" data-toggle="tooltip" data-placement="top" title="online"></div>
  34. {% else %}
  35. <div class="author-offline" data-toggle="tooltip" data-placement="top" title="offline"></div>
  36. {% endif %}
  37. <div class="author-title"><h5>{{ user.primary_group.name }}</h5></div>
  38. </div>
  39. </div>
  40. <div class="pull-right">
  41. <div class="author-box clearfix">
  42. <div class="author-registered">{% trans %}Joined{% endtrans %}: {{ user.date_joined|format_date('%b %d %Y') }}</div>
  43. <div class="author-posts">{% trans %}Posts{% endtrans %}: {{ user.post_count }}</div>
  44. <div class="author-pm">
  45. {% if current_user.is_authenticated and post.user_id %}
  46. <a href="{{ url_for('message.new_conversation') }}?to_user={{ user.username }}">{% trans %}Message{% endtrans %}</a>
  47. {% endif %}
  48. </div>
  49. {% if user.website %}
  50. <div class="author-website"><a href="{{ user.website }}" rel="nofollow">{% trans %}Website{% endtrans %}</a></div>
  51. {% endif %}
  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_date('%d %B %Y - %H:%M') }}
  61. </a>
  62. {% if post.user_id and post.date_modified %}
  63. <small>
  64. (Last modified: {{ post.date_modified|format_date('%d %B %Y - %H:%M') }} 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. {% if current_user|post_reply(topic) %}
  89. <!-- Quick quote -->
  90. <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>
  91. <!-- Full quote/reply -->
  92. <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>
  93. {% endif %}
  94. {% if current_user|edit_post(post) %}
  95. <!-- Edit Post -->
  96. <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>
  97. {% endif %}
  98. {% if topic.first_post == post %}
  99. {% if current_user|delete_topic(topic) %}
  100. <form class="inline-form" method="post" action="{{ url_for('forum.delete_topic', topic_id=topic.id, slug=topic.slug) }}">
  101. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
  102. <button class="btn btn-icon icon-delete" data-toggle="tooltip" data-placement="top" title="Delete this topic"></button>
  103. </form>
  104. {% endif %}
  105. {% else %}
  106. {% if current_user|delete_post(post) %}
  107. <!-- Delete Post -->
  108. <form class="inline-form" method="post" action="{{ url_for('forum.delete_post', post_id=post.id) }}">
  109. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
  110. <button class="btn btn-icon icon-delete" data-toggle="tooltip" data-placement="top" title="Delete this post"></button>
  111. </form>
  112. {% endif %}
  113. {% endif %}
  114. {% if current_user.is_authenticated %}
  115. <!-- Report post -->
  116. <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>
  117. {% endif %}
  118. </div> <!-- end post-menu -->
  119. </div> <!-- end footer -->
  120. </div>
  121. </div>
  122. {% endfor %}
  123. </div> <!-- end topic-body -->
  124. </div> <!-- end topic-panel -->
  125. {% include theme('forum/topic_controls.html') %}
  126. {% from theme("macros.html") import render_field, render_quickreply, render_submit_field %}
  127. {% if form %}
  128. <form class="form" action="#" method="post">
  129. {{ form.hidden_tag() }}
  130. <div class="row">
  131. <div class="col-md-12 col-sm-12 col-xs-12">
  132. <div class="editor-box">
  133. <div class="editor quickreply">
  134. {{ render_quickreply(form.content, div_class="new-message", rows=7, cols=75, placeholder="", **{'data-provide': 'markdown', 'data-autofocus': 'false', 'id': 'quickreply-editor'}) }}
  135. </div>
  136. <div class="editor-submit">
  137. <div class="editor-options pull-left">
  138. <span class="label label-info">Markdown</span>
  139. <a class="label label-success" href="#">help</a> <!-- TODO: add markdown cheat sheet -->
  140. <a class="label label-success" href="#">emojis</a> <!-- TODO: add emoji cheat sheet -->
  141. </div>
  142. {{ render_submit_field(form.submit, input_class="btn btn-success pull-right") }}
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. </form>
  148. {% endif %}
  149. </div>
  150. {% endblock %}