{% macro user_card(user, current_user) %} {% if user.getId is defined %} {% from _self import user_card_new %} {{ user_card_new(user, current_user) }} {% else %} {% from _self import user_card_old %} {{ user_card_old(user) }} {% endif %} {% endmacro %} {% macro user_card_new(user, current_user) %} {% from 'macros.twig' import avatar %}
{{ avatar(user.id, 60, user.username) }}
{{ user.username }}
{% if user.hasTitle %}
{{ user.title }}
{% endif %} {% if user.hasCountry %}
{{ user.countryName }}
{% endif %}
{% if user.forumTopicCount > 0 %}
Topics
{{ user.forumTopicCount|number_format }}
{% endif %} {% if user.forumPostCount > 0 %}
Posts
{{ user.forumPostCount|number_format }}
{% endif %}
Joined
{% if user.hasBeenActive %}
Last seen
{% else %}
Never logged in
{% endif %}
{% endmacro %} {% macro user_card_old(user) %} {% from 'macros.twig' import avatar %}
{{ avatar(user.user_id, 60, user.username) }}
{{ user.username }}
{% if user.user_title is defined and user.user_title is not empty %}
{{ user.user_title }}
{% endif %} {% if user.user_country|default('XX') != 'XX' %}
{{ user.user_country|country_name }}
{% endif %}
{% if user.user_count_topics|default(0) > 0 %}
Topics
{{ user.user_count_topics|number_format }}
{% endif %} {% if user.user_count_posts|default(0) > 0 %}
Posts
{{ user.user_count_posts|number_format }}
{% endif %}
{% if user.user_created is defined %}
Joined
{% endif %} {% if user.user_active is defined %} {% if user.user_active is null %}
Never logged in
{% else %}
Last seen
{% endif %} {% endif %}
{% endmacro %} {% macro user_session(session, is_current_session) %} {% from '_layout/input.twig' import input_hidden, input_csrf, input_checkbox_raw %}
{{ session.country }}
{{ session.userAgentInfo.toString }}
{{ input_csrf() }} {{ input_hidden('session[]', session.id) }}
Created from IP
{{ session.initialRemoteAddress }}
{% if session.hasLastRemoteAddress %}
Last used from IP
{{ session.lastRemoteAddress }}
{% endif %}
Created
Expires{% if not session.shouldBumpExpire %} (static){% endif %}
{% if session.hasActiveTime %}
Last Active
{% endif %}
User Agent
{{ session.userAgent is empty ? 'None' : session.userAgent }}
{% endmacro %} {% macro user_login_attempt(attempt) %}
{% endmacro %} {% macro user_account_log(data, users) %} {% from 'macros.twig' import avatar %}
{% if data.hasUserId and users[data.userId] is defined %} {% set user = users[data.userId] %} {% endif %}
{% endmacro %} {% macro user_profile_warning(warning, show_private_note, show_user_info, delete_csrf) %} {% from 'macros.twig' import avatar %} {% if warning.isSilence %} {% set warning_text = 'Silence' %} {% set warning_class = 'silence' %} {% elseif warning.isBan %} {% set warning_text = 'Ban' %} {% set warning_class = 'ban' %} {% elseif warning.isWarning %} {% set warning_text = 'Warning' %} {% set warning_class = 'warning' %} {% else %} {% set warning_text = 'Note' %} {% set warning_class = 'note' %} {% endif %}
{% if show_user_info or delete_csrf %}
{% if show_user_info %}
{{ avatar(warning.user.id, 20, warning.user.username) }}
{{ warning.user.username }}
{{ warning.userRemoteAddress }}
{{ avatar(warning.issuer.id, 20, warning.issuer.username) }}
{{ warning.issuer.username }}
{{ warning.issuerRemoteAddress }}
{% endif %} {% if delete_csrf %} {% endif %}
{% endif %}
{{ warning_text }}
{% if warning.isPermanent %}
PERMANENT
{% elseif warning.hasDuration %}
{{ warning.durationString }}
{% else %}
{% endif %}
{{ warning.publicNote }} {% if show_private_note and warning.hasPrivateNote %}
{{ warning.privateNote|nl2br }}
{% endif %}
{% endmacro %}