{% set canEdit = currentUser is not null and ( ( ctx.user.id == currentUser.id and currentUser.hasPermission(permission("EDIT_OWN_USER")) ) or currentUser.hasPermission(permission("EDIT_OTHER_USER")) ) %} {% set isOwnProfile = currentUser is not null and currentUser.id == ctx.user.id %} {% set sUserPossessive = isOwnProfile ? "Your posts" : "%display_name%'s posts" %} {% set emailPending = isOwnProfile and ctx.user.pendingEmail is not null %} {% set title = ctx.user.displayName %} {% extends "base.twig" %} {% block content %} {% if canEdit %}
{% endif %}

{{ __(sUserPossessive, { "display_name": ctx.user.displayName|e("html"), }) }}

{% if ctx.posts|length > 0 %}
{% for post in ctx.posts %}

{% if hasAttachments %} {% endif %} {{ renderPostSummary(post.content) }}

{{ __("posted on %post_date% in %topic%", { "post_date": '' ~ post.postDate.format("c")|e("html") ~ '', "topic": '' ~ (ctx.topics[post.topicId] is not null and ctx.topics[post.topicId].isLocked ? ' ' : '') ~ (ctx.topics[post.topicId] is not null ? ctx.topics[post.topicId].title : __("unknown"))|e("html") ~ '', }) }}
{% endfor %}
{% else %}
{{ __("This user has not posted anything yet") }}
{% endif %} {% if canEdit %}

{{ __("Edit profile") }}

{% set formId = "update_profile" %} {% set formError = getAndClearFormError(formId) %} {% if formError %} {% include "components/alert_error.twig" with { message: formError } %} {% endif %}
{% if ctx.lastNameChangeTooRecent %} {{ __("You can only change your username every 30 days!") }} {% else %} {% endif %}
{% if emailPending %} {% else %} {% endif %}
{% if isOwnProfile %}

{{ __("Change password") }}

{% set formId = "update_password" %} {% set formError = getAndClearFormError(formId) %} {% if formError %} {% include "components/alert_error.twig" with { message: formError } %} {% endif %}
{% endif %}
{% endif %} {% if canEdit %} {% endif %} {% endblock %}