misuzu/templates/forum/topic.twig

50 lines
1.5 KiB
Twig
Raw Normal View History

2018-08-15 01:12:58 +00:00
{% extends 'forum/master.twig' %}
{% from 'macros.twig' import navigation, 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-15 23:00:17 +00:00
forum_posting_form,
forum_header
2018-05-23 01:41:57 +00:00
%}
2018-05-20 20:12:45 +00:00
{% set title = topic_info.topic_title %}
2018-07-07 20:11:16 +00:00
{% set canonical_url = '/forum/topic.php'|url_construct({
't': topic_info.topic_id,
'o': topic_offset,
}) %}
2018-05-21 23:05:25 +00:00
{% set can_reply = current_user is defined and topic_info.topic_locked is null and not topic_info.topic_archived %}
2018-05-23 01:41:57 +00:00
{% set ftbuttons = can_reply ? forum_topic_buttons(topic_info) : '' %}
2018-07-07 20:11:16 +00:00
{% set ftpagination = pagination(
topic_info.topic_post_count,
topic_range,
topic_offset,
'/forum/topic.php'|url_construct({'t': topic_info.topic_id}),
'forum__'
) %}
2018-05-20 20:12:45 +00:00
{% block content %}
2018-10-15 23:00:17 +00:00
{{ forum_header(topic_info.topic_title, topic_breadcrumbs) }}
2018-05-20 20:12:45 +00:00
2018-05-23 01:41:57 +00:00
{{ forum_topic_locked(topic_info.topic_locked, topic_info.topic_archived) }}
2018-05-21 23:05:25 +00:00
{{ ftbuttons }}
{{ ftpagination }}
2018-05-20 20:12:45 +00:00
{{ forum_post_listing(topic_posts, topic_info.topic_first_post_id) }}
2018-05-21 23:05:25 +00:00
{{ ftpagination }}
2018-05-23 01:41:57 +00:00
{% if can_reply %}
{{ forum_posting_form('Reply', topic_info.topic_id, true, 'reply', true) }}
<script>
window.addEventListener('load', () => {
closeContainer('reply');
document.getElementById('reply').children[0].addEventListener('mouseover', () => openContainer('reply'));
});
</script>
{% endif %}
2018-05-20 20:12:45 +00:00
{% endblock %}