{% extends "layout-1-col.html" %}

{% block content %}
<lego:b-page-title>
    <lego:title>Выбор обложки для книг, страница {{ pages.current }}</lego:title>
</lego:b-page-title>
{% for b in books %}
	<div class="b-choose-cover">
		<div class="b-choose-cover__book">
			<a href="{% url view_book b.id %}">{% if b.authors_string %}{{ b.authors_string }}: {% endif %}{{ b.title }}</a>
		</div>
		<div>
		{% for i in b.variantbookinfo_set.all %}
			<div class="b-choose-cover__cover{% if b.current_vbi and b.current_vbi != i %} b-choose-cover__cover_faded{% endif %}" onclick="return {{i.id}};">
				<img src="{{ i.image_m_url }}"/>
				{% if b.current_vbi == i %}<i class="b-choose-cover__check">✓</i>{% endif %}
			</div>
			{% if forloop.counter == 5 and b.variantbookinfo_set.count > 6 %}
				<br/>
			{% endif %}
		{% endfor %}
		</div>
	</div>
{% endfor %}

<lego:b-pager current-page="{{ pages.current }}" total-count="{{ pages.total }}" page-url="{% url no_cover %}" page-param="page" pager-radius="2" start-from="1" perpage-count="10"></lego:b-pager>

<img class="ajax-indicator" style="display:none" src="/media/lego/common/block/b-spin/_size/b-spin_16.gif"/>

{% endblock %}