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/topicEntry.twig
2016-12-22 19:10:09 +01:00

50 lines
2.3 KiB
Twig

<div class="topic{% if topic.type == 2 %} topic--highlight{% endif %}">
<div class="
topic__icon
fa fa-2x
{% if topic.unread(user.id) %}topic__icon--unread{% endif %}
fa-{% if topic.type == 1 %}thumb-tack{% elseif topic.type == 2 %}bullhorn{% elseif topic.status == 1 %}lock{% else %}navicon{% endif %}
"></div>
<div class="topic__info">
<a class="topic__title" href="{{ route('forums.topic', topic.id) }}">
{{ topic.title }}
</a>
{% if topic.user %}
<div class="topic__author">
by
<a class="topic__author-link" href="{{ route('user.profile', topic.user) }}" style="color: {{ topic.firstPostUserColour }}; text-shadow: 0 0 5px {% if topic.firstPostUserColour != 'inherit' %}{{ topic.firstPostUserColour }}{% else %}#222{% endif %}">
{{ topic.firstPostUsername }}
</a>
</div>
{% endif %}
</div>
<div class="topic__stats">
<div class="topic__stat--big" title="Replies">
{{ topic.replies }}
</div>
<div class="topic__stat" title="Views">
{{ topic.views }}
</div>
</div>
<div class="topic__recent">
<div class="topic__recent-avatar avatar avatar--border" style="background-image: url('{{ route('user.avatar', topic.lastPostUserId) }}')"></div>
<div class="topic__recent-info">
<div class="topic__recent-info-row">
<a href="{{ route('forums.post', topic.lastPostId) }}">Last reply</a>
by
{% if topic.lastPostUserId %}
<a href="{{ route('user.profile', topic.lastPostUserId) }}" style="color: {{ topic.lastPostUserColour }}; text-shadow: 0 0 5px {% if topic.lastPostUserColour != 'inherit' %}{{ topic.lastPostUserColour }}{% else %}#222{% endif %};">
{{ topic.lastPostUsername }}
</a>
{% else %}
[deleted user]
{% endif %}
</div>
<div class="topic__recent-info-row">
<time class="time-ago" datetime="{{ topic.lastReply|date('r') }}">
{{ topic.lastReply|date(config('general.date_format')) }}
</time>
</div>
</div>
</div>
</div>