misuzu/templates/forum/topic.twig

65 lines
2.3 KiB
Twig
Raw Normal View History

2018-08-15 01:12:58 +00:00
{% extends 'forum/master.twig' %}
2018-10-21 21:53:32 +00:00
{% from 'macros.twig' import pagination %}
2018-05-23 01:41:57 +00:00
{%
2018-08-15 01:12:58 +00:00
from 'forum/macros.twig'
2018-05-23 01:41:57 +00:00
import
forum_post_listing,
forum_topic_buttons,
forum_topic_locked,
2018-10-25 00:15:23 +00:00
forum_header,
forum_topic_tools,
forum_topic_redirect
2018-05-23 01:41:57 +00:00
%}
2018-05-20 20:12:45 +00:00
2023-08-28 01:17:34 +00:00
{% set title = topic_info.title %}
{% set canonical_url = url('forum-topic', {
2023-08-28 01:17:34 +00:00
'topic': topic_info.id,
2019-01-04 00:11:31 +00:00
'page': topic_pagination.page > 1 ? topic_pagination.page : 0,
2018-07-07 20:11:16 +00:00
}) %}
2018-05-21 23:05:25 +00:00
2019-06-10 15:21:53 +00:00
{% set forum_post_csrf = csrf_token() %}
2019-01-03 00:33:02 +00:00
{% set topic_tools = forum_topic_tools(topic_info, topic_pagination, can_reply) %}
2023-08-28 01:17:34 +00:00
{% set topic_notice = forum_topic_locked(topic_info.lockedTime, category_info.isArchived) ~ forum_topic_redirect(topic_redir_info|default(null)) %}
2019-01-11 23:00:53 +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() }),
2019-01-11 23:00:53 +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() }),
2019-01-11 23:00:53 +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() }),
2019-01-11 23:00:53 +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() }),
2019-01-11 23:00:53 +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() }),
2023-08-28 01:17:34 +00:00
'display': topic_can_lock and not topic_info.isLocked,
2019-01-11 23:00:53 +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() }),
2023-08-28 01:17:34 +00:00
'display': topic_can_lock and topic_info.isLocked,
2019-01-11 23:00:53 +00:00
},
] %}
2018-05-20 20:12:45 +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 }}
2018-10-25 00:15:23 +00:00
{{ topic_tools }}
{{ forum_post_listing(topic_posts, topic_user_id, topic_perms) }}
2018-10-25 00:15:23 +00:00
{{ topic_tools }}
{{ topic_notice|raw }}
{{ forum_header('', topic_breadcrumbs) }}
2018-05-20 20:12:45 +00:00
{% endblock %}