Implement thread hiding

This commit is contained in:
David Hoppenbrouwers
2022-10-11 21:05:45 +02:00
parent 61ad1e2716
commit 77e9051334
7 changed files with 181 additions and 15 deletions

View File

@@ -1,4 +1,5 @@
{% extends 'base.html' %}
{%- from 'moderator.html' import moderate_thread with context %}
{%- macro nav() -%}
<p style=text-align:center>
@@ -19,14 +20,22 @@
<th>Created</th>
<th>Updated</th>
<th>Comments</th>
{%- if user is not none and user.is_moderator() -%}
<th>Action</th>
{%- endif -%}
</tr>
{% for id, title, ctime, utime, author_id, author, comment_count in threads %}
{% for id, title, ctime, utime, author_id, author, comment_count, hidden in threads %}
<tr>
<th><a href="{{ url_for('thread', thread_id = id) }}">{{ title }}</a></th>
<th>{{ '[hidden] ' if hidden else '' }}<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>
<td>
{%- if user is not none and user.is_moderator() %}
{{- moderate_thread(id, hidden) }}
{%- endif -%}
</td>
</tr>
{%- endfor -%}
</table>