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 '@yuuno/forum/elements/forumEntry.twig' %}
{% endfor %}
{% endif %}
{% else %}
{% include '@yuuno/forum/elements/forumEntry.twig' %}
{% endif %}
{% endfor %}
</div>
{% if not forum.type and forum.id > 0 %}
{% set topics = forum.topics|batch(25) %}
{% set pagination_pages = topics %}
{% set pagination_url %}{{ route('forums.forum', forum.id) }}{% endset %}
{% include '@yuuno/forum/elements/forumBtns.twig' %}
{% if forum.topics %}
{% for topic in topics[get.page|default(1) - 1] %}
{% include '@yuuno/forum/elements/topicEntry.twig' %}
{% endfor %}
{% else %}
<h1 class="forum-list__empty">There are no posts in this forum!</h1>
{% endif %}
{% include '@yuuno/forum/elements/forumBtns.twig' %}
{% endif %}