Files
qgreper/templates/forum.html
David Hoppenbrouwers c17a76d18f Paginate thread list
2022-10-09 16:09:21 +02:00

35 lines
1010 B
HTML

{% extends 'base.html' %}
{%- macro nav() -%}
<p style=text-align:center>
{%- if prev_page is not none %}<a href="./?p={{ prev_page }}">prev</a>{% endif -%}
{%- if prev_page is not none and next_page is not none %} | {% endif -%}
{%- if next_page is not none %}<a href="./?p={{ next_page }}">next</a>{% endif -%}
</p>
{%- endmacro -%}
{% block content -%}
<p>{{ description }}</p>
<p><a href="{{ url_for('new_thread', forum_id = forum_id) }}">Create thread</a></p>
{{- nav() -}}
<table>
<tr>
<th>Topic</th>
<th>Author</th>
<th>Created</th>
<th>Updated</th>
<th>Comments</th>
</tr>
{% for id, title, ctime, utime, author_id, author, comment_count in threads %}
<tr>
<th><a href="{{ url_for('thread', thread_id = id) }}">{{ title }}</a></th>
<td><a href="{{ url_for('user_info', user_id = author_id) }}">{{ author }}</a></td>
<td>{{ format_since(ctime) }}</td>
<td>{{ format_since(utime) }}</td>
<td>{{ comment_count }}</td>
</tr>
{%- endfor -%}
</table>
{{- nav() -}}
{% endblock %}