{% extends 'ccgallery/base.html' %}

{% load ccgallery_tags %}

{% block title %} {{item.name}} &ndash; {% endblock %}

{% block extra_ccgallery_css %}
	{% gallery_css %}
{% endblock %}

{% block extra_ccgallery_js %}
	{% gallery_js %}
{% endblock %}

{% block ccgallery_breadcrumbs %}
	{% if category %}
		<a href="{{category.get_absolute_url}}">{{category.name}}</a>
	{% endif %}
	<a href="{{item.get_absolute_url}}">{{item.name}}</a>
{% endblock %}

{% block body %}
	<div class="media">
		<h1> {{item.name }} </h1>
		{% for image in item.itemimage_set.all %}
			{% if forloop.first %}
			<div class="large">
				<a
					class="gallery"
					rel="gallery"
					href="{{image.src.url_1200x960}}"
					title="{{image.caption}}">
					<img
						src="{{image.src.url_640x480}}"
						alt="image.caption">
				</a>
				<div class="description">
					{{item.description|markup}}
				</div>
			</div>
			{% else %}
				{% if forloop.counter == 2 %}
				<div class="thumbs">
				{% endif %}
					<a
						rel="gallery"
						class="gallery"
						href="{{image.src.url_1200x960}}"
						title="{{image.caption}}">
						<img
							src="{{image.src.url_200x200}}"
							alt="image.caption" >
					</a>
				{% if forloop.last %}
				</div>
				{% endif %}
			{% endif %}
		{% endfor %}
	</div>


{% endblock %}
