diff --git a/app/scodoc/gen_tables.py b/app/scodoc/gen_tables.py index fcca48af..078017e8 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 171b694c..2401ee7c 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("""