forum.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {% set page_title = forum.title %}
  2. {% set active_forum_nav=True %}
  3. {% extends theme("layout.html") %}
  4. {% block content %}
  5. {% from theme('macros.html') import render_pagination, topic_pages %}
  6. <ol class="breadcrumb">
  7. <li><a href="{{ url_for('forum.index') }}">{% trans %}Forum{% endtrans %}</a></li>
  8. <li><a href="{{ forum.category.url }}">{{ forum.category.title }}</a></li>
  9. <li class="active">{{ forum.title }}</li>
  10. </ol>
  11. <div class="pull-left">
  12. {{ render_pagination(topics, forum.url) }}
  13. </div> <!-- end span pagination -->
  14. {% if current_user|post_topic(forum) %}
  15. <div class="pull-right">
  16. <form class="inline-form" method="post" action="{{ url_for('forum.markread', forum_id=forum.id, slug=forum.slug) }}">
  17. <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
  18. <button class="btn btn-default">
  19. <span class="fa fa-check"></span> {% trans %}Mark as Read{% endtrans %}
  20. </button>
  21. </form>
  22. {% if forum.locked %}
  23. <span class="btn btn-primary">
  24. <span class="fa fa-lock"></span> {% trans %}Locked{% endtrans %}
  25. </span>
  26. {% else %}
  27. <a href="{{ url_for('forum.new_topic', forum_id=forum.id, slug=forum.slug) }}" class="btn btn-primary">
  28. <span class="fa fa-pencil"></span> {% trans %}New Topic{% endtrans %}
  29. </a>
  30. {% endif %}
  31. </div>
  32. {% endif %}
  33. <table class="table table-bordered">
  34. <thead>
  35. <tr>
  36. <th colspan="5">
  37. {{ forum.title }}
  38. </th>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. <tr>
  43. <td colspan="2">{% trans %}Topic{% endtrans %}</td>
  44. <td>{% trans %}Posts{% endtrans %}</td>
  45. <td>{% trans %}Views{% endtrans %}</td>
  46. <td>{% trans %}Last Post{% endtrans %}</td>
  47. </tr>
  48. {% for topic, topicread in topics.items %}
  49. <tr>
  50. <td width="4%" style="vertical-align: middle; text-align: center;">
  51. {% if topic.locked %}
  52. <span class="fa fa-lock" style="font-size: 2em"></span>
  53. {% elif topic.important %}
  54. {% if topic|topic_is_unread(topicread, current_user, forumsread) %}
  55. <span class="fa fa-star" style="font-size: 2em"></span>
  56. {% else %}
  57. <span class="fa fa-star-o" style="font-size: 2em"></span>
  58. {% endif %}
  59. {% else %}
  60. {% if topic|topic_is_unread(topicread, current_user, forumsread) %}
  61. <span class="fa fa-comment" style="font-size: 2em"></span>
  62. {% else %}
  63. <span class="fa fa-comment-o" style="font-size: 2em"></span>
  64. {% endif %}
  65. {% endif %}
  66. </td>
  67. <td>
  68. <div>
  69. <a href="{{ topic.url }}">{{ topic.title }}</a>
  70. <!-- Topic Pagination -->
  71. {{ topic_pages(topic, flaskbb_config["POSTS_PER_PAGE"]) }}
  72. <br />
  73. <small>
  74. {% trans %}by{% endtrans %}
  75. {% if topic.user_id %}
  76. <a href="{{ topic.user.url }}">{{ topic.user.username }}</a>
  77. {% else %}
  78. {{ topic.username }}
  79. {% endif %}
  80. </small>
  81. </div>
  82. </td>
  83. <td>
  84. {{ topic.post_count }}
  85. </td>
  86. <td>
  87. {{ topic.views }}
  88. </td>
  89. <td>
  90. <a href="{{ topic.last_post.url }}">{{ topic.last_post.date_created|time_since }}</a><br />
  91. <small>
  92. {% trans %}by{% endtrans %}
  93. {% if topic.last_post.user_id %}
  94. <a href="{{ topic.last_post.user.url }}">{{ topic.last_post.user.username }}</a>
  95. {% else %}
  96. {{ topic.last_post.username }}
  97. {% endif %}
  98. </small>
  99. </td>
  100. </tr>
  101. {% else %}
  102. <tr>
  103. <td colspan="5">
  104. {% trans %}No Topics.{% endtrans %}
  105. </td>
  106. </tr>
  107. {% endfor %}
  108. </tbody>
  109. </table>
  110. {% endblock %}