{% extends "cranefly/layout.html" %} {% import "forms.html" as form_theme with context %} {% import "cranefly/macros.html" as macros with context %} {% block title %}{{ macros.page_title(title=warned_user.username, parent=_('Warn User')) }}{% endblock %} {% block content %}

{% trans user=warned_user.username %}Warn User: {{ user }}{% endtrans %}

{% if retreat %} {% endif %}
{{ form_theme.row(form.reason, attrs={'class': 'span6', 'rows': 4}) }}

{% trans next_level_name=wrap_level_name(next_warning_level) %}Next Warning Level: {{ next_level_name }}{% endtrans %}

{% if next_warning_level.description %}

{{ next_warning_level.description }}

{% endif %}
{% trans %}Expires After:{% endtrans %} {{ level_restriction_expires(next_warning_level.expires_after_minutes) }}
{% trans %}Posting Replies Restriction:{% endtrans %} {{ level_restriction_legend(next_warning_level.restrict_posting_replies) }}
{% trans %}Posting Threads Restriction:{% endtrans %} {{ level_restriction_legend(next_warning_level.restrict_posting_threads) }}
{% if retreat %} {% trans %}Cancel{% endtrans %} {% endif %}
{% endblock %} {# Macros #} {% macro wrap_level_name(warning_level) -%} {{ warning_level.name }} {%- endmacro %} {% macro level_restriction_expires(level_expires) -%} {% if level_expires > 0 %} {{ level_expires|timeamount|capfirst }} {% else %} {% trans %}Never{% endtrans %} {% endif %} {%- endmacro %} {% macro level_restriction_legend(restriction) -%} {% if restriction == 0 %}
{% trans %}No{% endtrans %}
{% elif restriction == 1 %}
{% trans %}Moderator Review{% endtrans %}
{% elif restriction == 2 %}
{% trans %}Forbidden{% endtrans %}
{% endif %} {%- endmacro %}