2016-07-31 19:36:13 +00:00
{% extends 'master.twig' %}
2016-12-12 22:22:09 +00:00
{% from 'macros.twig' import news_post %}
2016-07-29 19:31:36 +00:00
{% block content %}
2016-12-21 19:55:17 +00:00
<div class="content">
2016-12-11 01:36:17 +00:00
<div class="content--right" id="indexPanel">
{% if user .isActive %}
<div class="user" style="background-image: url( {{ route ( 'user.header' , user .id ) }} );">
<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>
<div class="user__info">
<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 %}
<a href=" {{ route ( 'settings.friends.requests' ) }} " title="Pending friend requests"> {{ friendRequests }} new friend requests</a>
{% endif %}
</div>
</div>
{% endif %}
<div class="content__header content__header--alt">Stats</div>
2016-12-21 16:46:12 +00:00
We have <b> {{ userCount }} user {% if userCount != 1 %} s {% endif %} </b>,
<b><a href=" {{ route ( 'user.profile' , newestUser .id ) }} " style="color: {{ newestUser .colour }} ;"> {{ newestUser .username }} </a></b> is the newest user,
it has been <b> {{ lastRegDate }} day {{ lastRegDate == 1 ? '' : 's' }} </b> since the last user registered and the forum has <b> {{ topicCount }} topic {% if topicCount != 1 %} s {% endif %} </b> and <b> {{ postCount }} post {% if postCount != 1 %} s {% endif %} </b>.
2016-12-11 01:36:17 +00:00
<div class="content__header content__header--alt">Online Users</div>
2016-12-21 16:46:12 +00:00
{% if onlineUsers %}
2016-12-11 01:36:17 +00:00
All active users in the past 2 minutes
<table class="sidepanel-table">
2016-12-21 16:46:12 +00:00
{% for amount , onlineUser in onlineUsers %}
2016-12-11 01:36:17 +00:00
<tr>
<td class="sidepanel-table__column sidepanel-table__column--align-left">
<a href=" {{ route ( 'user.profile' , onlineUser .id ) }} " style="font-weight: bold; color: {{ onlineUser .colour }} ;">
{{ onlineUser .username }}
</a>
</td>
<td class="sidepanel-table__column sidepanel-table__column--align-right">
<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 %}
2016-07-29 19:31:36 +00:00
</div>
2016-11-09 18:32:23 +00:00
<div class="content--left">
<div class="content__header">News</div>
2016-07-29 19:31:36 +00:00
{% for post in news %}
2016-12-21 19:55:17 +00:00
{{ news_post ( post , true , true , true ) }}
2016-07-29 19:31:36 +00:00
{% endfor %}
</div>
<div class="clear"></div>
</div>
{% endblock %}