From 2e1ec1c5eae726a3da387a736109ef5ef4b4bf0f Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 4 Dec 2021 21:06:32 +0100 Subject: [PATCH] Templates jinja2 pour pages ScoDoc --- app/scodoc/html_sco_header.py | 42 ++++---- app/static/css/scodoc.css | 24 +++-- app/templates/but/refcomp_table.html | 29 ++++-- app/templates/formsemestre_header.html | 35 +++++++ app/templates/sco_page.html | 51 ++++++++++ app/templates/sidebar.html | 98 +++++++++++++++++++ app/views/__init__.py | 59 ++++++++++- app/views/notes.py | 21 +++- app/views/refcomp.py | 19 +++- app/views/scolar.py | 2 +- .../Portail-LeHavre/css/scodoc.css | 2 +- 11 files changed, 332 insertions(+), 50 deletions(-) create mode 100644 app/templates/formsemestre_header.html create mode 100644 app/templates/sco_page.html create mode 100644 app/templates/sidebar.html diff --git a/app/scodoc/html_sco_header.py b/app/scodoc/html_sco_header.py index 0a63d5d1..faf1fcf3 100644 --- a/app/scodoc/html_sco_header.py +++ b/app/scodoc/html_sco_header.py @@ -128,7 +128,7 @@ _HTML_BEGIN = """ def scodoc_top_html_header(page_title="ScoDoc: bienvenue"): H = [ _HTML_BEGIN % {"page_title": page_title, "encoding": scu.SCO_ENCODING}, - """""", + """""", scu.CUSTOM_HTML_HEADER_CNX, ] return "\n".join(H) @@ -143,8 +143,6 @@ def sco_header( javascripts=[], # additionals JS filenames to load scripts=[], # script to put in page header bodyOnLoad="", # JS - init_jquery=True, # load and init jQuery - init_jquery_ui=True, # include all stuff for jquery-ui and initialize scripts init_qtip=False, # include qTip init_google_maps=False, # Google maps init_datatables=True, @@ -179,9 +177,6 @@ def sco_header( else: params["margin_left"] = "140px" - if init_jquery_ui or init_qtip or init_datatables: - init_jquery = True - H = [ """ @@ -194,11 +189,10 @@ def sco_header( % params ] # jQuery UI - if init_jquery_ui: - # can modify loaded theme here - H.append( - '\n' - ) + # can modify loaded theme here + H.append( + '\n' + ) if init_google_maps: # It may be necessary to add an API key: H.append('') @@ -227,12 +221,11 @@ def sco_header( ) # jQuery - if init_jquery: - H.append( - """ - """ - ) - H.append('') + H.append( + """ + """ + ) + H.append('') # qTip if init_qtip: H.append( @@ -242,12 +235,11 @@ def sco_header( '' ) - if init_jquery_ui: - H.append( - '' - ) - # H.append('') - H.append('') + H.append( + '' + ) + + H.append('') if init_google_maps: H.append( '' @@ -263,7 +255,7 @@ def sco_header( H.append( """