53 lines
2.1 KiB
Twig
53 lines
2.1 KiB
Twig
{% extends 'forum/master.twig' %}
|
|
{% from 'macros.twig' import pagination %}
|
|
{% from 'forum/macros.twig' import forum_category_listing, forum_topic_listing, forum_category_buttons, forum_header, forum_category_tools %}
|
|
|
|
{% set title = forum_info.name %}
|
|
{% set canonical_url = url('forum-category', {
|
|
'forum': forum_info.id,
|
|
'page': forum_pagination.page|default(0) > 1 ? forum_pagination.page : 0,
|
|
}) %}
|
|
|
|
{% block content %}
|
|
<div class="forum-float forum-float-top">
|
|
{{ forum_header(forum_info.name, forum_breadcrumbs, true, canonical_url, [
|
|
{
|
|
html: '<i class="far fa-check-circle"></i> <span class="js-action-text">Mark as Read</span>',
|
|
display: forum_show_mark_as_read,
|
|
method: 'POST',
|
|
url: url('forum-mark-as-read', { category: forum_info.id }),
|
|
disableWith: 'Marking as read...',
|
|
disableWithTarget: '.js-action-text',
|
|
withCsrf: true,
|
|
refreshOnSuccess: true,
|
|
}
|
|
]) }}
|
|
</div>
|
|
|
|
{% if forum_children|length > 0 %}
|
|
{{ forum_category_listing(forum_children, 'Forums') }}
|
|
{% endif %}
|
|
|
|
{% if forum_info.mayHaveTopics %}
|
|
{% set can_topic = not forum_info.archived and forum_perms.can_create_topic %}
|
|
{% set topics_pagination = pagination(forum_pagination, 'forum-category', {'forum': forum_info.id}) %}
|
|
|
|
{{ forum_topic_listing(forum_topics) }}
|
|
|
|
{% if can_topic or topics_pagination|trim|length > 0 %}
|
|
<div class="forum-float forum-float-bottom">
|
|
<div class="container forum__actions">
|
|
<div class="forum__actions__buttons">
|
|
{% if can_topic %}
|
|
<a href="{{ url('forum-topic-new', {'forum': forum_info.id}) }}" class="input__button forum__actions__button">New Topic</a>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="forum__actions__pagination">
|
|
{{ topics_pagination }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endblock %}
|