misuzu/templates/home/landing.twig

156 lines
7.1 KiB
Twig
Raw Normal View History

2018-08-15 01:12:58 +00:00
{% extends 'home/master.twig' %}
2018-10-22 19:53:21 +00:00
{% from 'macros.twig' import container_title %}
2018-08-15 01:12:58 +00:00
{% from 'news/macros.twig' import news_preview %}
{% from 'changelog/macros.twig' import changelog_listing %}
{% set canonical_url = '/' %}
{% block content %}
2019-03-02 21:25:35 +00:00
<div class="landing">
<div class="landing__sidebar">
<div class="container landing__container">
{{ container_title('<i class="fas fa-chart-bar fa-fw"></i> Statistics') }}
2018-12-31 01:37:47 +00:00
2019-03-02 21:25:35 +00:00
<div class="landing__statistics">
2018-12-31 01:37:47 +00:00
2019-03-02 21:25:35 +00:00
<div class="landing__statistic">
<div class="landing__statistic__name">
2018-12-31 01:37:47 +00:00
<i class="fas fa-users fa-fw"></i> Users
</div>
2019-03-02 21:25:35 +00:00
<div class="landing__statistic__value">
{{ statistics.count_users_all|number_format }}
2018-12-31 01:37:47 +00:00
</div>
</div>
2019-03-02 21:25:35 +00:00
<div class="landing__statistic">
<div class="landing__statistic__name">
2018-12-31 01:37:47 +00:00
<i class="fas fa-comment-dots fa-fw"></i> Comments
</div>
2019-03-02 21:25:35 +00:00
<div class="landing__statistic__value">
{{ statistics.count_comments|number_format }}
2018-12-31 01:37:47 +00:00
</div>
</div>
2019-03-02 21:25:35 +00:00
<div class="landing__statistic">
<div class="landing__statistic__name">
2018-12-31 01:37:47 +00:00
<i class="fas fa-user-check fa-fw"></i> Online
</div>
2019-03-02 21:25:35 +00:00
<div class="landing__statistic__value">
{{ statistics.count_users_online|number_format }}
2018-12-31 01:37:47 +00:00
</div>
</div>
2019-03-02 21:25:35 +00:00
<div class="landing__statistic">
<div class="landing__statistic__name">
2018-12-31 01:37:47 +00:00
<i class="fas fa-user-clock fa-fw"></i> Active (24 hr)
</div>
2019-03-02 21:25:35 +00:00
<div class="landing__statistic__value">
{{ statistics.count_users_active|number_format }}
2018-12-31 01:37:47 +00:00
</div>
</div>
2019-03-02 21:25:35 +00:00
<div class="landing__statistic">
<div class="landing__statistic__name">
2018-12-31 01:37:47 +00:00
<i class="fas fa-list fa-fw"></i> Topics
</div>
2019-03-02 21:25:35 +00:00
<div class="landing__statistic__value">
{{ statistics.count_forum_topics|number_format }}
2018-12-31 01:37:47 +00:00
</div>
</div>
2019-03-02 21:25:35 +00:00
<div class="landing__statistic">
<div class="landing__statistic__name">
2018-12-31 01:37:47 +00:00
<i class="fas fa-comments fa-fw"></i> Posts
</div>
2019-03-02 21:25:35 +00:00
<div class="landing__statistic__value">
{{ statistics.count_forum_posts|number_format }}
2018-12-31 01:37:47 +00:00
</div>
</div>
</div>
</div>
2018-12-15 23:58:58 +00:00
{% if online_users|length > 0 %}
2019-03-02 21:25:35 +00:00
<div class="container landing__container">
2018-12-31 01:37:47 +00:00
{{ container_title('<i class="fas fa-users fa-fw"></i> Online Users') }}
2018-11-17 22:44:58 +00:00
2019-03-02 21:25:35 +00:00
<div class="landing__online">
{% for user in online_users %}
2019-03-02 21:25:35 +00:00
<a href="{{ url('user-profile', {'user': user.user_id}) }}" class="avatar landing__online__user" style="{{ user.user_colour|html_colour }};--avatar-url: url('{{ url('user-avatar', {'user': user.user_id}) }}');" title="{{ user.username }}">
2018-11-17 22:44:58 +00:00
{{ user.username }}
</a>
{% endfor %}
2018-11-17 22:44:58 +00:00
</div>
</div>
2018-11-17 22:44:58 +00:00
{% endif %}
2019-01-18 14:22:53 +00:00
{% if birthdays|length > 0 %}
2019-03-02 21:25:35 +00:00
<div class="container landing__container">
2019-01-18 14:11:15 +00:00
{{ container_title('<i class="fas fa-birthday-cake fa-fw"></i> Happy Birthday!') }}
{% for birthday in birthdays %}
2019-03-02 21:25:35 +00:00
<a class="landing__latest" style="{# birthday.user_colour|html_colour #}" href="{{ url('user-profile', {'user': birthday.user_id}) }}">
<div class="avatar landing__latest__avatar" style="--avatar-url: url('{{ url('user-avatar', {'user': birthday.user_id}) }}')"></div>
<div class="landing__latest__content">
<div class="landing__latest__username">
2019-01-18 14:11:15 +00:00
{{ birthday.username }}
</div>
{% if birthday.user_age is not null %}
2019-03-02 21:25:35 +00:00
<div class="landing__latest__joined">
2019-01-18 14:11:15 +00:00
Turned {{ birthday.user_age }} today!
</div>
{% endif %}
</div>
</a>
{% endfor %}
</div>
{% elseif latest_user.user_id|default(0) > 0 %}
2019-03-02 21:25:35 +00:00
<div class="container landing__container">
2018-12-31 01:37:47 +00:00
{{ container_title('<i class="fas fa-user-plus fa-fw"></i> Newest User') }}
2019-03-02 21:25:35 +00:00
<a class="landing__latest" style="{{ latest_user.user_colour|html_colour }}" href="{{ url('user-profile', {'user': latest_user.user_id}) }}">
<div class="avatar landing__latest__avatar" style="--avatar-url: url('{{ url('user-avatar', {'user': latest_user.user_id}) }}')"></div>
<div class="landing__latest__content">
<div class="landing__latest__username">
2018-12-31 01:37:47 +00:00
{{ latest_user.username }}
</div>
2019-03-02 21:25:35 +00:00
<div class="landing__latest__joined">
2018-12-31 01:37:47 +00:00
Joined <time datetime="{{ latest_user.user_created|date('c') }}" title="{{ latest_user.user_created|date('r') }}">{{ latest_user.user_created|time_diff }}</time>
</div>
</div>
</a>
</div>
{% endif %}
2019-03-02 21:25:35 +00:00
<div class="container landing__container">
2019-01-24 20:54:24 +00:00
{{ container_title('<i class="fas fa-wrench fa-fw"></i> Changelog', false, url('changelog-index')) }}
<div class="changelog__content">
2019-03-02 21:04:45 +00:00
{{ changelog_listing(featured_changelog, false, true) }}
</div>
</div>
</div>
2019-03-02 21:25:35 +00:00
<div class="landing__main">
{% for post in featured_news %}
{{ news_preview(post) }}
{% endfor %}
</div>
</div>
{% if linked_data is defined and linked_data is iterable %}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"name": "{{ linked_data.name }}",
"url": "{{ linked_data.url }}",
"logo": "{{ linked_data.logo }}",
"sameAs": [
"{{ linked_data.same_as|join('", "')|raw }}"
]
}
</script>
{% endif %}
{% endblock %}