Use Jinja2 inheritance to render settings pages.

This gives us more flexibility than using {% include %}.
This commit is contained in:
2018-01-25 12:25:32 +01:00
parent fd3e795824
commit 0a0c47205f
4 changed files with 59 additions and 47 deletions

View File

@@ -0,0 +1,29 @@
| {% extends 'layout.html' %}
//- Don't extend this base file directly. Instead, extend page.html so that Pillar extensions
//- can provide overrides.
| {% block body %}
.container
#settings
#settings-sidebar
| {% block settings_sidebar %}
.settings-header
.settings-title Settings
.settings-content
ul
| {% block settings_sidebar_menu %}
a(class="{% if title == 'profile' %}active{% endif %}",
href="{{ url_for('settings.profile') }}")
li
i.pi-vcard
| Profile
| {% endblock settings_sidebar_menu %}
| {% endblock %}
#settings-container
.settings-header
.settings-title {% block settings_page_title %}{{ _("Title not set") }}{% endblock %}
.settings-content
| {% block settings_page_content %}No content set, update your template.{% endblock %}
| {% endblock %}