{% macro user_card(user) %} {% from 'macros.twig' import avatar %} {% if user.info is defined %} {% set colour = user.colour %} {% set info = user.info %} {% set ftopics = user.ftopics %} {% set fposts = user.fposts %} {% else %} {% set colour = user.user_colour %} {% set info = { 'id': user.user_id, 'name': user.username, 'hasTitle': user.user_title is defined and user.user_title is not empty, 'title': user.user_title|default(''), 'hasCountryCode': user.user_country is defined and user.user_country != 'XX', 'countryCode': user.user_country|default('XX'), 'hasLastActive': user.user_active is defined and user.user_active > 0, 'lastActiveTime': user.user_active, 'createdTime': user.user_created } %} {% set ftopics = user.user_count_topics %} {% set fposts = user.user_count_posts %} {% endif %}
{{ avatar(info.id, 50, info.name) }}
{{ info.name }}
{% if info.hasTitle %}
{{ info.title }}
{% endif %} {% if info.hasCountryCode %}
{{ info.countryCode|country_name }}
{% endif %}
{% if ftopics > 0 %}
Topics
{{ ftopics|number_format }}
{% endif %} {% if fposts > 0 %}
Posts
{{ fposts|number_format }}
{% endif %} {% if info.hasLastActive %}
Last seen
{% endif %}
Joined
{% endmacro %} {% macro user_session(session, is_current_session) %} {% from '_layout/input.twig' import input_hidden, input_csrf, input_checkbox_raw %}
{{ session.countryCode }}
{{ session.clientInfo }}
{{ input_csrf() }} {{ input_hidden('session', session.id) }}
Created from IP
{{ session.firstRemoteAddress }}
{% if session.hasLastRemoteAddress %}
Last used from IP
{{ session.lastRemoteAddress }}
{% endif %}
Created
Expires{% if not session.shouldBumpExpires %} (static){% endif %}
{% if session.hasLastActive %}
Last Active
{% endif %}
User Agent
{{ session.userAgentString }}
{% endmacro %} {% macro user_login_attempt(attempt) %}
{% endmacro %} {% macro user_account_log(data, users, colours) %} {% from 'macros.twig' import avatar %}
{% if data.hasUserId and users[data.userId] is defined %} {% set user = users[data.userId] %} {% set colour = colours[data.userId]|default(null) %} {% endif %}
{% endmacro %}