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


{% block title %}
{% trans "Avatars gallery" %} | {% trans "Change options" %} | {{ block.super }}
{% endblock title %}


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

    <div class="form-header">
      <h2>
        <span class="fa fa-image"></span>
        {% trans "Select avatar from gallery" %}
      </h2>
    </div>

    <div class="form-body">

      {% for gallery in galleries %}
      <fieldset>
        <legend>{{ gallery.name }}</legend>
        <div class="gallery">
          {% for row in gallery.images|batch:4 %}
          <div class="row">
            {% for image in row %}
            <div class="col-md-3">
              <button type="submit" name="new-image", value="{{ image }}" class="thumbnail">
                <img src="{{ MEDIA_URL }}{{ image }}" alt="{% trans "Gallery image"%}">
              </button>
            </div>
            {% endfor %}
          </div>
          {% endfor %}
        </div>
      </fieldset>
      {% endfor %}

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