From 94edea2263cd34fa75a716e67599b5f2fabcb98f Mon Sep 17 00:00:00 2001 From: Tim Fechner <tim.fechner@hs-hannover.de> Date: Wed, 22 Nov 2017 09:38:16 +0100 Subject: [PATCH] Cleanup include templates --- .../hshassets/includes/default_footer.html | 45 +++++++++++++++++++ .../{misc => includes}/default_imprint.html | 2 +- .../hshassets/includes/nav_auth_buttons.html | 7 +++ .../templates/hshassets/layout/hero.html | 37 +-------------- 4 files changed, 54 insertions(+), 37 deletions(-) create mode 100644 hshassets/templates/hshassets/includes/default_footer.html rename hshassets/templates/hshassets/{misc => includes}/default_imprint.html (97%) diff --git a/hshassets/templates/hshassets/includes/default_footer.html b/hshassets/templates/hshassets/includes/default_footer.html new file mode 100644 index 00000000..b291f79b --- /dev/null +++ b/hshassets/templates/hshassets/includes/default_footer.html @@ -0,0 +1,45 @@ +{% load i18n %} + +{% comment %} + This template provides an default footer for general sites. + + Please note that this template should be used via {% include "" %}, not {% extends "" %}! + This way you can specify your own navigation or hero text or general content stuff. +{% endcomment %} + +<div class="columns is-desktop"> + <div class="column is-narrow has-text-centered-touch"> + {% block footer-left %} + <p> + <span class="icon is-small"><i class="fa fa-book"></i></span> + <a href="https://service.it.hs-hannover.de/impressum/">{% trans "Impressum" %}</a> + </p> + <p> + <span class="icon is-small"><i class="fa fa-eye-slash"></i></span> + <a href="https://service.it.hs-hannover.de/privacy/">{% trans "Privacy" %}</a> + </p> + {% endblock %} + </div> + <div class="column"> + {# desktop: just eat the free space in the middle #} + {# touch: draw a delimeter #} + <div class="is-hidden-desktop"><hr/></div> + </div> + <div class="column is-narrow has-text-centered-touch"> + {% block footer-right %} + <p><b>Hochschule Hannover</b></p> + <p> + <abbr title="{% trans "Phone" %}"><span class="icon is-small"><i class="fa fa-phone"></i></span></abbr> + <a href="tel:+4951192961441">+49 511 9296 1441</a> + </p> + <p> + <abbr title="{% trans "Email" %}"><span class="icon is-small"><i class="fa fa-envelope"></i></span></abbr> + <a href="mailto:support-it@hs-hannover.de">support-it@hs-hannover.de</a> + </p> + <p> + <abbr title="{% trans "Web" %}"><span class="icon is-small"><i class="fa fa-globe"></i></span></abbr> + <a href="https://www.hs-hannover.de/it">https://hs-hannover.de/it</a> + </p> + {% endblock %} + </div> +</div> diff --git a/hshassets/templates/hshassets/misc/default_imprint.html b/hshassets/templates/hshassets/includes/default_imprint.html similarity index 97% rename from hshassets/templates/hshassets/misc/default_imprint.html rename to hshassets/templates/hshassets/includes/default_imprint.html index 2d87ec45..5ec2b93c 100644 --- a/hshassets/templates/hshassets/misc/default_imprint.html +++ b/hshassets/templates/hshassets/includes/default_imprint.html @@ -2,7 +2,7 @@ This template provides an default imprint for general sites. Please note that this template should be used via {% include "" %}, not {% extends "" %}! - This way you can specify your own navigation or hero text + This way you can specify your own navigation or hero text or general content stuff. {% endcomment %} <div class="columns"> diff --git a/hshassets/templates/hshassets/includes/nav_auth_buttons.html b/hshassets/templates/hshassets/includes/nav_auth_buttons.html index 18d11a8a..9fbd73c2 100644 --- a/hshassets/templates/hshassets/includes/nav_auth_buttons.html +++ b/hshassets/templates/hshassets/includes/nav_auth_buttons.html @@ -1,5 +1,12 @@ {% load i18n %} +{% comment %} + This template provides a login / logout button for the top-right navigation for the hero / hero_keyvisual template. + + Please note that this template should be used via {% include "" %}, not {% extends "" %}! + This way you can specify your own navigation or hero text or general content stuff. +{% endcomment %} + {% if user.is_authenticated %} <span class="nav-item">{% trans "Logged in as" %} {{ user.username }}</span> <span class="nav-item"> diff --git a/hshassets/templates/hshassets/layout/hero.html b/hshassets/templates/hshassets/layout/hero.html index df47c7ae..1c6a29ae 100644 --- a/hshassets/templates/hshassets/layout/hero.html +++ b/hshassets/templates/hshassets/layout/hero.html @@ -74,42 +74,7 @@ <footer class="footer"> <div class="container"> {% block footer %} - <div class="columns is-desktop"> - <div class="column is-narrow has-text-centered-touch"> - {% block footer-left %} - <p> - <span class="icon is-small"><i class="fa fa-book"></i></span> - <a href="https://service.it.hs-hannover.de/impressum/">{% trans "Impressum" %}</a> - </p> - <p> - <span class="icon is-small"><i class="fa fa-eye-slash"></i></span> - <a href="https://service.it.hs-hannover.de/privacy/">{% trans "Privacy" %}</a> - </p> - {% endblock %} - </div> - <div class="column"> - {# desktop: just eat the free space in the middle #} - {# touch: draw a delimeter #} - <div class="is-hidden-desktop"><hr/></div> - </div> - <div class="column is-narrow has-text-centered-touch"> - {% block footer-right %} - <p><b>Hochschule Hannover</b></p> - <p> - <abbr title="{% trans "Phone" %}"><span class="icon is-small"><i class="fa fa-phone"></i></span></abbr> - <a href="tel:+4951192961441">+49 511 9296 1441</a> - </p> - <p> - <abbr title="{% trans "Email" %}"><span class="icon is-small"><i class="fa fa-envelope"></i></span></abbr> - <a href="mailto:support-it@hs-hannover.de">support-it@hs-hannover.de</a> - </p> - <p> - <abbr title="{% trans "Web" %}"><span class="icon is-small"><i class="fa fa-globe"></i></span></abbr> - <a href="https://www.hs-hannover.de/it">https://hs-hannover.de/it</a> - </p> - {% endblock %} - </div> - </div> + {% include "hshassets/includes/default_footer.html" %} {% endblock %} </div> </footer> -- GitLab