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


{% 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>

    <div class="form-body form-avatar-home">

      <div class="media">
        <span class="pull-left">
          <img class="media-object img-rounded" src="{{ user|avatar:avatar_size }}" width="{{ avatar_size }}" height="{{ avatar_size }}" alt="{% trans "Your current avatar" %}">
        </span>
        <div class="media-body usercp-avatar-options">
          {% if user.is_avatar_banned %}
          <h4 class="media-heading">{% trans "Change avatar:" %}</h4>
          <div class="lead">
            {% if user.avatar_ban_user_message %}
            {{ user.avatar_ban_user_message|escape|urlize|linebreaks }}
            {% else %}
            <p>{% trans "You have been banned from changing your avatar." %}</p>
            {% endif %}
          </div>
          {% else %}
          <h4 class="media-heading">{% trans "Change avatar:" %}</h4>

          <ul class="list-unstyled">
            {% if misago_settings.allow_custom_avatars %}
            <li>
              <button name="dl-gravatar" class="btn btn-link">
                {% trans "Download my Gravatar" %}
              </button>
            </li>
            {% endif %}
            <li>
              <button name="set-dynamic" class="btn btn-link">
                {% trans "Generate avatar from my username" %}
              </button>
            </li>
            {% if misago_settings.allow_custom_avatars %}
            <li>
              <a href="#">
                {% trans "Upload image from computer" %}
              </a>
            </li>
            {% endif %}
            {% if galleries_exist %}
            <li>
              <a href="{% url 'misago:usercp_avatar_galleries' %}">
                {% trans "Pick avatar from gallery" %}
              </a>
            </li>
            {% endif %}
          </ul>
          {% endif %}

        </div>
      </div>

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