Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit b39ba4b3 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Add optional footer argument to base template

parent e8ef15a6
...@@ -84,7 +84,7 @@ let make_login_box style auth links = ...@@ -84,7 +84,7 @@ let make_login_box style auth links =
let links = (module L : AUTH_LINKS) in let links = (module L : AUTH_LINKS) in
fun () -> make_login_box admin_background auth links fun () -> make_login_box admin_background auth links
let base ~title ~login_box ~content = let base ~title ~login_box ~content ?(footer = div []) () =
Lwt.return (html ~a:[a_dir `Ltr; a_xml_lang "en"] Lwt.return (html ~a:[a_dir `Ltr; a_xml_lang "en"]
(head (Eliom_content.Html5.F.title (pcdata title)) [ (head (Eliom_content.Html5.F.title (pcdata title)) [
script (pcdata "window.onbeforeunload = function () {};"); script (pcdata "window.onbeforeunload = function () {};");
...@@ -105,6 +105,7 @@ let make_login_box style auth links = ...@@ -105,6 +105,7 @@ let make_login_box style auth links =
div ~a:[a_id "main"] content; div ~a:[a_id "main"] content;
div ~a:[a_id "footer"; a_style "text-align: center;" ] [ div ~a:[a_id "footer"; a_style "text-align: center;" ] [
div ~a:[a_id "bottom"] [ div ~a:[a_id "bottom"] [
footer;
pcdata "Powered by "; pcdata "Powered by ";
a ~service:source_code [pcdata "Belenios"] (); a ~service:source_code [pcdata "Belenios"] ();
pcdata ". "; pcdata ". ";
...@@ -148,7 +149,7 @@ let make_login_box style auth links = ...@@ -148,7 +149,7 @@ let make_login_box style auth links =
]; ];
] in ] in
let login_box = pcdata "" in let login_box = pcdata "" in
base ~title:site_title ~login_box ~content base ~title:site_title ~login_box ~content ()
let admin ~elections () = let admin ~elections () =
let title = site_title ^ " — Administration" in let title = site_title ^ " — Administration" in
...@@ -166,7 +167,7 @@ let make_login_box style auth links = ...@@ -166,7 +167,7 @@ let make_login_box style auth links =
]; ];
] in ] in
lwt login_box = site_login_box () in lwt login_box = site_login_box () in
base ~title ~login_box ~content base ~title ~login_box ~content ()
module Login (S : AUTH_SERVICES) (L : AUTH_LINKS) : LOGIN_TEMPLATES = struct module Login (S : AUTH_SERVICES) (L : AUTH_LINKS) : LOGIN_TEMPLATES = struct
...@@ -200,7 +201,7 @@ let make_login_box style auth links = ...@@ -200,7 +201,7 @@ let make_login_box style auth links =
form; form;
] in ] in
lwt login_box = login_box () in lwt login_box = login_box () in
base ~title ~login_box ~content base ~title ~login_box ~content ()
let password ~service () = let password ~service () =
let form = post_form ~service let form = post_form ~service
...@@ -225,7 +226,7 @@ let make_login_box style auth links = ...@@ -225,7 +226,7 @@ let make_login_box style auth links =
form; form;
] in ] in
lwt login_box = login_box () in lwt login_box = login_box () in
base ~title:"Password login" ~login_box ~content base ~title:"Password login" ~login_box ~content ()
let upload_password_db ~service () = let upload_password_db ~service () =
let title = "Upload password database" in let title = "Upload password database" in
...@@ -244,7 +245,7 @@ let make_login_box style auth links = ...@@ -244,7 +245,7 @@ let make_login_box style auth links =
div [form]; div [form];
] in ] in
lwt login_box = site_login_box () in lwt login_box = site_login_box () in
base ~title ~login_box ~content base ~title ~login_box ~content ()
let choose () = let choose () =
let auth_systems = let auth_systems =
...@@ -259,7 +260,7 @@ let make_login_box style auth links = ...@@ -259,7 +260,7 @@ let make_login_box style auth links =
)] )]
] in ] in
lwt login_box = login_box () in lwt login_box = login_box () in
base ~title:"Log in" ~login_box ~content base ~title:"Log in" ~login_box ~content ()
end end
...@@ -318,7 +319,7 @@ let make_login_box style auth links = ...@@ -318,7 +319,7 @@ let make_login_box style auth links =
div body; div body;
] in ] in
lwt login_box = site_login_box () in lwt login_box = site_login_box () in
base ~title ~login_box ~content base ~title ~login_box ~content ()
let new_election_failure reason () = let new_election_failure reason () =
let title = "Create new election" in let title = "Create new election" in
...@@ -334,7 +335,7 @@ let make_login_box style auth links = ...@@ -334,7 +335,7 @@ let make_login_box style auth links =
] ]
] in ] in
lwt login_box = site_login_box () in lwt login_box = site_login_box () in
base ~title ~login_box ~content base ~title ~login_box ~content ()
let election_setup_index uuids () = let election_setup_index uuids () =
let service = election_setup in let service = election_setup in
...@@ -353,7 +354,7 @@ let make_login_box style auth links = ...@@ -353,7 +354,7 @@ let make_login_box style auth links =
div [list]; div [list];
] in ] in
lwt login_box = site_login_box () in lwt login_box = site_login_box () in
base ~title ~login_box ~content base ~title ~login_box ~content ()
let generic_error_page message () = let generic_error_page message () =
let title = "Error" in let title = "Error" in
...@@ -361,7 +362,7 @@ let make_login_box style auth links = ...@@ -361,7 +362,7 @@ let make_login_box style auth links =
p [pcdata message]; p [pcdata message];
] in ] in
let login_box = pcdata "" in let login_box = pcdata "" in
base ~title ~login_box ~content base ~title ~login_box ~content ()
let election_setup uuid se () = let election_setup uuid se () =
let title = "Preparation of election " ^ Uuidm.to_string uuid in let title = "Preparation of election " ^ Uuidm.to_string uuid in
...@@ -437,7 +438,7 @@ let make_login_box style auth links = ...@@ -437,7 +438,7 @@ let make_login_box style auth links =
form_create; form_create;
] in ] in
lwt login_box = site_login_box () in lwt login_box = site_login_box () in
base ~title ~login_box ~content base ~title ~login_box ~content ()
let election_setup_questions uuid se () = let election_setup_questions uuid se () =
let title = "Questions for election " ^ Uuidm.to_string uuid in let title = "Questions for election " ^ Uuidm.to_string uuid in
...@@ -456,7 +457,7 @@ let make_login_box style auth links = ...@@ -456,7 +457,7 @@ let make_login_box style auth links =
form; form;
] in ] in
lwt login_box = site_login_box () in lwt login_box = site_login_box () in
base ~title ~login_box ~content base ~title ~login_box ~content ()
let election_setup_credentials token uuid se () = let election_setup_credentials token uuid se () =
let title = "Credentials for election " ^ uuid in let title = "Credentials for election " ^ uuid in
...@@ -523,7 +524,7 @@ let make_login_box style auth links = ...@@ -523,7 +524,7 @@ let make_login_box style auth links =
form_file; form_file;
] in ] in
let login_box = pcdata "" in let login_box = pcdata "" in
base ~title ~login_box ~content base ~title ~login_box ~content ()
let election_setup_trustee token uuid se () = let election_setup_trustee token uuid se () =
let title = "Trustee for election " ^ uuid in let title = "Trustee for election " ^ uuid in
...@@ -569,7 +570,7 @@ let make_login_box style auth links = ...@@ -569,7 +570,7 @@ let make_login_box style auth links =
form; form;
] in ] in
let login_box = pcdata "" in let login_box = pcdata "" in
base ~title ~login_box ~content base ~title ~login_box ~content ()
let election_login_box w = let election_login_box w =
...@@ -717,7 +718,7 @@ let make_login_box style auth links = ...@@ -717,7 +718,7 @@ let make_login_box style auth links =
audit_info; audit_info;
] in ] in
lwt login_box = election_login_box w () in lwt login_box = election_login_box w () in
base ~title:params.e_name ~login_box ~content base ~title:params.e_name ~login_box ~content ()
let election_admin w ~is_featured () = let election_admin w ~is_featured () =
let module W = (val w : WEB_ELECTION_) in let module W = (val w : WEB_ELECTION_) in
...@@ -755,7 +756,7 @@ let make_login_box style auth links = ...@@ -755,7 +756,7 @@ let make_login_box style auth links =
div [state_form]; div [state_form];
] in ] in
lwt login_box = site_login_box () in lwt login_box = site_login_box () in
base ~title ~login_box ~content base ~title ~login_box ~content ()
let update_credential w () = let update_credential w () =
let module W = (val w : WEB_ELECTION_) in let module W = (val w : WEB_ELECTION_) in
...@@ -796,7 +797,7 @@ let make_login_box style auth links = ...@@ -796,7 +797,7 @@ let make_login_box style auth links =
form; form;
] in ] in
lwt login_box = site_login_box () in lwt login_box = site_login_box () in
base ~title:params.e_name ~login_box ~content base ~title:params.e_name ~login_box ~content ()
let cast_raw w () = let cast_raw w () =
let module W = (val w : WEB_ELECTION_) in let module W = (val w : WEB_ELECTION_) in
...@@ -829,7 +830,7 @@ let make_login_box style auth links = ...@@ -829,7 +830,7 @@ let make_login_box style auth links =
form_upload; form_upload;
] in ] in
lwt login_box = election_login_box w () in lwt login_box = election_login_box w () in
base ~title:params.e_name ~login_box ~content base ~title:params.e_name ~login_box ~content ()
let cast_confirmation w ~can_vote hash () = let cast_confirmation w ~can_vote hash () =
let module W = (val w : WEB_ELECTION_) in let module W = (val w : WEB_ELECTION_) in
...@@ -886,7 +887,7 @@ let make_login_box style auth links = ...@@ -886,7 +887,7 @@ let make_login_box style auth links =
]; ];
] in ] in
lwt login_box = election_login_box w () in lwt login_box = election_login_box w () in
base ~title:name ~login_box ~content base ~title:name ~login_box ~content ()
let cast_confirmed w ~result () = let cast_confirmed w ~result () =
let module W = (val w : WEB_ELECTION_) in let module W = (val w : WEB_ELECTION_) in
...@@ -920,7 +921,7 @@ let make_login_box style auth links = ...@@ -920,7 +921,7 @@ let make_login_box style auth links =
]; ];
] in ] in
lwt login_box = election_login_box w () in lwt login_box = election_login_box w () in
base ~title:name ~login_box ~content base ~title:name ~login_box ~content ()
let pretty_ballots w hashes () = let pretty_ballots w hashes () =
let module W = (val w : WEB_ELECTION_) in let module W = (val w : WEB_ELECTION_) in
...@@ -950,4 +951,4 @@ let pretty_ballots w hashes () = ...@@ -950,4 +951,4 @@ let pretty_ballots w hashes () =
links; links;
] in ] in
lwt login_box = election_login_box w () in lwt login_box = election_login_box w () in
base ~title ~login_box ~content base ~title ~login_box ~content ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment