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

56 lines
2 KiB
Twig
Raw Normal View History

<div class="head">{{ title }}</div>
<div class="forumList">
{% for forum in forum.forums %}
{% if forum.type == 1 %}
{% if forum.forums|length and forum.permission(constant('Sakura\\Perms\\Forum::VIEW'), user.id) %}
<div class="forumCategory">
{% if forum.type != 1 %}Subforums{% else %}<a href="{{ route('forums.forum', forum.id) }}" class="clean">{{ 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 %}
2016-07-30 13:48:09 +00:00
{% set topics = forum.topics|batch(25) %}
2016-07-30 13:48:09 +00:00
{% set paginationPages = topics %}
{% set paginationUrl %}{{ route('forums.forum', forum.id) }}{% endset %}
{% include 'forum/elements/forumBtns.twig' %}
2016-07-30 13:48:09 +00:00
{% if forum.topics %}
<table class="topicList">
<thead>
<tr>
<th></th>
<th>Topic</th>
<th>Author</th>
<th></th>
<th>Last post</th>
</tr>
</thead>
<tfoot>
<tr>
<th></th>
<th>Topic</th>
<th>Author</th>
<th></th>
<th>Last post</th>
</tr>
</tfoot>
<tbody>
2016-07-30 13:48:09 +00:00
{% for topic in topics[get.page|default(1) - 1] %}
{% include 'forum/elements/topicEntry.twig' %}
{% endfor %}
</tbody>
</table>
{% else %}
<h1 class="stylised" style="margin: 2em auto; text-align: center;">There are no posts in this forum!</h1>
{% endif %}
{% include 'forum/elements/forumBtns.twig' %}
{% endif %}