misuzu/templates/home/landing.twig

202 lines
8.9 KiB
Twig
Raw Permalink Normal View History

2022-09-13 13:14:49 +00:00
{% extends 'home/master.twig' %}
{% from 'macros.twig' import container_title, avatar %}
{% set canonical_url = '/' %}
{% set landing_stats = [
{
icon: 'fas fa-users fa-fw',
name: 'members',
value: statistics['users:active']|number_format,
2022-09-13 13:14:49 +00:00
},
{
icon: 'fas fa-user-check fa-fw',
name: 'online',
value: statistics['users:online:recent']|number_format,
2022-09-13 13:14:49 +00:00
},
{
icon: 'fas fa-user-clock fa-fw',
name: 'active (24 hr)',
value: statistics['users:online:today']|number_format,
2022-09-13 13:14:49 +00:00
},
{
icon: 'fas fa-list fa-fw',
name: 'topics',
value: statistics['forum:topics:visible']|number_format,
2022-09-13 13:14:49 +00:00
},
{
icon: 'fas fa-comments fa-fw',
name: 'posts',
value: statistics['forum:posts:visible']|number_format,
2022-09-13 13:14:49 +00:00
},
{
icon: 'fas fa-comment-dots fa-fw',
name: 'comments',
value: statistics['comments:posts:visible']|number_format,
2022-09-13 13:14:49 +00:00
},
] %}
2023-08-31 21:33:34 +00:00
{% set header_menu = msz_header_menu() %}
2022-09-13 13:14:49 +00:00
{% block main_header %}
<div class="landingv2-header">
<div class="landingv2-header-background"></div>
<div class="landingv2-header-content">
<div class="landingv2-welcome">
<a href="{{ url('index') }}">
2023-09-08 20:40:48 +00:00
<img src="/images/landing-logo.png" alt="{{ globals.site_info.name }}">
2022-09-13 13:14:49 +00:00
</a>
</div>
<div class="landingv2-header-menu">
{% for item in header_menu[1:] %}
<a href="{{ item.url }}" class="landingv2-header-menu-link">{{ item.title }}</a>
2022-09-13 13:14:49 +00:00
{% endfor %}
<a href="{{ url('auth-login') }}" class="landingv2-header-menu-link landingv2-auth-link landingv2-auth-link-login">
<div><i class="fas fa-sign-in-alt fa-fw"></i> Log in</div>
</a>
<a href="{{ url('auth-register') }}" class="landingv2-header-menu-link landingv2-auth-link landingv2-auth-link-register">
<div><i class="fas fa-user-plus fa-fw"></i> Register</div>
</a>
</div>
</div>
</div>
{% endblock %}
{% block main_footer %}
<footer class="landingv2-footer">
<div class="landingv2-footer-background"></div>
<div class="landingv2-footer-wrapper">
<div class="landingv2-footer-navigation">
{% for item in header_menu[0].menu %}
<div>
<a href="{{ item.url }}">{{ item.title }}</a>
</div>
2022-09-13 13:14:49 +00:00
{% endfor %}
</div>
<div class="landingv2-footer-copyright">
<div class="landingv2-footer-copyright-line">
<a href="https://flash.moe" target="_blank" rel="noreferrer noopener">flashwave</a> 2013-{{ ''|date('Y') }}
2022-09-13 13:14:49 +00:00
</div>
<div class="landingv2-footer-copyright-line">
{% set git_branch = git_branch() %}
{% if git_branch != 'HEAD' %}
<a href="https://github.com/flashwave/misuzu/tree/{{ git_branch }}" target="_blank" rel="noreferrer noopener">{{ git_branch }}</a>
{% else %}
{% set git_tag = git_tag() %}
<a href="https://github.com/flashwave/misuzu/tree/{{ git_tag }}" target="_blank" rel="noreferrer noopener">{{ git_tag }}</a>
{% endif %}
# <a href="https://github.com/flashwave/misuzu/commit/{{ git_commit_hash(true) }}" target="_blank" rel="noreferrer noopener">{{ git_commit_hash() }}</a>
</div>
2023-08-31 21:33:34 +00:00
{% if globals.display_timings_info %}
2022-09-13 13:14:49 +00:00
<div class="landingv2-footer-copyright-line">
2023-08-31 00:31:11 +00:00
{{ sql_query_count()|number_format }} queries / {{ (startup_time() - startup_time(constant('MSZ_TPL_RENDER')))|number_format(5) }} load / {{ startup_time(constant('MSZ_TPL_RENDER'))|number_format(5) }} template / {{ startup_time()|number_format(5) }} total
2022-09-13 13:14:49 +00:00
</div>
{% endif %}
</div>
</div>
</footer>
{% endblock %}
{% block content %}
<div class="landingv2-content">
<div class="landingv2-stats">
{% for stat in landing_stats %}
<div class="landingv2-stat">
<div class="landingv2-stat-icon">
<i class="{{ stat.icon }}"></i>
</div>
<div class="landingv2-stat-value">
<span class="landingv2-stat-value-num">{{ stat.value }}</span> {{ stat.name }}
</div>
</div>
{% endfor %}
</div>
<div class="landingv2-forum">
<div class="landingv2-forum-topics landingv2-forum-topics-popular">
{{ container_title('<i class="fas fa-star fa-fw"></i> Popular Topics') }}
<div class="landingv2-forum-topics-list">
{% for topic in forum_popular %}
<div class="landingv2-forum-topic">
<a href="{{ url('forum-topic', {'topic': topic.topic_id}) }}" class="landingv2-forum-topic-link"></a>
<div class="landingv2-forum-topic-info">
<div class="landingv2-forum-topic-info-icon">
<i class="{{ topic.forum_icon|default('fas fa-comments fa-fw') }}"></i>
</div>
<div class="landingv2-forum-topic-info-details">
<div class="landingv2-forum-topic-info-details-title">
{{ topic.topic_title }}
</div>
</div>
<div class="landingv2-forum-topic-info-stats">
<div class="landingv2-forum-topic-info-stats-posts">{{ topic.topic_count_posts|number_format }}</div>
<div class="landingv2-forum-topic-info-stats-views">{{ topic.topic_count_views|number_format }}</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
<div class="landingv2-forum-topics landingv2-forum-topics-active">
{{ container_title('<i class="fas fa-wind fa-fw"></i> Active Topics') }}
<div class="landingv2-forum-topics-list">
{% for topic in forum_active %}
<div class="landingv2-forum-topic">
<a href="{{ url('forum-post', {'post': topic.latest_post_id}) }}" class="landingv2-forum-topic-link"></a>
<div class="landingv2-forum-topic-info">
<div class="landingv2-forum-topic-info-icon">
<i class="{{ topic.forum_icon|default('fas fa-comments fa-fw') }}"></i>
</div>
<div class="landingv2-forum-topic-info-details">
<div class="landingv2-forum-topic-info-details-title">
{{ topic.topic_title }}
</div>
</div>
<div class="landingv2-forum-topic-info-stats">
<div class="landingv2-forum-topic-info-stats-posts">{{ topic.topic_count_posts|number_format }}</div>
<div class="landingv2-forum-topic-info-stats-views">{{ topic.topic_count_views|number_format }}</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<div class="landingv2-news">
{% for post in featured_news %}
<div class="landingv2-news-post markdown">
<h1>{{ post.title }}</h1>
2023-07-15 17:02:46 +00:00
<p>{{ post.firstParagraph|parse_text(2)|raw }}</p>
2022-09-13 13:14:49 +00:00
<div class="landingv2-news-post-options">
<a href="{{ url('news-post', {'post': post.id}) }}" class="landingv2-news-post-option">Continue reading</a>
| <time datetime="{{ post.createdTime|date('c') }}" title="{{ post.createdTime|date('r') }}">{{ post.createdTime|time_format }}</time>
2022-09-13 13:14:49 +00:00
</div>
</div>
{% endfor %}
</div>
{% if online_users|length > 0 %}
<div class="landingv2-online">
{{ container_title('<i class="fas fa-users fa-fw"></i> Currently Online') }}
<div class="landingv2-online-users">
<div class="landingv2-online-inner">
{% for user in online_users %}
<a href="{{ url('user-profile', {'user': user.id}) }}" class="landingv2-online-avatar" title="{{ user.name }}">
{{ avatar(user.id, 50, user.name) }}
2022-09-13 13:14:49 +00:00
</a>
{% endfor %}
</div>
</div>
</div>
{% endif %}
</div>
{% if linked_data is not null %}
<script type="application/ld+json">{{ linked_data|json_encode|raw }}</script>
2022-09-13 13:14:49 +00:00
{% endif %}
{% endblock %}