This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/resources/views/yuuno/forum/elements/forumBase.twig

41 lines
1.5 KiB
Twig

<div class="content__header">{{ title }}</div>
<div class="forum-list">
{% for forum in forum.forums %}
{% if forum.type == 1 %}
{% if forum.forums|length and forum.perms.view %}
<div class="forum-list__category">
{% if forum.type != 1 %}
Subforums
{% else %}
<a class="forum-list__category-link" href="{{ route('forums.forum', forum.id) }}">
{{ forum.name }}
</a>
{% endif %}
</div>
{% for forum in forum.forums %}
{% include 'forum/elements/forumEntry.twig' %}
{% endfor %}
{% endif %}
{% else %}
{% include 'forum/elements/forumEntry.twig' %}
{% endif %}
{% endfor %}
</div>
{% if not forum.type and forum.id > 0 %}
{% set topics = forum.topics|batch(25) %}
{% set paginationPages = topics %}
{% set paginationUrl %}{{ route('forums.forum', forum.id) }}{% endset %}
{% include 'forum/elements/forumBtns.twig' %}
{% if forum.topics %}
{% for topic in topics[get.page|default(1) - 1] %}
{% include 'forum/elements/topicEntry.twig' %}
{% endfor %}
{% else %}
<h1 style="margin: 2em auto; text-align: center;">There are no posts in this forum!</h1>
{% endif %}
{% include 'forum/elements/forumBtns.twig' %}
{% endif %}