Commit 0cfbc072 authored by Stephane Glondu's avatar Stephane Glondu

Add election link to credential management page

parent 5c8041b5
......@@ -715,6 +715,10 @@ let () =
(fun token () ->
let%lwt uuid = Ocsipersist.find election_credtokens token in
let%lwt se = get_setup_election uuid in
let uuid = match Uuidm.of_string uuid with
| None -> failwith "invalid UUID extracted from credtokens"
| Some u -> u
in
T.election_setup_credentials token uuid se ()
)
......
......@@ -771,6 +771,15 @@ let election_setup_voters uuid se () =
let election_setup_credentials token uuid se () =
let title = "Credentials 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_textarea =
post_form
~service:election_setup_credentials_post
......@@ -811,7 +820,7 @@ let election_setup_credentials token uuid se () =
~a:[a_style "display:none;"]
[
div [pcdata "UUID:"];
div [textarea ~a:[a_id "uuid"; a_rows 1; a_cols 40; a_readonly `ReadOnly] ~name ~value:uuid ()];
div [textarea ~a:[a_id "uuid"; a_rows 1; a_cols 40; a_readonly `ReadOnly] ~name ~value:(Uuidm.to_string uuid) ()];
div [pcdata "Group parameters:"];
div [textarea ~a:[a_id "group"; a_rows 5; a_cols 40; a_readonly `ReadOnly] ~name ~value ()];
]
......@@ -843,6 +852,7 @@ let election_setup_credentials token uuid se () =
]
) else (
[
div_link;
div_download;
div_textarea;
form_file;
......
......@@ -41,7 +41,7 @@ val election_setup : Uuidm.t -> setup_election -> unit -> [> `Html ] Eliom_conte
val election_setup_voters : Uuidm.t -> setup_election -> unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
val election_setup_questions : Uuidm.t -> setup_election -> unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
val election_setup_credential_authority : Uuidm.t -> setup_election -> unit -> [> `Html ] Eliom_content.Html5.F.elt Lwt.t
val election_setup_credentials : string -> string -> 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_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
......
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