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/templates/yuuno/forum/elements/forumEntry.twig

36 lines
2.5 KiB
Twig
Raw Normal View History

2015-12-29 21:52:19 +00:00
{% if forum.permission(constant('Sakura\\Perms\\Forum::VIEW'), user.id) %}
<div class="forumForum">
<div class="forumIcon {% if forum.unread(user.id) %}unread {% endif %}fa fa-3x {% if forum.icon %}{{ forum.icon }}{% else %}{% if forum.type == 2 %}fa-chevron-circle-right{% elseif forum.type == 1 %}fa-folder{% else %}fa-comments{% endif %}{% endif %}"></div>
<div class="forumTitle">
2016-02-27 16:46:16 +00:00
<div class="name"><a href="{% if forum.type == 2 %}{{ forum.link }}{% else %}{{ route('forums.forum', forum.id) }}{% endif %}" class="default">{{ forum.name }}</a></div>
2015-12-29 21:52:19 +00:00
<div class="desc">
{{ forum.description }}
{% if forum.forums|length %}
<div class="subforums">
Subforums:
{% for forum in forum.forums %}
2016-03-19 15:29:47 +00:00
{% if forum.unread(user.id) %}<span style="font-variant: small-caps; color: #6C5D7B; text-shadow: 0px 0px 5px #9475B2;">[!]</span>{% endif %} <a href="{% if forum.type == 2 %}{{ forum.link }}{% else %}{{ route('forums.forum', forum.id) }}{% endif %}" class="default">{{ forum.name }}</a>
2015-12-29 21:52:19 +00:00
{% endfor %}
</div>
{% endif %}
</div>
</div>
2015-12-29 21:52:19 +00:00
{% if forum.type != 2 %}
<div class="forumCount">
<div class="topics" title="Amount of threads in this forum.">{{ forum.threadCount }}</div>
<div class="posts" title="Amount of posts in this forum.">{{ forum.postCount }}</div>
</div>
<div class="forumLastPost">
<div>
{% if forum.lastPost.id %}
2016-03-19 15:29:47 +00:00
<a href="{{ route('forums.thread', forum.lastPost.thread) }}" class="default">{{ forum.lastPost.subject|slice(0, 30) }}{% if forum.lastPost.subject|length > 30 %}...{% endif %}</a><br />
2016-03-20 16:37:59 +00:00
<time>{{ forum.lastPost.time|date(sakura.dateFormat) }}</time> by {% if forum.lastPost.poster.id %}<a href="{{ route('user.profile', forum.lastPost.poster.id) }}" class="default" style="color: {{ forum.lastPost.poster.colour }}; text-shadow: 0 0 5px {% if forumlastPost.poster.colour != 'inherit' %}{{ forum.lastPost.poster.colour }}{% else %}#222{% endif %};">{{ forum.lastPost.poster.username }}</a>{% else %}[deleted user]{% endif %} <a href="{{ route('forums.post', forum.lastPost.id) }}" class="default fa fa-tag"></a>
2015-12-29 21:52:19 +00:00
{% else %}
There are no posts in this forum.<br />&nbsp;
{% endif %}
</div>
</div>
2015-12-29 21:52:19 +00:00
{% endif %}
</div>
2015-12-29 21:52:19 +00:00
{% endif %}