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/forumEntry.twig

59 lines
3.3 KiB
Twig
Raw Normal View History

2016-11-02 18:58:51 +00:00
{% if forum.perms.view %}
2016-11-12 01:52:51 +00:00
<div class="forum">
<div class="forum__icon {% if forum.unread(user.id) %}forum__icon--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="forum__info">
<a class="forum__name" href="{% if forum.type == 2 %}{{ forum.link }}{% else %}{{ route('forums.forum', forum.id) }}{% endif %}">
{{ forum.name }}
</a>
<div class="forum__description">
{{ forum.description }}
{% if forum.forums|length %}
2016-11-12 01:52:51 +00:00
<div class="forum__subforums">
Subforums:
{% for forum in forum.forums %}
2016-11-12 01:52:51 +00:00
<a class="forum__subforum{% if forum.unread(user.id) %} forum__subforum--unread{% endif %}" href="{% if forum.type == 2 %}{{ forum.link }}{% else %}{{ route('forums.forum', forum.id) }}{% endif %}">
{{ forum.name }}
</a>
{% endfor %}
</div>
{% endif %}
</div>
</div>
{% if forum.type != 2 %}
2016-11-12 01:52:51 +00:00
<div class="forum__stats">
<div class="forum__stat--big" title="Topics">
2016-12-22 18:10:09 +00:00
{{ forum.countTopics }}
2016-11-12 01:52:51 +00:00
</div>
<div class="forum__stat" title="Posts">
2016-12-22 18:10:09 +00:00
{{ forum.countPosts }}
2016-11-12 01:52:51 +00:00
</div>
</div>
<div class="forum__recent">
2016-12-22 18:10:09 +00:00
{% if forum.lastPostUserId %}
2016-11-12 01:52:51 +00:00
<div class="forum__preview">
2016-12-22 18:10:09 +00:00
<div class="forum__preview-avatar avatar avatar--border" style="background-image: url('{{ route('user.avatar', forum.lastPostUserId) }}')"></div>
2016-11-12 01:52:51 +00:00
<div class="forum__preview-info">
<div class="forum__preview-info-row">
2016-12-22 18:10:09 +00:00
<a class="forum__post-link" href="{{ route('forums.post', forum.lastPostUserId) }}">
{{ forum.lastPostTitle|slice(0, 30)|trim }}{% if forum.lastPostTitle|length > 30 %}...{% endif %}
2016-11-12 01:52:51 +00:00
</a>
</div>
<div class="forum__preview-info-row">
2016-12-22 18:10:09 +00:00
<time class="time-ago" datetime="{{ forum.lastPostTime|date('r') }}">
{{ forum.lastPostTime|date(config('general.date_format')) }}
2016-11-12 01:52:51 +00:00
</time>
by
2016-12-22 18:10:09 +00:00
<a href="{{ route('user.profile', forum.lastPostUserId) }}" style="color: {{ forum.lastPostUserColour }}; text-shadow: 0 0 5px {% if forum.lastPostUserColour != 'inherit' %}{{ forum.lastPostUserColour }}{% else %}#222{% endif %}">
{{ forum.lastPostUsername }}
2016-11-12 01:52:51 +00:00
</a>
</div>
</div>
</div>
{% else %}
2016-11-12 01:52:51 +00:00
<i>There are no posts in this forum.</i>
{% endif %}
</div>
{% endif %}
</div>
{% endif %}