From 3666f8b1ec69185752624f5ab0a68900715c1370 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 16 Sep 2021 10:09:17 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9liore=20sidebar=20avec=20template=20jin?= =?UTF-8?q?ja?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/html_sidebar.py | 25 ++++++------------------- app/templates/sidebar_dept.html | 12 ++++++++++++ 2 files changed, 18 insertions(+), 19 deletions(-) create mode 100644 app/templates/sidebar_dept.html diff --git a/app/scodoc/html_sidebar.py b/app/scodoc/html_sidebar.py index 8edd0dda..70efb160 100644 --- a/app/scodoc/html_sidebar.py +++ b/app/scodoc/html_sidebar.py @@ -28,9 +28,8 @@ """ Génération de la "sidebar" (marge gauche des pages HTML) """ -from flask import url_for -from flask import g -from flask import request +from flask import render_template, url_for +from flask import g, request from flask_login import current_user import app.scodoc.sco_utils as scu @@ -168,19 +167,7 @@ def sidebar(): def sidebar_dept(): """Partie supérieure de la marge de gauche""" - H = [ - f"""

Dépt. {sco_preferences.get_preference("DeptName")}

-Accueil
""" - ] - dept_intranet_url = sco_preferences.get_preference("DeptIntranetURL") - if dept_intranet_url: - H.append( - f"""{ - sco_preferences.get_preference("DeptIntranetTitle")}
""" - ) - # Entreprises pas encore supporté en ScoDoc8 - # H.append( - # """
Entreprises
""" - # % infos - # ) - return "\n".join(H) + return render_template( + "sidebar_dept.html", + prefs=sco_preferences.SemPreferences(), + ) diff --git a/app/templates/sidebar_dept.html b/app/templates/sidebar_dept.html new file mode 100644 index 00000000..e54cce79 --- /dev/null +++ b/app/templates/sidebar_dept.html @@ -0,0 +1,12 @@ +

Dépt. {{ prefs["DeptName"] }}

+Accueil
+ {% if prefs["DeptIntranetURL"] %} + + {{ prefs["DeptIntranetTitle"] }} + {% endif %} +
+ +{# +# Entreprises pas encore supporté en ScoDoc8 +#
Entreprises
+#} \ No newline at end of file