diff --git a/app/__init__.py b/app/__init__.py index 66c6effd1c..738ad09705 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -211,6 +211,12 @@ def create_app(config_class=DevConfig): app.config.from_object(config_class) + # Vérifie/crée lien sym pour les URL statiques + link_filename = f"{app.root_path}/static/links/{sco_version.SCOVERSION}" + if not os.path.exists(link_filename): + app.logger.info(f"creating symlink {link_filename}") + os.symlink("..", link_filename) + db.init_app(app) migrate.init_app(app, db) login.init_app(app) diff --git a/app/comp/moy_mod.py b/app/comp/moy_mod.py index c63394ca9e..aba032fd90 100644 --- a/app/comp/moy_mod.py +++ b/app/comp/moy_mod.py @@ -163,7 +163,8 @@ class ModuleImplResults: ) # Notes en attente: (ne prend en compte que les inscrits, non démissionnaires) nb_att = sum( - evals_notes[str(evaluation.id)][inscrits_module] == scu.NOTES_ATTENTE + evals_notes[str(evaluation.id)][list(inscrits_module)] + == scu.NOTES_ATTENTE ) self.evaluations_etat[evaluation.id] = EvaluationEtat( evaluation_id=evaluation.id, nb_attente=nb_att, is_complete=is_complete diff --git a/app/scodoc/html_sco_header.py b/app/scodoc/html_sco_header.py index 156f5560a6..0b2a3d5870 100644 --- a/app/scodoc/html_sco_header.py +++ b/app/scodoc/html_sco_header.py @@ -59,35 +59,29 @@ BOOTSTRAP_MULTISELECT_CSS = [ def standard_html_header(): """Standard HTML header for pages outside depts""" # not used in ZScolar, see sco_header - return """ + return f""" ScoDoc: accueil - + - + -%s""" % ( - scu.SCO_ENCODING, - scu.CUSTOM_HTML_HEADER_CNX, - ) +{scu.CUSTOM_HTML_HEADER_CNX}""" def standard_html_footer(): """Le pied de page HTML de la page d'accueil.""" - return """ -

Problèmes et suggestions sur le logiciel: %s

+

Problèmes et suggestions sur le logiciel: {scu.SCO_USERS_LIST}

ScoDoc est un logiciel libre développé par Emmanuel Viennet.

-""" % ( - scu.SCO_USERS_LIST, - scu.SCO_USERS_LIST, - ) +""" -_HTML_BEGIN = """ +_HTML_BEGIN = f""" @@ -100,27 +94,27 @@ _HTML_BEGIN = """ %(page_title)s - + - - - - + + + + - - - + + + - + - - + + - - + + """ @@ -193,7 +187,7 @@ def sco_header( # jQuery UI # can modify loaded theme here H.append( - '\n' + f'\n' ) if init_google_maps: # It may be necessary to add an API key: @@ -202,72 +196,65 @@ def sco_header( # Feuilles de style additionnelles: for cssstyle in cssstyles: H.append( - """\n""" - % cssstyle + f"""\n""" ) H.append( - """ - - - + f""" + + + - - + + """ - % params ) # jQuery H.append( - """ - """ + f""" + """ ) - H.append('') # qTip if init_qtip: H.append( - '' - ) - H.append( - '' + f""" + """ ) H.append( - '' + f""" + """ ) - - H.append('') if init_google_maps: H.append( - '' + f'' ) if init_datatables: H.append( - '' + f""" + """ ) - H.append('') # H.append( - # '' + # f'' # ) # JS additionels for js in javascripts: - H.append("""\n""" % js) + H.append(f"""\n""") H.append( - """ """ - % params ) # Scripts de la page: if scripts: @@ -296,12 +283,11 @@ def sco_header( if user_check: if current_user.passwd_temp: H.append( - """
+ f"""
Attention !
Vous avez reçu un mot de passe temporaire.
- Vous devez le changer: cliquez ici + Vous devez le changer: cliquez ici
""" - % (scu.UsersURL, current_user.user_name) ) # if head_message: @@ -330,6 +316,6 @@ def html_sem_header( else: h = "" if with_h2: - return h + """

%s

""" % (title) + return h + f"""

{title}

""" else: return h diff --git a/app/scodoc/sco_trombino.py b/app/scodoc/sco_trombino.py index 9534cfb29d..a8a96a43ca 100644 --- a/app/scodoc/sco_trombino.py +++ b/app/scodoc/sco_trombino.py @@ -151,10 +151,8 @@ def trombino_html(groups_infos): if sco_photos.etud_photo_is_local(t, size="small"): foto = sco_photos.etud_photo_html(t, title="") else: # la photo n'est pas immédiatement dispo - foto = ( - 'en cours' - % t["etudid"] - ) + foto = f"""en cours""" H.append( '%s' % ( diff --git a/app/scodoc/sco_utils.py b/app/scodoc/sco_utils.py index 924d59db1e..9207aa7b7f 100644 --- a/app/scodoc/sco_utils.py +++ b/app/scodoc/sco_utils.py @@ -63,6 +63,8 @@ from app.scodoc import sco_exceptions from app.scodoc import sco_xml import sco_version +# le répertoire static, lié à chaque release pour éviter les problèmes de caches +STATIC_DIR = "/ScoDoc/static/links/" + sco_version.SCOVERSION # ----- CALCUL ET PRESENTATION DES NOTES NOTES_PRECISION = 1e-4 # evite eventuelles erreurs d'arrondis @@ -957,12 +959,7 @@ def icontag(name, file_format="png", no_size=False, **attrs): if "alt" not in attrs: attrs["alt"] = "logo %s" % name s = " ".join(['%s="%s"' % (k, attrs[k]) for k in attrs]) - return '' % ( - name, - s, - name, - file_format, - ) + return f'' ICON_PDF = icontag("pdficon16x20_img", title="Version PDF") diff --git a/app/templates/but/bulletin.html b/app/templates/but/bulletin.html index 8c260e600d..8b133ce93b 100644 --- a/app/templates/but/bulletin.html +++ b/app/templates/but/bulletin.html @@ -10,7 +10,7 @@ {% include 'bul_head.html' %} - + {% include 'bul_foot.html' %} diff --git a/app/templates/but/refcomp_show.html b/app/templates/but/refcomp_show.html index 0e4ffef688..62b3a01544 100644 --- a/app/templates/but/refcomp_show.html +++ b/app/templates/but/refcomp_show.html @@ -10,7 +10,7 @@ - +
Référentiel chargé le {{ref.scodoc_date_loaded.strftime("%d/%m/%Y à %H:%M") if ref.scodoc_date_loaded else ""}} à diff --git a/app/templates/sco_page.html b/app/templates/sco_page.html index f1590302a1..e55c5627e0 100644 --- a/app/templates/sco_page.html +++ b/app/templates/sco_page.html @@ -4,13 +4,14 @@ {% block styles %} {{super()}} - - - - -{# #} - + href="{{sco.scu.STATIC_DIR}}/libjs/jquery-ui-1.10.4.custom/css/smoothness/jquery-ui-1.10.4.custom.min.css" /> + + + + +{# + #} + {% endblock %} {% block title %} @@ -25,9 +26,9 @@
{% with messages = get_flashed_messages(with_categories=true) %} - {% for category, message in messages %} - - {% endfor %} + {% for category, message in messages %} + + {% endfor %} {% endwith %}
{% if sco.sem %} @@ -46,16 +47,16 @@ {{ super() }} {{ moment.include_moment() }} {{ moment.lang(g.locale) }} - - - - - - - + + + + + + + - - + +