Sith/core/templates/core/page.jinja

50 lines
1.5 KiB
Plaintext
Raw Normal View History

2016-02-01 16:35:55 +00:00
{% extends "core/base.jinja" %}
2015-11-20 14:47:01 +00:00
{% block title %}
2016-07-19 17:03:16 +00:00
{% if page %}
{{ page.get_display_name() }}
{% elif page_list %}
{% trans %}Page list{% endtrans %}
{% elif new_page %}
{% trans %}Create page{% endtrans %}
{% else %}
{% trans %}Not found{% endtrans %}
{% endif %}
2015-11-20 14:47:01 +00:00
{% endblock %}
2016-07-22 00:05:29 +00:00
{% macro print_page_name(page) %}
{% if page %}
{{ print_page_name(page.parent) }} >
2016-07-28 18:05:56 +00:00
<a href="{{ url('core:page', page_name=page.get_full_name()) }}">{{ page.get_display_name() }}</a>
2016-07-22 00:05:29 +00:00
{% endif %}
{% endmacro %}
2015-11-20 14:47:01 +00:00
{% block content %}
2016-07-22 00:05:29 +00:00
{{ print_page_name(page) }}
<div class="tool-bar">
<div class="tools">
{% if page %}
<a href="{{ url('core:page', page.get_full_name()) }}">{% trans %}View{% endtrans %}</a>
<a href="{{ url('core:page_hist', page_name=page.get_full_name()) }}">{% trans %}History{% endtrans %}</a>
{% if can_edit(page, user) %}
<a href="{{ url('core:page_edit', page_name=page.get_full_name()) }}">{% trans %}Edit{% endtrans %}</a>
{% endif %}
{% if can_edit_prop(page, user) %}
<a href="{{ url('core:page_prop', page_name=page.get_full_name()) }}">{% trans %}Prop{% endtrans %}</a>
{% endif %}
{% endif %}
</div>
</div>
<hr>
2016-07-19 17:03:16 +00:00
{% if page %}
{% block page %}
{% endblock %}
{% else %}
<h2>{% trans %}Page does not exist{% endtrans %}</h2>
<p><a href="{{ url('core:page_new') }}?page={{ request.resolver_match.kwargs['page_name'] }}">
{% trans %}Create it?{% endtrans %}</a></p>
{% endif %}
2015-11-20 14:47:01 +00:00
{% endblock %}