123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- {% set page_title = forum.title ~ " - Forum" %}
- {% set active_forum_nav=True %}
- {% extends "layout.html" %}
- {% block content %}
- {% from 'macros.html' import render_pagination %}
- <ol class="breadcrumb">
- <li><a href="{{ url_for('forum.index') }}">Forum</a></li>
- {% for breadcrumb_item in forum.get_breadcrumbs() %}
- <li><a href="{{ url_for('forum.view_forum', forum_id=breadcrumb_item.id) }}">{{ breadcrumb_item.title }}</a></li>
- {% endfor %}
- <li class="active">{{ forum.title }}</li>
- </ol>
- <div class="pull-left" style="padding-bottom: 10px">
- {{ render_pagination(topics, url_for('forum.view_forum', forum_id=forum.id)) }}
- </div>
- {% if current_user|post_topic(forum) and not forum.is_category %}
- <div class="pull-right" style="padding-bottom: 10px">
- <a href="{{ url_for('forum.new_topic', forum_id=forum.id) }}" class="btn btn-primary">New Topic</a>
- </div>
- {% endif %}
- {% if forum.children|length %}
- <table class="table table-bordered">
- <thead>
- <tr>
- <th colspan="5">
- Subforums
- </th>
- </tr>
- <tr>
- <th colspan="2">Forum</th>
- <th width="85" align="center" style="white-space: nowrap">Topics</th>
- <th width="85" align="center" style="white-space: nowrap">Posts</th>
- <th width="200" align="center" style="white-space: nowrap">Last Post</th>
- </tr>
- </thead>
- <tbody>
- {% for subforum in forum.children %}
- <tr>
- <td align="center" valign="center" width="1">
- New </br> Posts
- </td>
- <td valign="top">
- <strong><a href="{{ url_for('forum.view_forum', forum_id=subforum.id) }}">{{ subforum.title }}</a></strong>
- <div class="forum-description">
- {% autoescape false %}
- {{ subforum.description|markup }}
- {% endautoescape %}
- </div>
- {% if subforum.children|length %}
- <div class="forum-subforums">
- <ul class="list-inline">
- <li><strong>Subforums:</strong></li>
- {% for subforum2 in subforum.children %}
- <li>
- <a href="{{ url_for('forum.view_forum', forum_id=subforum2.id) }}">{{ subforum2.title }}</a>
- </li>
- {% endfor %}
- </ul>
- </div>
- {% endif %}
- </td>
- <td valign="top" align="center" style="white-space: nowrap">{{ subforum.topic_count }}</td>
- <td valign="top" align="center" style="white-space: nowrap">{{ subforum.post_count }}</td>
- <td valign="top" align="right" style="white-space: nowrap">
- {% if subforum.last_post %}
- <a href="{{ url_for('forum.view_post', post_id=subforum.last_post.id) }}" title="{{ subforum.last_post.topic.title }}">
- <strong>{{ subforum.last_post.topic.title|crop_title }}</strong>
- </a>
- <br />
- {{ subforum.last_post.date_created|time_since }}<br />
- by <a href="{{ url_for('user.profile', username=subforum.last_post.user.username) }}">{{ subforum.last_post.user.username }}</a>
- {% else %}
- No posts
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% endif %}
- {% if not forum.is_category %}
- <table class="table table-bordered">
- <thead>
- <tr>
- <th colspan="5">
- {{ forum.title }}
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td colspan="2">Thread</td>
- <td>Posts</td>
- <td>Views</td>
- <td>Last Post</td>
- </tr>
- {% for topic in topics.items %}
- <tr>
- <td width="4%"></td>
- <td>
- <div>
- <a href="{{ url_for('forum.view_topic', topic_id=topic.id) }}">{{ topic.title }}</a> <br />
- <small>by <a href="{{ url_for('user.profile', username=topic.user.username) }}">{{ topic.user.username }}</a></small>
- </div>
- </td>
- <td>
- {{ topic.post_count }}
- </td>
- <td>
- {{ topic.views }}
- </td>
- <td>
- <a href="{{ url_for('forum.view_post', post_id=topic.last_post.id) }}">{{ topic.last_post.date_created|time_since }}</a><br />
- <small>by <a href="{{ url_for('user.profile', username=topic.last_post.user.username) }}">{{ topic.last_post.user.username }}</a></small>
- </td>
- </tr>
- {% else %}
- <tr>
- <td colspan="5">
- No Topics so far.
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% endif %}
- {% endblock %}
|