{% extends "site_base.html" %}
{% load i18n %}
{% load waliki_tags %}
{% check_perms "delete_page" for request.user in page.slug as "can_delete" %}


{% block header %}
    <div class="pull-right">
    {% block actions %}
        <div class="btn-group">

            <a href="{% url 'waliki_edit' slug=page.slug|default:slug %}" class="btn btn-default">{% trans "Edit" %}</a>
            <button class="btn dropdown-toggle btn-default" data-toggle="dropdown">
                <span class="caret"></span>
            </button>
            <ul class="dropdown-menu">
            <!-- dropdown menu links -->

            {% if page %}
                {% extra_page_actions page %}

                <li><a href="{% url "waliki_detail_raw" page.slug %}">{% trans "Raw" %}</a></li>

                {% if can_delete %}
                <li class="divider"></li>
                <li><a id="confirmDelete" class="text-error">{% trans "Delete" %}</a></li>

                {% endif %}

            {% endif %}
            </ul>
        </div>
    {% endblock actions %}
    </div>
    {% block title %}<h1>{{ page.title }}</h1>{% endblock title %}
{% endblock header %}

{% block content %}

    {% if page %}
        {{ page.body|safe }}
    {% else %}
        <p>{% trans "This page doesn't exist yet." %}</p>
        <p><a href="{% url 'waliki_edit' slug=page.slug|default:slug %}" class="btn btn-success">{% trans "Create it" %}</a></p>
    {% endif %}

 {% if page.footer %}
   <div id="footer">
   <hr>
   <div class="pull-right"><em><small>{{ page.footer|safe }}</small></em></div>
</div>
{% endif %}

{% if can_delete %}


<div id="myModal" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <!-- dialog body -->
            <div class="modal-body">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                Hello world!
            </div>
            <!-- dialog buttons -->
            <div class="modal-footer">
                <button type="button" class="btn btn-primary">OK</button>
            </div>
        </div>
    </div>
</div>


{% endif %}

{% endblock content %}

