misuzu/templates/forum/topic.twig

65 lines
2.3 KiB
Twig
Raw Normal View History

2022-09-13 13:14:49 +00:00
{% extends 'forum/master.twig' %}
{% from 'macros.twig' import pagination %}
{%
from 'forum/macros.twig'
import
forum_post_listing,
forum_topic_buttons,
forum_topic_locked,
forum_header,
forum_topic_tools,
forum_topic_redirect
2022-09-13 13:14:49 +00:00
%}
2023-08-28 01:17:34 +00:00
{% set title = topic_info.title %}
2022-09-13 13:14:49 +00:00
{% set canonical_url = url('forum-topic', {
2023-08-28 01:17:34 +00:00
'topic': topic_info.id,
2022-09-13 13:14:49 +00:00
'page': topic_pagination.page > 1 ? topic_pagination.page : 0,
}) %}
{% set forum_post_csrf = csrf_token() %}
{% set topic_tools = forum_topic_tools(topic_info, topic_pagination, can_reply) %}
{% set topic_notice = forum_topic_locked(topic_info.lockedTime, category_info.archived) ~ forum_topic_redirect(topic_redir_info|default(null)) %}
2022-09-13 13:14:49 +00:00
{% set topic_actions = [
{
'html': '<i class="far fa-trash-alt fa-fw"></i> Delete',
'url': url('forum-topic-delete', { topic: topic_info.id, csrf: csrf_token() }),
2022-09-13 13:14:49 +00:00
'display': topic_can_delete,
},
{
'html': '<i class="fas fa-magic fa-fw"></i> Restore',
'url': url('forum-topic-restore', { topic: topic_info.id, csrf: csrf_token() }),
2022-09-13 13:14:49 +00:00
'display': topic_can_nuke_or_restore,
},
{
'html': '<i class="fas fa-radiation-alt fa-fw"></i> Permanently Delete',
'url': url('forum-topic-nuke', { topic: topic_info.id, csrf: csrf_token() }),
2022-09-13 13:14:49 +00:00
'display': topic_can_nuke_or_restore,
},
{
'html': '<i class="fas fa-plus-circle fa-fw"></i> Bump',
'url': url('forum-topic-bump', { topic: topic_info.id, csrf: csrf_token() }),
2022-09-13 13:14:49 +00:00
'display': topic_can_bump,
},
{
'html': '<i class="fas fa-lock fa-fw"></i> Lock',
'url': url('forum-topic-lock', { topic: topic_info.id, csrf: csrf_token() }),
'display': topic_can_lock and not topic_info.locked,
2022-09-13 13:14:49 +00:00
},
{
'html': '<i class="fas fa-lock-open fa-fw"></i> Unlock',
'url': url('forum-topic-unlock', { topic: topic_info.id, csrf: csrf_token() }),
'display': topic_can_lock and topic_info.locked,
2022-09-13 13:14:49 +00:00
},
] %}
{% block content %}
2023-08-28 01:17:34 +00:00
{{ forum_header(topic_info.title, topic_breadcrumbs, false, canonical_url, topic_actions) }}
{{ topic_notice|raw }}
2022-09-13 13:14:49 +00:00
{{ topic_tools }}
{{ forum_post_listing(topic_posts, topic_user_id, topic_perms) }}
2022-09-13 13:14:49 +00:00
{{ topic_tools }}
{{ topic_notice|raw }}
2022-09-13 13:14:49 +00:00
{{ forum_header('', topic_breadcrumbs) }}
{% endblock %}