Commit 3748c524 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Properly indent templates.ml

parent 4c5274c4
......@@ -35,7 +35,7 @@ let format_user u =
module Make (S : Web_signatures.ALL_SERVICES) = struct
let base ~title ~content =
let base ~title ~content =
lwt user = S.get_logged_user () in
Lwt.return (html ~a:[a_dir `Ltr; a_xml_lang "en"]
(head (Eliom_content.Html5.F.title (pcdata title)) [])
......@@ -87,7 +87,7 @@ let base ~title ~content =
]
]))
let format_one_featured_election e =
let format_one_featured_election e =
li [
h3 [
a ~service:(S.election_file e Services.ESIndex)
......@@ -96,7 +96,7 @@ let format_one_featured_election e =
p [pcdata e.e_description];
]
let index ~featured =
let index ~featured =
let featured_box = match featured with
| _::_ ->
div [
......@@ -117,7 +117,7 @@ let index ~featured =
] in
base ~title:site_title ~content
let string_login ~kind ~service =
let string_login ~kind ~service =
let title, field_name, input_type = match kind with
| `Dummy -> "Dummy login", "Username:", `Text
| `Admin -> "Admin login", "Admin password:", `Password
......@@ -142,7 +142,7 @@ let string_login ~kind ~service =
] in
base ~title ~content
let password_login ~service =
let password_login ~service =
let form = post_form ~service
(fun (llogin, lpassword) ->
[
......@@ -167,24 +167,24 @@ let password_login ~service =
] in
base ~title:"Password login" ~content
let generic_login () =
let generic_login () =
let content = [
h1 [pcdata "Log in"];
div [p [pcdata "Please choose one authentication system."]];
] in
base ~title:"Log in" ~content
let format_date (date, _) =
let format_date (date, _) =
CalendarLib.Printer.Precise_Fcalendar.sprint "%a, %d %b %Y %T %z" date
let make_button ~service contents =
let make_button ~service contents =
let uri = Eliom_uri.make_string_uri ~service () in
Printf.ksprintf unsafe_data (* FIXME: unsafe *)
"<button onclick=\"location.href='%s';\">%s</button>"
uri
contents
let election_view ~election ~user =
let election_view ~election ~user =
let open Web_election in
let params = election.election.e_params in
let service = S.election_file params Services.ESRaw in
......@@ -270,7 +270,7 @@ let election_view ~election ~user =
] in
base ~title:params.e_name ~content
let election_cast_raw ~election =
let election_cast_raw ~election =
let open Web_election in
let params = election.election.e_params in
let form_rawballot = post_form ~service:S.election_cast_post
......@@ -303,7 +303,7 @@ let election_cast_raw ~election =
] in
base ~title:params.e_name ~content
let ballot_received ~election ~confirm ~user ~can_vote =
let ballot_received ~election ~confirm ~user ~can_vote =
let open Web_election in
let params = election.election.e_params in
let name = params.e_name in
......@@ -345,7 +345,7 @@ let ballot_received ~election ~confirm ~user ~can_vote =
] in
base ~title:name ~content
let do_cast_ballot ~election ~result =
let do_cast_ballot ~election ~result =
let params = election.Web_election.election.e_params in
let name = params.e_name in
let content = [
......@@ -367,7 +367,7 @@ let do_cast_ballot ~election ~result =
] in
base ~title:name ~content
let election_update_credential ~election =
let election_update_credential ~election =
let params = election.Web_election.election.e_params in
let form = post_form ~service:S.election_update_credential
(fun (old, new_) ->
......
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