{% extends 'user/master.twig' %} {% from 'macros.twig' import container_title %} {% from 'user/macros.twig' import user_profile_warning %} {% from '_layout/input.twig' import input_hidden, input_csrf, input_text, input_checkbox, input_file, input_file_raw, input_select %} {% set image = url('user-avatar', {'user': profile.user_id}) %} {% set canonical_url = url('user-profile', {'user': profile.user_id}) %} {% set title = 'Profile of ' ~ profile.username %} {% set manage_link = '/manage/users.php?v=view&u=' ~ profile.user_id %} {% set stats = [ { 'title': 'Joined', 'is_date': true, 'value': profile.user_created, }, { 'title': 'Last seen', 'is_date': true, 'value': profile.user_active, }, { 'title': 'Following', 'value': profile.following_count, 'url': url('user-profile-following', {'user': profile.user_id}), }, { 'title': 'Followers', 'value': profile.followers_count, 'url': url('user-profile-followers', {'user': profile.user_id}), }, { 'title': 'Topics', 'value': profile.forum_topic_count, }, { 'title': 'Posts', 'value': profile.forum_post_count, }, { 'title': 'Comments', 'value': profile.comments_count, }, { 'title': 'Changes', 'value': profile.changelog_count, }, ] %} {% block content %} {% if profile_is_editing %}
{{ input_csrf('profile') }} {% if perms.edit_avatar %} {{ input_file_raw('avatar[file]', 'profile__hidden', ['image/png', 'image/jpeg', 'image/gif'], {'id':'avatar-selection'}) }} {% endif %} {% else %}
{% endif %} {% include 'user/_layout/header.twig' %} {% if profile_is_editing %}
  • General
  • Keep things sane and generally suitable for all ages.
  • Make sure to adhere to the rules.
{% if perms.edit_avatar %}
  • Avatar
  • May not exceed the {{ guidelines.avatar.max_size|byte_symbol(true) }} file size limit.
  • May not be larger than {{ guidelines.avatar.max_width }}x{{ guidelines.avatar.max_height }}.
  • Will be centre cropped and scaled to 200x200.
  • Animated gif images are allowed.
{% endif %} {% if perms.edit_background %}
  • Background
  • May not exceed the {{ guidelines.background.max_size|byte_symbol(true) }} file size limit.
  • May not be larger than {{ guidelines.background.max_width }}x{{ guidelines.background.max_height }}.
  • Gif images, in general, are only allowed when tiling.
{% endif %}
{% endif %} {% if profile_notices|length > 0 %}
{% for notice in profile_notices %} {{ notice }} {% endfor %}
{% endif %}
{% set show_profile_fields = profile_is_editing ? perms.edit_profile : profile_fields|default([])|length > 0 %} {% set show_background_settings = profile_is_editing and perms.edit_background %} {% set show_birthdate = profile_is_editing and perms.edit_birthdate %} {% set show_sidebar = current_user is not defined or show_profile_fields or show_background_settings %} {% if show_sidebar %}
{% if show_background_settings %}
{{ container_title('Background') }}
{{ input_file('background[file]', '', ['image/png', 'image/jpeg', 'image/gif'], {'id':'background-selection'}) }} {{ input_checkbox('background[attach]', 'None', true, '', 0, true, {'onchange':'profileChangeBackgroundAttach(this.value)'}) }} {% for key, value in background_attachments %} {{ input_checkbox('background[attach]', value|capitalize, key == profile.user_background_attachment, '', key, true, {'onchange':'profileChangeBackgroundAttach(this.value)'}) }} {% endfor %} {{ input_checkbox('background[attr][blend]', 'Blend', profile.user_background_blend, '', '', false, {'onchange':'profileToggleBackgroundAttr(\'blend\', this.checked)'}) }} {{ input_checkbox('background[attr][slide]', 'Slide', profile.user_background_slide, '', '', false, {'onchange':'profileToggleBackgroundAttr(\'slide\', this.checked)'}) }}
{% endif %} {% if current_user is not defined %}
You must log in to view full profiles!
{% elseif show_profile_fields %}
{{ container_title('Elsewhere') }}
{% for name, data in profile_fields %} {% endfor %}
{% endif %} {% if show_birthdate %}
{{ container_title('Birthdate') }} {% set birthdate = profile.user_birthdate|split('-') %}
{% endif %}
{% endif %}
{% if (profile_is_editing and perms.edit_about) or profile.user_about_content|length > 0 %}
{{ container_title('About ' ~ profile.username) }} {% if profile_is_editing %}
{{ input_select('about[parser]', constant('MSZ_PARSERS_NAMES'), profile.user_about_parser, '', '', false, 'profile__about__select') }}
{% else %}
{{ profile.user_about_content|escape|parse_text(profile.user_about_parser)|raw }}
{% endif %}
{% endif %} {% if (profile_is_editing and perms.edit_signature) or profile.user_signature_content|length > 0 %}
{{ container_title('Signature') }} {% if profile_is_editing %}
{{ input_select('signature[parser]', constant('MSZ_PARSERS_NAMES'), profile.user_signature_parser, '', '', false, 'profile__signature__select') }}
{% else %}
{{ profile.user_signature_content|escape|parse_text(profile.user_signature_parser)|raw }}
{% endif %}
{% endif %} {% if profile_warnings|length > 0 %}
{{ container_title('Account Standing', false, profile_warnings_can_manage ? '/manage/users.php?v=warnings&u=' ~ profile.user_id : '') }}
{% if profile_warnings_can_manage %}
User IP
Issuer
Issuer IP
{% endif %}
Type
Created
Expires
Note
{% for warning in profile_warnings %} {{ user_profile_warning(warning, prpfile_warnings_view_private, profile_warnings_can_manage, profile_warnings_can_manage ? csrf_token('warning-delete[%d]'|format(warning.warning_id)) : '') }} {% endfor %}
{% endif %}
{% if profile_is_editing %} {% else %}
{% endif %} {% endblock %}