{% 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 %} {% set title = topic_info.title %} {% set canonical_url = url('forum-topic', { 'topic': topic_info.id, 'page': topic_pagination.page > 1 ? topic_pagination.page : 0, }) %} {% 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)) %} {% set topic_actions = [ { html: ' Delete', display: topic_can_delete, method: 'DELETE', url: url('forum-topic-delete', { topic: topic_info.id }), confirm: 'Are you sure you want to delete this topic?', disableWith: 'Deleting...', disableWithTarget: '.js-action-text', withCsrf: true, refreshOnSuccess: topic_can_delete_any, redirectOnSuccess: (topic_can_delete_any ? false : url('forum-category', { forum: category_info.id })), }, { html: ' Restore', display: topic_can_nuke_or_restore, method: 'POST', url: url('forum-topic-restore', { topic: topic_info.id }), confirm: 'Are you sure you want to restore this topic?', disableWith: 'Restoring...', disableWithTarget: '.js-action-text', withCsrf: true, refreshOnSuccess: true, }, { html: ' Permanently Delete', display: topic_can_nuke_or_restore, method: 'POST', url: url('forum-topic-nuke', { topic: topic_info.id }), confirm: 'Are you sure you want to PERMANENTLY DELETE this topic?', disableWith: 'Nuking...', disableWithTarget: '.js-action-text', withCsrf: true, redirectOnSuccess: url('forum-category', { forum: category_info.id }), }, { html: ' Bump', display: topic_can_bump, method: 'POST', url: url('forum-topic-bump', { topic: topic_info.id }), disableWith: 'Bumping...', disableWithTarget: '.js-action-text', withCsrf: true, }, { html: ' Lock', display: topic_can_lock and not topic_info.locked, method: 'POST', url: url('forum-topic-lock', { topic: topic_info.id }), disableWith: 'Locking...', disableWithTarget: '.js-action-text', withCsrf: true, refreshOnSuccess: true, }, { html: ' Unlock', display: topic_can_lock and topic_info.locked, method: 'POST', url: url('forum-topic-unlock', { topic: topic_info.id }), disableWith: 'Unlocking...', disableWithTarget: '.js-action-text', withCsrf: true, refreshOnSuccess: true, }, ] %} {% block content %} {{ forum_header(topic_info.title, topic_breadcrumbs, false, canonical_url, topic_actions) }} {{ topic_notice|raw }} {{ topic_tools }} {{ forum_post_listing(topic_posts, topic_user_id, topic_perms) }} {{ topic_tools }} {{ topic_notice|raw }} {{ forum_header('', topic_breadcrumbs) }} {% endblock %}