Refactor page handling

This commit is contained in:
Skia
2016-05-31 13:00:24 +02:00
parent 8da149c979
commit 356a2d2683
6 changed files with 66 additions and 36 deletions

View File

@ -5,6 +5,8 @@
{{ page.get_display_name() }}
{% elif page_list %}
Page list
{% elif new_page %}
Create page
{% else %}
Not found
{% endif %}
@ -16,6 +18,6 @@
{% endblock %}
{% else %}
<h2>Page does not exist</h2>
<p><a href="{{ url('core:page_prop', page_name=new_page) }}">Create it?</a></p>
<p><a href="{{ url('core:page_new') }}?page={{ request.resolver_match.kwargs['page_name'] }}">Create it?</a></p>
{% endif %}
{% endblock %}

View File

@ -3,10 +3,10 @@
{% block page %}
<h3>Page</h3>
<p><a href="{{ url('core:page_list') }}">Back to list</a></p>
{% if can_edit %}
{% if can_edit(page, user) %}
<p><a href="{{ url('core:page_edit', page_name=page.get_full_name()) }}">Edit</a></p>
{% endif %}
{% if can_edit_prop %}
{% if can_edit_prop(page, user) %}
<p><a href="{{ url('core:page_prop', page_name=page.get_full_name()) }}">Prop</a></p>
{% endif %}
<p>You're seeing the page <strong>{{ page.get_display_name() }}</strong> -