forum.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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') }}">Forum</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" style="padding-bottom: 10px">
  12. {{ render_pagination(topics, forum.url) }}
  13. </div> <!-- end span pagination -->
  14. {% if current_user|post_topic(forum) %}
  15. <div class="pull-right" style="padding-bottom: 10px">
  16. <div class="btn-group">
  17. <a href="{{ url_for('forum.markread', forum_id=forum.id, slug=forum.slug) }}" class="btn btn-default">
  18. <span class="fa fa-check"></span> Mark as Read
  19. </a>
  20. {% if forum.locked %}
  21. <span class="btn btn-primary">
  22. <span class="fa fa-lock"></span> Locked
  23. </span>
  24. {% else %}
  25. <a href="{{ url_for('forum.new_topic', forum_id=forum.id, slug=forum.slug) }}" class="btn btn-primary">
  26. <span class="fa fa-pencil"></span> New Topic
  27. </a>
  28. {% endif %}
  29. </div>
  30. </div>
  31. {% endif %}
  32. <table class="table table-bordered">
  33. <thead>
  34. <tr>
  35. <th colspan="5">
  36. {{ forum.title }}
  37. </th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. <tr>
  42. <td colspan="2">Topic</td>
  43. <td>Posts</td>
  44. <td>Views</td>
  45. <td>Last Post</td>
  46. </tr>
  47. {% for topic, topicread in topics.items %}
  48. <tr>
  49. <td width="4%" style="vertical-align: middle; text-align: center;">
  50. {% if topic.locked %}
  51. <span class="fa fa-lock" style="font-size: 2em"></span>
  52. {% elif topic.important %}
  53. {% if topic|topic_is_unread(topicread, current_user, forumsread) %}
  54. <span class="fa fa-star" style="font-size: 2em"></span>
  55. {% else %}
  56. <span class="fa fa-star-o" style="font-size: 2em"></span>
  57. {% endif %}
  58. {% else %}
  59. {% if topic|topic_is_unread(topicread, current_user, forumsread) %}
  60. <span class="fa fa-comment" style="font-size: 2em"></span>
  61. {% else %}
  62. <span class="fa fa-comment-o" style="font-size: 2em"></span>
  63. {% endif %}
  64. {% endif %}
  65. </td>
  66. <td>
  67. <div>
  68. <a href="{{ topic.url }}">{{ topic.title }}</a>
  69. <!-- Topic Pagination -->
  70. {{ topic_pages(topic, flaskbb_config["POSTS_PER_PAGE"]) }}
  71. <br />
  72. {% if topic.user_id %}
  73. <small>by <a href="{{ topic.user.url }}">{{ topic.user.username }}</a></small>
  74. {% else %}
  75. <small>by {{ topic.username }}</small>
  76. {% endif %}
  77. </div>
  78. </td>
  79. <td>
  80. {{ topic.post_count }}
  81. </td>
  82. <td>
  83. {{ topic.views }}
  84. </td>
  85. <td>
  86. <a href="{{ topic.last_post.url }}">{{ topic.last_post.date_created|time_since }}</a><br />
  87. {% if topic.last_post.user_id %}
  88. <small>by <a href="{{ topic.last_post.user.url }}">{{ topic.last_post.user.username }}</a></small>
  89. {% else %}
  90. <small>{{ topic.last_post.username }}</small>
  91. {% endif %}
  92. </td>
  93. </tr>
  94. {% else %}
  95. <tr>
  96. <td colspan="5">
  97. No Topics so far.
  98. </td>
  99. </tr>
  100. {% endfor %}
  101. </tbody>
  102. </table>
  103. {% endblock %}