flashwave
383e2ed0e0
This one took multiple days and it pretty invasive into the core of Misuzu so issue might (will) arise, there's also some features that have gone temporarily missing in the mean time and some inefficiencies introduced that will be fixed again at a later time. The old class isn't gone entirely because I still have to figure out what I'm gonna do about validation, but for the most part this knocks out one of the "layers of backwards compatibility", as I've been referring to it, and is moving us closer to a future where Flashii actually gets real updates. If you run into anything that's broken and you're inhibited from reporting it through the forum, do it through chat or mail me at flashii-issues@flash.moe.
249 lines
11 KiB
Twig
249 lines
11 KiB
Twig
{% macro user_card(user) %}
|
|
{% from 'macros.twig' import avatar %}
|
|
|
|
<div class="usercard" style="--accent-colour: {{ user.colour }}">
|
|
<div class="usercard__background"></div>
|
|
<a class="usercard__link" href="{{ url('user-profile', {'user': user.info.id}) }}" title="Visit {{ user.info.name }}'{{ user.info.name|last|lower == 's' ? '' : 's' }} profile"></a>
|
|
|
|
<div class="usercard__avatar">
|
|
{{ avatar(user.info.id, 50, user.info.name) }}
|
|
</div>
|
|
|
|
<div class="usercard__details">
|
|
<div class="usercard__details_inner">
|
|
<div class="usercard__details__username">
|
|
{{ user.info.name }}
|
|
</div>
|
|
|
|
{% if user.info.hasTitle %}
|
|
<div class="usercard__details__title">
|
|
{{ user.info.title }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if user.info.hasCountryCode %}
|
|
<div class="usercard__details__country">
|
|
<div class="flag flag--{{ user.info.countryCode|lower }}"></div>
|
|
<div class="usercard__details__country__name">
|
|
{{ user.info.countryCode|country_name }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="usercard__stats">
|
|
{% if user.ftopics > 0 %}
|
|
<a class="usercard__stat" href="{{ url('user-profile-forum-topics', {'user': user.info.id}) }}">
|
|
<div class="usercard__stat__name">Topics</div>
|
|
<div class="usercard__stat__value">{{ user.ftopics|number_format }}</div>
|
|
</a>
|
|
{% endif %}
|
|
|
|
{% if user.fposts > 0 %}
|
|
<a class="usercard__stat" href="{{ url('user-profile-forum-posts', {'user': user.info.id}) }}">
|
|
<div class="usercard__stat__name">Posts</div>
|
|
<div class="usercard__stat__value">{{ user.fposts|number_format }}</div>
|
|
</a>
|
|
{% endif %}
|
|
|
|
{% if user.info.hasLastActive %}
|
|
<div class="usercard__stat usercard__stat--wide" title="{{ user.info.lastActiveTime|date('r') }}">
|
|
<div class="usercard__stat__name">Last seen</div>
|
|
<div class="usercard__stat__value"><time datetime="{{ user.info.lastActiveTime|date('c') }}">{{ user.info.lastActiveTime|time_format }}</time></div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="usercard__stat usercard__stat--wide" title="{{ user.info.createdTime|date('r') }}">
|
|
<div class="usercard__stat__name">Joined</div>
|
|
<div class="usercard__stat__value"><time datetime="{{ user.info.createdTime|date('c') }}">{{ user.info.createdTime|time_format }}</time></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% macro user_session(session, is_current_session) %}
|
|
{% from '_layout/input.twig' import input_hidden, input_csrf, input_checkbox_raw %}
|
|
|
|
<div class="settings__session{% if is_current_session %} settings__session--current{% endif %}" id="session-{{ session.id }}">
|
|
<div class="settings__session__container">
|
|
<div class="settings__session__important">
|
|
<div class="flag flag--{{ session.countryCode|lower }} settings__session__flag" title="{{ session.countryCode|country_name }}">{{ session.countryCode }}</div>
|
|
|
|
<div class="settings__session__description">
|
|
{{ session.clientInfo }}
|
|
</div>
|
|
|
|
<form class="settings__session__actions" method="post" action="{{ url('settings-sessions') }}">
|
|
{{ input_csrf() }}
|
|
{{ input_hidden('session', session.id) }}
|
|
|
|
<button class="settings__session__action" title="{{ is_current_session ? 'Logout' : 'End Session' }}">
|
|
{% if is_current_session %}
|
|
<i class="fas fa-sign-out-alt"></i>
|
|
{% else %}
|
|
<i class="fas fa-times-circle"></i>
|
|
{% endif %}
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="settings__session__details">
|
|
<div class="settings__session__detail">
|
|
<div class="settings__session__detail__title">
|
|
Created from IP
|
|
</div>
|
|
<div class="settings__session__detail__value">
|
|
{{ session.firstRemoteAddress }}
|
|
</div>
|
|
</div>
|
|
|
|
{% if session.hasLastRemoteAddress %}
|
|
<div class="settings__session__detail">
|
|
<div class="settings__session__detail__title">
|
|
Last used from IP
|
|
</div>
|
|
<div class="settings__session__detail__value">
|
|
{{ session.lastRemoteAddress }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="settings__session__detail" title="{{ session.createdTime|date('r') }}">
|
|
<div class="settings__session__detail__title">
|
|
Created
|
|
</div>
|
|
<time class="settings__session__detail__value" datetime="{{ session.createdTime|date('c') }}">
|
|
{{ session.createdTime|time_format }}
|
|
</time>
|
|
</div>
|
|
|
|
<div class="settings__session__detail" title="{{ session.expiresTime|date('r') }}">
|
|
<div class="settings__session__detail__title">
|
|
Expires{% if not session.shouldBumpExpires %} (static){% endif %}
|
|
</div>
|
|
<time class="settings__session__detail__value" datetime="{{ session.expiresTime|date('c') }}">
|
|
{{ session.expiresTime|time_format }}
|
|
</time>
|
|
</div>
|
|
|
|
{% if session.hasLastActive %}
|
|
<div class="settings__session__detail" title="{{ session.lastActiveTime|date('r') }}">
|
|
<div class="settings__session__detail__title">
|
|
Last Active
|
|
</div>
|
|
<time class="settings__session__detail__value" datetime="{{ session.lastActiveTime|date('c') }}">
|
|
{{ session.lastActiveTime|time_format }}
|
|
</time>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="settings__session__detail">
|
|
<div class="settings__session__detail__title">
|
|
User Agent
|
|
</div>
|
|
<div class="settings__session__detail__value">
|
|
{{ session.userAgentString }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% macro user_login_attempt(attempt) %}
|
|
<div class="settings__login-attempt{% if not attempt.success %} settings__login-attempt--failed{% endif %}">
|
|
<div class="settings__login-attempt__container">
|
|
<div class="settings__login-attempt__important">
|
|
<div class="flag flag--{{ attempt.countryCode|lower }} settings__login-attempt__flag" title="{{ attempt.countryCode|country_name }}">{{ attempt.countryCode }}</div>
|
|
|
|
<div class="settings__login-attempt__description">
|
|
{{ attempt.clientInfo }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="settings__login-attempt__details">
|
|
<div class="settings__login-attempt__detail">
|
|
<div class="settings__login-attempt__detail__title">
|
|
IP Address
|
|
</div>
|
|
<div class="settings__login-attempt__detail__value">
|
|
{{ attempt.remoteAddressRaw }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="settings__login-attempt__detail">
|
|
<div class="settings__login-attempt__detail__title">
|
|
Succeeded
|
|
</div>
|
|
<div class="settings__login-attempt__detail__value">
|
|
{{ attempt.success ? 'Yes' : 'No' }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="settings__login-attempt__detail" title="{{ attempt.createdTime|date('r') }}">
|
|
<div class="settings__login-attempt__detail__title">
|
|
Attempted
|
|
</div>
|
|
<time class="settings__login-attempt__detail__value" datetime="{{ attempt.createdTime|date('c') }}">
|
|
{{ attempt.createdTime|time_format }}
|
|
</time>
|
|
</div>
|
|
|
|
<div class="settings__login-attempt__detail">
|
|
<div class="settings__login-attempt__detail__title">
|
|
User Agent
|
|
</div>
|
|
<div class="settings__login-attempt__detail__value">
|
|
{{ attempt.userAgentString }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% macro user_account_log(data, users, colours) %}
|
|
{% from 'macros.twig' import avatar %}
|
|
|
|
<div class="settings__account-log">
|
|
{% if data.hasUserId and users[data.userId] is defined %}
|
|
{% set user = users[data.userId] %}
|
|
{% set colour = colours[data.userId]|default(null) %}
|
|
<a href="{{ url('user-profile', {'user': user.id}) }}" class="settings__account-log__user"{% if colour is not null %} style="--user-colour: {{ colour }}"{% endif %}>
|
|
<div class="settings__account-log__user__avatar">{{ avatar(user.id, 20, user.name) }}</div>
|
|
<div class="settings__account-log__user__name">{{ user.name }}</div>
|
|
</a>
|
|
{% endif %}
|
|
|
|
<div class="settings__account-log__container">
|
|
<div class="settings__account-log__important">
|
|
<div class="flag flag--{{ data.countryCode|lower }} settings__login-attempt__flag" title="{{ data.countryCode|country_name }}">{{ data.countryCode }}</div>
|
|
|
|
<div class="settings__login-attempt__description">
|
|
{{ data.formatted }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="settings__account-log__details">
|
|
<div class="settings__account-log__detail">
|
|
<div class="settings__account-log__detail__title">
|
|
IP Address
|
|
</div>
|
|
<div class="settings__account-log__detail__value">
|
|
{{ data.remoteAddress }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="settings__account-log__detail" title="{{ data.createdTime|date('r') }}">
|
|
<div class="settings__account-log__detail__title">
|
|
Date
|
|
</div>
|
|
<time class="settings__account-log__detail__value" datetime="{{ data.createdTime|date('c') }}">
|
|
{{ data.createdTime|time_format }}
|
|
</time>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|