{% extends "base.html" %}

{% block extra_head %}
    <script type="text/javascript">
        $(function() {
            $("table").dataTable({"bPaginate": false, "aaSorting": []});
        });
    </script>
{% endblock %}

{% block title %}
    {% if object.slug != SITE_ROOT_SLUG %}
        {{ site.domain }}:
    {% endif %}
    {{ object.title }}
{% endblock %}

{% block nav_path %}
    {% for parent in object.navigation_path %}
            <a href="{{ parent.address }}">{{ parent.title }}</a> &rsaquo;
    {% endfor %}
    {{ object.title }}
{% endblock %}

{% block content %}
    {% if object.published %}<h2 style="text-align:right;">{{ page.published|date:"d F Y" }}</h2>{% endif %}
    {{ object.content_as_html }}
    <div id="source_body" style="display: none">
        <h1>Page Source</h1>
        <pre>{{object.content}}</pre>
    </div>
{% endblock %}

{% block footer %}
    <p>
        Last Updated: {{ object.updated|date:"Y-m-d H:i" }};
        <span id="source_label">Source</span>;
        <a href="{% url 'dmcm:root' %}markdown/" title="Markdown Markup">Markdown</a>;
        <a id="edit" href="{% url 'dmcm:edit:update_page' object.slug %}" title="Edit this page">Edit</a>.
    </p>
{% endblock %}
