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/elements/indexPanel.twig

45 lines
2.7 KiB
Twig
Raw Normal View History

<div id="indexPanel">
{% if user.isActive %}
2016-11-09 18:32:23 +00:00
<div class="user" style="background-image: url({{ route('user.header', user.id) }});">
2016-12-04 14:55:53 +00:00
<div class="avatar avatar--border user__avatar" style="background-image: url({{ route('user.avatar', user.id) }}); box-shadow: 0 0 5px {{ user.colour }};">
<a href="{{ route('user.profile', user.id) }}" class="user__avatar-link"></a>
</div>
2016-11-09 18:32:23 +00:00
<div class="user__info">
2016-12-04 14:55:53 +00:00
<a href="{{ route('user.profile', user.id) }}" class="link link--clean user__link">
<h1 style="color: {{ user.colour }}; text-shadow: 0 0 7px {% if user.colour != 'inherit' %}{{ user.colour }}{% else %}#222{% endif %};">{{ user.username }}</h1>
</a>
{% set friendRequests = user.friends(-1, true)|length %}
{% if friendRequests %}
2016-11-09 18:32:23 +00:00
<a href="{{ route('settings.friends.requests') }}" title="Pending friend requests">{{ friendRequests }} new friend requests</a>
{% endif %}
</div>
</div>
{% endif %}
2016-11-09 18:32:23 +00:00
<div class="content__header content__header--alt">Stats</div>
We have <b>{{ stats.userCount }} user{% if stats.userCount != 1 %}s{% endif %}</b>,
2016-11-09 18:32:23 +00:00
<b><a href="{{ route('user.profile', stats.newestUser.id) }}" style="color: {{ stats.newestUser.colour }};">{{ stats.newestUser.username }}</a></b> is the newest user,
2016-07-30 13:48:09 +00:00
it has been <b>{{ stats.lastRegDate }} day{{ stats.lastRegDate == 1 ? '' : 's' }}</b> since the last user registered and the forum has <b>{{ stats.topicCount }} topic{% if stats.topicCount != 1 %}s{% endif %}</b> and <b>{{ stats.postCount }} post{% if stats.postCount != 1 %}s{% endif %}</b>.
2016-11-09 18:32:23 +00:00
<div class="content__header content__header--alt">Online Users</div>
{% if stats.onlineUsers %}
All active users in the past 2 minutes
2016-11-10 22:32:45 +00:00
<table class="sidepanel-table">
{% for amount,onlineUser in stats.onlineUsers %}
2016-11-10 22:32:45 +00:00
<tr>
2016-12-04 14:55:53 +00:00
<td class="sidepanel-table__column sidepanel-table__column--align-left">
2016-11-10 22:32:45 +00:00
<a href="{{ route('user.profile', onlineUser.id) }}" style="font-weight: bold; color: {{ onlineUser.colour }};">
{{ onlineUser.username }}
</a>
</td>
2016-12-04 14:55:53 +00:00
<td class="sidepanel-table__column sidepanel-table__column--align-right">
2016-11-10 22:32:45 +00:00
<time class="time-ago" datetime="{{ onlineUser.lastOnline|date('r') }}">
{{ onlineUser.lastOnline|date(config('general.date_format')) }}
</time>
</td>
</tr>
{% endfor %}
</table>
{% else %}
There were no online users in the past 2 minutes.
{% endif %}
</div>