{% extends "base.html" %}

{% block title %}Pages{% endblock %}

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

{% block nav_path %}
	<a href="{% url 'dmcm:root' %}">{{ site.domain }}</a> &rsaquo; 
	Edit
{% endblock %}

{% block content %}
	<div style="width:20%; float:left;">
        <h1>Pages</h1>
    </div>
    <div style="width:45%; float:right;">
        <a id="add_page" href="{% url 'dmcm:edit:add_page' %}">Add Page</a>
    </div>
    <div style="clear:both"></div>
    <table>
        <thead>
        	<tr><th>Page Title</th><th>Parent</th><th>Updated</th></tr>
        </thead>
        <tbody>
            {% for page in object_list %}
                <tr>
                    <td><a href="{% url 'dmcm:edit:edit' %}{{ page.slug }}/">{{ page.title }}</a></td>
                    <td>{{ page.parent }}</td>
                    <td>{{ page.updated|date:"Y-m-d H:i" }}</td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
    <br>
{% endblock %}

{% block footer %}
    <p>
    	<a href="{% url 'dmcm:root' %}" title="Return to Site">{{ site.domain }}</a>;
        <a href="/markdown/" title="Markdown Markup">Markdown</a>;
        <a href="{% url 'admin:index' %}" title="Django Admin">Admin</a>;
        <a href="{% url 'logout' %}">Logout</a>.
    </p>
{% endblock %}
