diff --git a/app/but/jury_but_pv.py b/app/but/jury_but_pv.py index 78d8d4dea..2940345ed 100644 --- a/app/but/jury_but_pv.py +++ b/app/but/jury_but_pv.py @@ -47,7 +47,7 @@ def pvjury_table_but(formsemestre_id: int, format="html"): title = "Procès-verbal de jury BUT annuel" if format == "html": - line_sep = "
" + line_sep = "
" else: line_sep = "\n" # remplace pour le BUT la fonction sco_pvjury.pvjury_table diff --git a/app/pe/pe_avislatex.py b/app/pe/pe_avislatex.py index fc64253ca..5a5077383 100644 --- a/app/pe/pe_avislatex.py +++ b/app/pe/pe_avislatex.py @@ -253,7 +253,7 @@ def get_annotation_PE(etudid, tag_annotation_pe): ) # Suppression du tag d'annotation PE annotationPE = annotationPE.replace("\r", "") # Suppression des \r annotationPE = annotationPE.replace( - "
", "\n\n" + "
", "\n\n" ) # Interprète les retours chariots html return annotationPE return "" # pas d'annotations diff --git a/app/pe/pe_view.py b/app/pe/pe_view.py index ba129f7b6..06302cd8d 100644 --- a/app/pe/pe_view.py +++ b/app/pe/pe_view.py @@ -55,7 +55,7 @@ def _pe_view_sem_recap_form(formsemestre_id):

Cette fonction génère un ensemble de fichiers permettant d'éditer des avis de poursuites d'études. -
+
De nombreux aspects sont paramétrables: voir la documentation. @@ -65,7 +65,7 @@ def _pe_view_sem_recap_form(formsemestre_id):

