{% extends "misago/usercp/base.html" %}
{% load i18n misago_editor %}


{% block page %}
<div class="form-panel">
  <form method="POST" role="form" class="form-horizontal">
    {% csrf_token %}

    <div class="form-header">
      <h2>
        <span class="{{ active_page.icon }}"></span>
        {{ active_page.name }}
      </h2>
    </div>

    {% include "misago/form_errors.html" %}

    {% if user.signature %}
    <div class="form-body form-markup-preview">
      {% if user.has_valid_signature %}
      <article class="misago-markup">
        {{ user.signature_parsed|safe }}
      </article>
      {% else %}
      <p class="lead text-danger">
        <span class="fa fa-exclamation-triangle"></span>
        {% trans "Signature is corrupted and can't be displayed." %}
      </p>
      {% endif %}
    </div>
    {% endif %}

    {% if user.is_signature_banned %}
    <div class="form-body form-text">
      <div class="lead">
        {% if user.signature_ban_user_message %}
        {{ user.signature_ban_user_message|escape|urlize|linebreaks }}
        {% else %}
        <p>{% trans "You have been banned from editing your signature." %}</p>
        {% endif %}
      </div>
    </div>
    {% else %}
    <div class="form-body">

      {% editor_body editor %}

    </div>

    <div class="form-footer">
      <button class="btn btn-primary">{% trans "Save changes" %}</button>
    </div>
    {% endif %}

  </form>
</div>
{% endblock page %}


{% block javascripts %}
{% editor_js editor %}
{% endblock javascripts %}
