123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- {% set page_title = topic.title ~ " - Topic" %}
- {% set active_forum_nav=True %}
- {% extends "layout.html" %}
- {% block content %}
- {% from 'macros.html' import render_pagination, form_field %}
- <ol class="breadcrumb">
- <li><a href="{{ url_for('forum.index') }}">Forum</a></li>
- {% for breadcrumb_item in topic.forum.get_breadcrumbs() %}
- <li><a href="{{ url_for('forum.view_forum', forum_id=breadcrumb_item.id) }}">{{ breadcrumb_item.title }}</a></li>
- {% endfor %}
- <li><a href="{{ url_for('forum.view_forum', forum_id=topic.forum.id) }}">{{ topic.forum.title }}</a></li>
- <li class="active">{{ topic.title }}</li>
- </ol>
- <div class="pull-left" style="padding-bottom: 10px">
- {{ render_pagination(posts, url_for('forum.view_topic', topic_id=topic.id)) }}
- </div> <!-- end span pagination -->
- <div class="pull-right" style="padding-bottom: 10px">
- {% if current_user|post_reply(topic.forum) and not topic.locked %}
- <a href="{{ url_for('forum.new_post', topic_id=topic.id) }}" class="btn btn-primary">Reply</a>
- {% endif %}
- {% if current_user|delete_topic(topic.first_post.user_id, topic.forum) %}
- <a href="{{ url_for('forum.delete_topic', topic_id=topic.id) }}" class="btn btn-primary">Delete Topic</a>
- {% endif %}
- {% if current_user.is_authenticated() %}
- {% if current_user.is_tracking_topic(topic) %}
- <a href="{{ url_for('forum.untrack_topic', topic_id=topic.id) }}" class="btn btn-primary">Untrack Topic</a>
- {% else %}
- <a href="{{ url_for('forum.track_topic', topic_id=topic.id) }}" class="btn btn-primary">Track Topic</a>
- {% endif %}
- {% endif %}
- </div>
- <table class="table table-bordered">
- <tbody>
- {% for post in posts.items %}
- <tr>
- <td >
- <span class="pull-right">
- <strong>#{%- if posts.page == 1 -%} {{ loop.index }} {%- else -%} {{ loop.index + (posts.page - 1) * per_page }} {%- endif -%}</strong>
- </span>
- <span class="pull-left">
- <a href="
- {% if posts.page > 1 %}
- {{ url_for('forum.view_topic', topic_id=topic.id) }}?page={{ posts.page }}#pid{{ post.id }}
- {% else %}
- {{ url_for('forum.view_topic', topic_id=topic.id) }}#pid{{ post.id }}
- {% endif %}
- ">{{ post.date_created|format_date('%d %B %Y') }}</a>
- {% if post.date_modified %}
- <small>
- (Last modified: {{ post.date_modified|format_date }} by <a href="{{ url_for('user.profile', username=post.user.username) }}">{{ post.user.username }}</a>.)
- </small>
- {% endif %}
- </span>
- </td>
- </tr>
- <tr>
- <td>
- <table class="table table-borderless">
- <tr>
- {% if post.user.avatar %}
- <td width="1">
- <img src="{{ post.user.avatar }}" alt="Avatar" height="100" width="100">
- </td>
- {% endif %}
- <td>
- <a href="{{ url_for('user.profile', username=post.user.username) }}"><span style="color: green;"><strong><em>{{ post.user.username }}</em></strong></span></a>
- {% if post.user|is_online %}
- <span class="label label-success">Online</span>
- {% else %}
- <span class="label label-default">Offline</span>
- {% endif %}
- <br />
- {{ post.user.primary_group.name }}<br />
- </td>
- <td class="pull-right">
- Posts: {{ post.user.post_count }}<br />
- Registered since: {{ post.user.date_joined|format_date('%b %d %Y') }}<br />
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <div class="post_body" id="pid{{ post.id }}">
- {% autoescape false %}
- {{ post.content|markup }}
- <!-- Signaure Begin -->
- {% if post.user.signature %}
- <hr>
- {{ post.user.signature|markup }}
- {% endif %}
- <!-- Signaure End -->
- {% endautoescape %}
- </div>
- </td>
- </tr>
- <tr>
- <td>
- <span class="pull-left">
- {% if current_user.is_authenticated %}
- <a href="{{ url_for('user.new_message') }}?to_user={{ post.user.username }}">PM</a>
- {% endif %}
- {% if post.user.website %}
- | <a href="{{post.user.website}}">Website</a>
- {% endif %}
- </span>
- <span class="pull-right">
- {% if current_user|edit_post(post.user_id, topic.forum) %}
- <a href="{{ url_for('forum.edit_post', post_id=post.id) }}">Edit</a> |
- {% endif %}
- {% if topic.first_post_id == post.id %}
- {% if current_user|delete_topic(topic.first_post.user_id, topic.forum) %}
- <a href="{{ url_for('forum.delete_topic', topic_id=topic.id) }}">Delete</a> |
- {% endif %}
- {% else %}
- {% if current_user|delete_post(post.user_id, topic.forum) %}
- <a href="{{ url_for('forum.delete_post', post_id=post.id) }}">Delete</a> |
- {% endif %}
- {% endif %}
- <a href="#">Quote</a>
- </span>
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% if form %}
- {% from "macros.html" import render_field %}
- <form class="form" action="#" method="post">
- {{ form.hidden_tag() }}
- {{ render_field(form.content, div_class="col-sm-12", rows=5) }}
- <button type="submit" class="btn btn-success">Reply!</button>
- </form>
- {% endif %}
- {% endblock %}
|