From 9e217d87c095170460a8580d5215ddf7cbe639f4 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 2 Sep 2018 02:09:56 +0200 Subject: Template refactoring to use twig --- templates/layouts/app.twig | 56 +++++++--------------------- templates/layouts/parts/footer.twig | 36 ++++++++++++++++++ templates/layouts/parts/navbar.twig | 74 +++++++++++++++++++++++++++++++++++++ 3 files changed, 123 insertions(+), 43 deletions(-) create mode 100644 templates/layouts/parts/footer.twig create mode 100644 templates/layouts/parts/navbar.twig (limited to 'templates/layouts') diff --git a/templates/layouts/app.twig b/templates/layouts/app.twig index 42d5610c..20ea853b 100644 --- a/templates/layouts/app.twig +++ b/templates/layouts/app.twig @@ -11,59 +11,29 @@ - {% if atom_feed -%} - + {% if page() in ['news', 'user-meetings', '/'] and is_user() -%} + {% set parameters = {'key': user.api_key} -%} + {% if page() == 'user-meetings' -%} + {% set parameters = parameters|merge({'meetings': 1}) -%} + {% endif %} + {% endif %} {% endblock %} {% block body %} - + {% block header %} + {% include "layouts/parts/navbar.twig" %} + {% endblock %}
-
{% block content %}{{ content|raw }}{% endblock %}
+
+ {% block content %}{{ content|raw }}{% endblock %} +
diff --git a/templates/layouts/parts/footer.twig b/templates/layouts/parts/footer.twig new file mode 100644 index 00000000..e986963a --- /dev/null +++ b/templates/layouts/parts/footer.twig @@ -0,0 +1,36 @@ +
+
+ +
diff --git a/templates/layouts/parts/navbar.twig b/templates/layouts/parts/navbar.twig new file mode 100644 index 00000000..a718fc48 --- /dev/null +++ b/templates/layouts/parts/navbar.twig @@ -0,0 +1,74 @@ +{% import _self as elements %} + +{% macro toolbar_item(label, link, active_page, icon) %} + + + {% if icon %}{% endif %} + {{ label|raw }} + + +{% endmacro %} + + -- cgit v1.2.3-54-g00ecf