{% extends page.template %}
{% load i18n %}

{% block title %}{{ page.get_title }}{% endblock %}
{% block meta_description %}{{ page.get_description }}{% endblock %}
{% block meta_keywords %}{{ page.get_keywords }}{% endblock %}
{% block meta_canonical_url %}<link rel="canonical" href="{{ page.get_canonical_url }}" />{% endblock %}
{% block extra_head %}
{{ block.super }}
<link rel="stylesheet" href="{{ STATIC_URL }}css/pages.css">
{% endblock %}

{% block body %}
<div class="t">
    <div class="page-wrap">
        {% if page.header_image %}<div class="page-header">
            <img src="{{ page.get_header_image_url }}" />
        </div>{% endif %}

		{% if page.title %}
        <h1>{{ page.title }}</h1> 
		{% endif %}
        
        <div class="content">{{ page.content|safe }}</div>

        <form action="{% if edit_button %}{% url page.edit page.pk %}{% else %}{% url page.add %}{% endif %}" method="post" enctype="multipart/form-data">{% csrf_token %}
            <div style="display:none;">
                {{ form.as_p }}
                {{ metaform.as_p }}
                {{ categoryform.as_p }}
            </div>
            {% if edit_button %}
                <input type="submit" value="{% trans 'Save Page Changes' %}" />
            {% else %}
                <input type="submit" value="Add {% firstof MODULE_PAGES_LABEL 'Page' %}" />
            {% endif %}
        </form>
        <div id="preview-close"><a href="JavaScript:window.close()">{% trans "Close and Return to Edit" %}</a></div>
    </div>
</div>
{% endblock %}

