diff --git a/app/scodoc/gen_tables.py b/app/scodoc/gen_tables.py index fcca48af0..078017e8c 100644 --- a/app/scodoc/gen_tables.py +++ b/app/scodoc/gen_tables.py @@ -639,7 +639,7 @@ class GenTable(object): H.append(html_title) H.append(self.html()) if with_html_headers: - H.append(html_sco_header.sco_footer(context, REQUEST)) + H.append(html_sco_header.sco_footer()) return "\n".join(H) elif format == "pdf": objects = self.pdf() @@ -700,7 +700,7 @@ class SeqGenTable(object): # ----- Exemple d'utilisation minimal. if __name__ == "__main__": - T = gen_tables.GenTable( + T = GenTable( rows=[{"nom": "Hélène", "age": 26}, {"nom": "Titi&çà§", "age": 21}], columns_ids=("nom", "age"), ) @@ -715,7 +715,7 @@ if __name__ == "__main__": from reportlab.platypus import KeepInFrame from app.scodoc import sco_preferences, sco_pdf - preferences = sco_preferences.SemPreferences(None) + preferences = sco_preferences.SemPreferences() T.preferences = preferences objects = T.gen(format="pdf") objects = [KeepInFrame(0, 0, objects, mode="shrink")] diff --git a/app/scodoc/html_sco_header.py b/app/scodoc/html_sco_header.py index 171b694c5..2401ee7cb 100644 --- a/app/scodoc/html_sco_header.py +++ b/app/scodoc/html_sco_header.py @@ -28,7 +28,7 @@ """HTML Header/Footer for ScoDoc pages """ -import cgi +import html from flask_login import current_user @@ -124,9 +124,9 @@ _HTML_BEGIN = """ """ -def scodoc_top_html_header(context, REQUEST, page_title="ScoDoc"): +def scodoc_top_html_header(page_title="ScoDoc: bienvenue"): H = [ - _HTML_BEGIN % {"page_title": "ScoDoc: bienvenue", "encoding": scu.SCO_ENCODING}, + _HTML_BEGIN % {"page_title": page_title, "encoding": scu.SCO_ENCODING}, _TOP_LEVEL_CSS, """""", scu.CUSTOM_HTML_HEADER_CNX, @@ -158,9 +158,8 @@ def sco_header( "Main HTML page header for ScoDoc" from app.scodoc.sco_formsemestre_status import formsemestre_page_title + context = None # XXX TODO à enlever #context # context est une instance de ZScolar. container est une instance qui "acquiert" ZScolar - if container: - context = container # je pense que cela suffit pour ce qu'on veut. # Add a HTTP header (can be used by Apache to log requests) if REQUEST.AUTHENTICATED_USER: @@ -308,7 +307,7 @@ def sco_header( H.append(scu.CUSTOM_HTML_HEADER) # if not no_side_bar: - H.append(html_sidebar.sidebar(context, REQUEST)) + H.append(html_sidebar.sidebar(REQUEST)) H.append("""
""") # # Barre menu semestre: @@ -327,7 +326,7 @@ def sco_header( ) # if head_message: - H.append('
' + cgi.escape(head_message) + "
") + H.append('
' + html.escape(head_message) + "
") # # div pour affichage messages temporaires H.append('
') @@ -335,7 +334,7 @@ def sco_header( return "".join(H) -def sco_footer(context, REQUEST=None): +def sco_footer(): """Main HTMl pages footer""" return ( """
""" + scu.CUSTOM_HTML_FOOTER + """""" diff --git a/app/scodoc/html_sidebar.py b/app/scodoc/html_sidebar.py index c041c6933..a172df4f0 100644 --- a/app/scodoc/html_sidebar.py +++ b/app/scodoc/html_sidebar.py @@ -35,7 +35,7 @@ from app.scodoc import sco_preferences from app.scodoc.sco_permissions import Permission -def sidebar_common(context, REQUEST=None): +def sidebar_common(REQUEST=None): "partie commune à toutes les sidebar" authuser = REQUEST.AUTHENTICATED_USER params = { @@ -50,7 +50,7 @@ def sidebar_common(context, REQUEST=None): 'ScoDoc 8', '
%(authuser)s
déconnexion
' % params, - sidebar_dept(context, REQUEST), + sidebar_dept(REQUEST), """

Scolarité

Semestres
Programmes
@@ -75,7 +75,7 @@ def sidebar_common(context, REQUEST=None): return "".join(H) -def sidebar(context, REQUEST=None): +def sidebar(REQUEST=None): "Main HTML page sidebar" # rewritten from legacy DTML code from app.scodoc import sco_abs @@ -86,7 +86,7 @@ def sidebar(context, REQUEST=None): "SCO_USER_MANUAL": scu.SCO_USER_MANUAL, } - H = ['