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

45 lines
3.5 KiB
Twig
Raw Normal View History

2015-10-14 14:14:30 +00:00
<div id="indexPanel">
{% if session.checkLogin %}
2016-03-24 18:28:32 +00:00
<div class="user-container" style="background-image: url({{ route('user.header', user.id) }});">
<div class="default-avatar-setting user-container-avatar" style="background-image: url({{ route('file.avatar', user.id) }}); box-shadow: 0 0 5px {{ user.colour }};"><a href="{{ urls.format('SETTING_MODE', ['friends', 'requests']) }}" class="clean" style="display: block; height: 100%; width: 100%;"></a></div>
<div class="user-container-info">
<a href="{{ route('user.profile', user.id) }}" class="clean"><h1 style="color: {{ user.colour }}; text-shadow: 0 0 7px {% if user.colour != 'inherit' %}{{ user.colour }}{% else %}#222{% endif %}; padding: 0 0 2px;">{{ user.username }}</h1></a>
{% set friendRequests = user.friends(-1, true)|length %}
{% if friendRequests %}
<a class="default" href="{{ urls.format('SETTING_MODE', ['friends', 'requests']) }}" title="Pending friend requests">{{ friendRequests }} new friend requests</a>
{% endif %}
</div>
</div>
2015-05-06 13:42:02 +00:00
{% else %}
2015-10-14 14:14:30 +00:00
{% if sakura.lockAuth %}
<div class="head">Whoops!</div>
You caught the site at the wrong moment! Right now registration <i>and</i> logging in is disabled for unspecified reasons. Sorry for the inconvenience but please try again later!
<div class="indexSidePanelLinks">
<a class="fa fa-lock" href="#" title="Authentication is locked"></a>
</div>
{% else %}
<div class="head">Welcome!</div>
Welcome to Flashii! This is a site for a bunch of friends to hang out, nothing special. Anyone is pretty much welcome to register so why not have a go?
<div class="indexSidePanelLinks">
2016-03-19 15:29:47 +00:00
<a class="fa fa-magic" href="{{ route('auth.register') }}" title="Register" id="indexSidePanelRegister"></a>
2016-02-27 16:46:16 +00:00
<a class="fa fa-sign-in" href="{{ route('auth.login') }}" title="Login" id="indexSidePanelLogin"></a>
2015-10-14 14:14:30 +00:00
</div>
{% endif %}
2015-05-06 13:42:02 +00:00
{% endif %}
2015-10-14 14:14:30 +00:00
<div class="head">Stats</div>
We have <b>{{ stats.userCount }} user{% if stats.userCount != 1 %}s{% endif %}</b>,
2016-02-27 16:46:16 +00:00
<b><a href="{{ route('user.profile', stats.newestUser.id) }}" style="color: {{ stats.newestUser.colour }};" class="default">{{ stats.newestUser.username }}</a></b> is the newest user,
2016-01-30 13:25:18 +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 }} thread{% if stats.topicCount != 1 %}s{% endif %}</b> and <b>{{ stats.postCount }} post{% if stats.postCount != 1 %}s{% endif %}</b>.
2015-10-14 14:14:30 +00:00
<div class="head">Online Users</div>
{% if stats.onlineUsers %}
2016-01-17 01:58:31 +00:00
All active users in the past {{ sakura.onlineTimeout / 60 }} minute{% if sakura.onlineTimeout != 60 %}s{% endif %}
<table class="panelTable">
{% for amount,onlineUser in stats.onlineUsers %}
2016-02-27 16:46:16 +00:00
<tr><td style="text-align: left;"><a href="{{ route('user.profile', onlineUser.id) }}" style="font-weight: bold; color: {{ onlineUser.colour }};" class="default">{{ onlineUser.username }}</a></td><td style="text-align: right;"><time>{{ onlineUser.lastOnline|date(sakura.dateFormat) }}</time></td></tr>
2016-01-17 01:58:31 +00:00
{% endfor %}
</table>
2015-10-14 14:14:30 +00:00
{% else %}
There were no online users in the past {{ sakura.onlineTimeout / 60 }} minute{% if sakura.onlineTimeout != 60 %}s{% endif %}.
2015-10-14 14:14:30 +00:00
{% endif %}
</div>