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

{% load ccpages_tags %}
{% load ccfiletypes_tags %}

{% block title %}{{page.title}} &ndash; {% endblock %}

{% block extra_css %}
	{% ccpages_css %}
{% endblock %}

{% block extra_js %}
	{% ccpages_js %}
{% endblock %}

{% block breadcrumbs %}
	{% ccpages_nav_breadcrumbs page %}
{% endblock %}

{% block nav_local %}
	{% ccpages_nav_local page %}
{% endblock %}

{% block content %}
	<article>
		<header>
			<h1>{{page.title}}</h1>
		</header>

		{{page.content_rendered|safe}}

		{% for image in page.pageimage_set.all %}
			{% if forloop.first %}
				<div class="images">
			{% endif %}

			<a
				{% if image.url %}
				href="{{image.url}}"
				{% else %}
				href="{{image.src.url_960x640}}"
				class="gallery"
				rel="gallery"
				{% endif %}
				>
				<img
					src="{{image.src.url_140x140}}"
					alt="{{image.title}}">
			</a>
			{% if forloop.last %}
				</div>
			{% endif %}
		{% endfor %}
	</article>
{% endblock %}
