58 lines
3.3 KiB
Twig
58 lines
3.3 KiB
Twig
{% if forum.perms.view %}
|
|
<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 %}
|
|
<div class="forum__subforums">
|
|
Subforums:
|
|
{% for forum in forum.forums %}
|
|
<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 %}
|
|
<div class="forum__stats">
|
|
<div class="forum__stat--big" title="Topics">
|
|
{{ forum.countTopics }}
|
|
</div>
|
|
<div class="forum__stat" title="Posts">
|
|
{{ forum.countPosts }}
|
|
</div>
|
|
</div>
|
|
<div class="forum__recent">
|
|
{% if forum.lastPostUserId %}
|
|
<div class="forum__preview">
|
|
<div class="forum__preview-avatar avatar avatar--border" style="background-image: url('{{ route('user.avatar', forum.lastPostUserId) }}')"></div>
|
|
<div class="forum__preview-info">
|
|
<div class="forum__preview-info-row">
|
|
<a class="forum__post-link" href="{{ route('forums.post', forum.lastPostUserId) }}">
|
|
{{ forum.lastPostTitle|slice(0, 30)|trim }}{% if forum.lastPostTitle|length > 30 %}...{% endif %}
|
|
</a>
|
|
</div>
|
|
<div class="forum__preview-info-row">
|
|
<time class="time-ago" datetime="{{ forum.lastPostTime|date('r') }}">
|
|
{{ forum.lastPostTime|date(config('general.date_format')) }}
|
|
</time>
|
|
by
|
|
<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 }}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<i>There are no posts in this forum.</i>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|