Commit c502ebd4 authored by Stephane Glondu's avatar Stephane Glondu

Add a link to the election to the trustee page

parent 0cfbc072
......@@ -853,7 +853,11 @@ let () =
(fun token () ->
let%lwt uuid = Ocsipersist.find election_pktokens token in
let%lwt se = get_setup_election uuid in
T.election_setup_trustee token se ()
let uuid = match Uuidm.of_string uuid with
| None -> failwith "invalid UUID extracted from pktokens"
| Some u -> u
in
T.election_setup_trustee token uuid se ()
)
let () =
......
......@@ -860,8 +860,17 @@ let election_setup_credentials token uuid se () =
) in
base ~title ~content ()
let election_setup_trustee token se () =
let election_setup_trustee token uuid se () =
let title = "Trustee for election " ^ se.se_questions.t_name in
let div_link =
let url = Eliom_uri.make_string_uri ~absolute:true
~service:election_home (uuid, ()) |> rewrite_prefix
in
div [
pcdata "The link to the election will be:";
ul [li [pcdata url]];
]
in
let form =
let trustee = List.find (fun x -> x.st_token = token) se.se_public_keys in
let value = trustee.st_public_key in
......@@ -900,6 +909,7 @@ let election_setup_trustee token se () =
]
in
let content = [
div_link;
group;
interactivity;
form;
......
......@@ -43,7 +43,7 @@ val election_setup_questions : Uuidm.t -> setup_election -> unit -> [> `Html ] E
val election_setup_credential_authority : Uuidm.t -> setup_election -> unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
val election_setup_credentials : string -> Uuidm.t -> setup_election -> unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
val election_setup_trustees : Uuidm.t -> setup_election -> unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
val election_setup_trustee : string -> setup_election -> unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
val election_setup_trustee : string -> Uuidm.t -> setup_election -> unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
val election_setup_import : Uuidm.t -> setup_election -> (module ELECTION_DATA) list * (module ELECTION_DATA) list * (module ELECTION_DATA) list -> unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
val election_setup_import_trustees : Uuidm.t -> setup_election -> (module ELECTION_DATA) list * (module ELECTION_DATA) list * (module ELECTION_DATA) list -> unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
val election_setup_confirm : Uuidm.t -> setup_election -> unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
......
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