{% from 'macros/flash.htm' import render_flash %}
{% from 'macros/custom_form.htm' import user_fields %}
{% from 'macros/form.htm' import render_field %}

{% extends 'content.htm' %}


{% block content %}
    <div class='mainblock'>
        <div class='page-header'>
            {% if ModuleAPI.can_write('page') and UserAPI.can_write(page) %}
                <div class='btn-group pull-right'>
                    {% if page.id %}
                        <a class='btn btn-default' href='{{ url_for('page.get_page_history', path=page.path) }}'>
                            <i class='glyphicon glyphicon-time'></i> Bekijk geschiedenis
                        </a>
                    {% endif %}
                    <a class='btn btn-warning' href='{{ url_for('page.edit_page', path=page.path) }}'>
                        <i class='glyphicon glyphicon-pencil'></i> Bewerk pagina
                    </a>
                </div>
            {% endif %}

            <h1>{% block page_title %}{% endblock %}</h1>
        </div>

        {% block page_content %}{% endblock %}
    </div>
{% endblock %}

{% from 'macros/flash.htm' import render_flash %}
{% from 'macros/custom_form.htm' import user_fields %}
{% from 'macros/form.htm' import render_field %}

{% extends 'content.htm' %}


{% block content %}
    <div class='mainblock'>
        <div class='page-header'>
            {% if ModuleAPI.can_write('page') and (not page.id or
                    UserAPI.can_write(page)) %}
                <div class='btn-group pull-right'>
                    {% if page.id %}
                        <a class='btn btn-default' href='{{ url_for('page.get_page_history', path=page.path) }}'>
                            <i class='glyphicon glyphicon-time'></i> Bekijk geschiedenis
                        </a>
                    {% endif %}
                    <a class='btn btn-warning' href='{{ url_for('page.edit_page', path=page.path) }}'>
                        <i class='glyphicon glyphicon-pencil'></i> Bewerk pagina
                    </a>
                </div>
            {% endif %}

            <h1>{% block page_title %}{% endblock %}</h1>
        </div>

        {% block page_content %}{% endblock %}
    </div>
{% endblock %}

Fix edit button for non-existant pages
Fix edit button for non-existant pages

The logic for displaying the edit button on pages was: is the user in a
group that can edit the page, and can the user edit this specific page.
Now when a page does not exist, the user might have rights to edit
pages, but no rights to edit this specific page exist, so the logic
fails.

This is fixed by changing the logic to: is the user in a group that can
edit the page, and is this a non-existant page or can the user edit this
specific existant page.

Shit wooorks.