Les templates sont généralement installés sur le serveur ou dans le paramétrage de ScoDoc. -
+
Au besoin, vous pouvez spécifier ici votre propre fichier de template (un_avis.tex):
Template: diff --git a/app/scodoc/TrivialFormulator.py b/app/scodoc/TrivialFormulator.py index 0920ab0e5..f3c768a2d 100644 --- a/app/scodoc/TrivialFormulator.py +++ b/app/scodoc/TrivialFormulator.py @@ -38,6 +38,9 @@ def TrivialFormulator( html_foot_markup="", readonly=False, is_submitted=False, + title="", + after_table="", + before_table="{title}", ): """ form_url : URL for this form @@ -74,7 +77,8 @@ def TrivialFormulator( HTML elements: input_type : 'text', 'textarea', 'password', 'radio', 'menu', 'checkbox', - 'hidden', 'separator', 'file', 'date', 'datedmy' (avec validation), + 'hidden', 'separator', 'table_separator', + 'file', 'date', 'datedmy' (avec validation), 'boolcheckbox', 'text_suggest', 'color' (default text) @@ -111,6 +115,9 @@ def TrivialFormulator( html_foot_markup=html_foot_markup, readonly=readonly, is_submitted=is_submitted, + title=title, + after_table=after_table, + before_table=before_table, ) form = t.getform() if t.canceled(): @@ -144,6 +151,9 @@ class TF(object): html_foot_markup="", # html snippet put at the end, just after the table readonly=False, is_submitted=False, + title="", + after_table="", + before_table="{title}", ): self.form_url = form_url self.values = values.copy() @@ -165,6 +175,9 @@ class TF(object): self.top_buttons = top_buttons self.bottom_buttons = bottom_buttons self.html_foot_markup = html_foot_markup + self.title = title + self.after_table = after_table + self.before_table = before_table self.readonly = readonly self.result = None self.is_submitted = is_submitted @@ -426,6 +439,7 @@ class TF(object): R.append('' % self.formid) if self.top_buttons: R.append(buttons_markup + "

") + R.append(self.before_table.format(title=self.title)) R.append('') for field, descr in self.formdescription: if descr.get("readonly", False): @@ -453,6 +467,16 @@ class TF(object): etempl = separatortemplate R.append(etempl % {"label": title, "item_dom_attr": item_dom_attr}) continue + elif input_type == "table_separator": + etempl = "" + # Table ouverte ? + if len([p for p in R if " len( + [p for p in R if "{self.after_table}""") + R.append( + f"""{self.before_table.format(title=descr.get("title", ""))}
""" + ) else: etempl = itemtemplate lab = [] @@ -610,7 +634,7 @@ class TF(object): '' % (field, wid, values[field], attribs) ) - elif input_type == "separator": + elif (input_type == "separator") or (input_type == "table_separator"): pass elif input_type == "file": lem.append( @@ -641,13 +665,15 @@ var {field}_as = new bsn.AutoSuggest('{field}', {field}_opts); ) lem.append(('value="%(' + field + ')s" >') % values) else: - raise ValueError("unkown input_type for form (%s)!" % input_type) + raise ValueError(f"unkown input_type for form ({input_type})!") explanation = descr.get("explanation", "") if explanation: - lem.append('%s' % explanation) + lem.append(f"""{explanation}""") comment = descr.get("comment", "") if comment: - lem.append('
%s' % comment) + if (input_type != "checkbox") and (input_type != "boolcheckbox"): + lem.append("
") + lem.append(f"""{comment}""") R.append( etempl % { @@ -657,11 +683,11 @@ var {field}_as = new bsn.AutoSuggest('{field}', {field}_opts); } ) R.append("
") - + R.append(self.after_table) R.append(self.html_foot_markup) if self.bottom_buttons: - R.append("
" + buttons_markup) + R.append("
" + buttons_markup) if add_no_enter_js: R.append( @@ -753,7 +779,7 @@ var {field}_as = new bsn.AutoSuggest('{field}', {field}_opts); if input_type == "separator": # separator R.append('%s' % title) - else: + elif input_type != "table_separator": R.append('' % klass) R.append("%s" % title) R.append('' % klass) @@ -786,7 +812,11 @@ var {field}_as = new bsn.AutoSuggest('{field}', {field}_opts); R.append( '
%s
' % html.escape(self.values[field]) ) - elif input_type == "separator" or input_type == "hidden": + elif ( + input_type == "separator" + or input_type == "hidden" + or input_type == "table_separator" + ): pass elif input_type == "file": R.append("'%s'" % self.values[field]) diff --git a/app/scodoc/html_sco_header.py b/app/scodoc/html_sco_header.py index 0b2a3d587..409e4d134 100644 --- a/app/scodoc/html_sco_header.py +++ b/app/scodoc/html_sco_header.py @@ -284,8 +284,8 @@ def sco_header( if current_user.passwd_temp: H.append( f"""
- Attention !
- Vous avez reçu un mot de passe temporaire.
+ Attention !
+ Vous avez reçu un mot de passe temporaire.
Vous devez le changer: cliquez ici
""" ) diff --git a/app/scodoc/html_sidebar.py b/app/scodoc/html_sidebar.py index 5b578d68c..45497ff2b 100644 --- a/app/scodoc/html_sidebar.py +++ b/app/scodoc/html_sidebar.py @@ -48,26 +48,26 @@ def sidebar_common(): url_for("users.user_info_page", scodoc_dept=g.scodoc_dept, user_name=current_user.user_name) }">{current_user.user_name} -
déconnexion +
déconnexion
{sidebar_dept()}

Scolarité

- Semestres
- Programmes
- Absences
+ Semestres
+ Programmes
+ Absences
""" ] if current_user.has_permission( Permission.ScoUsersAdmin ) or current_user.has_permission(Permission.ScoUsersView): H.append( - f"""Utilisateurs
""" + f"""Utilisateurs
""" ) if current_user.has_permission(Permission.ScoChangePreferences): H.append( f"""Paramétrage
""" + class="sidebar">Paramétrage
""" ) return "".join(H) @@ -84,7 +84,7 @@ def sidebar(etudid: int = None): H = [ f"""