Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

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

Remove occurrences of Obj.magic

parent 71dae6f4
...@@ -930,6 +930,11 @@ let election_setup_voters uuid se maxvoters () = ...@@ -930,6 +930,11 @@ let election_setup_voters uuid se maxvoters () =
let%lwt login_box = site_login_box () in let%lwt login_box = site_login_box () in
base ~title ?login_box ~content () base ~title ?login_box ~content ()
let unsafe_textarea id contents =
Printf.ksprintf Unsafe.data
"<textarea id=\"%s\">%s</textarea>"
id contents
let election_setup_credentials token uuid se () = let election_setup_credentials token uuid se () =
let title = "Credentials for election " ^ se.se_questions.t_name in let title = "Credentials for election " ^ se.se_questions.t_name in
let div_link = let div_link =
...@@ -975,23 +980,20 @@ let election_setup_credentials token uuid se () = ...@@ -975,23 +980,20 @@ let election_setup_credentials token uuid se () =
token] token]
in in
let group = let group =
let name : 'a Eliom_parameter.param_name = Obj.magic "group" in
let value = se.se_group in
div div
~a:[a_style "display:none;"] ~a:[a_style "display:none;"]
[ [
div [pcdata "UUID:"]; div [pcdata "UUID:"];
div [textarea ~a:[a_id "uuid"; a_rows 1; a_cols 40; a_readonly `ReadOnly] ~name ~value:(Uuidm.to_string uuid) ()]; div [unsafe_textarea "uuid" (Uuidm.to_string uuid)];
div [pcdata "Group parameters:"]; div [pcdata "Group parameters:"];
div [textarea ~a:[a_id "group"; a_rows 5; a_cols 40; a_readonly `ReadOnly] ~name ~value ()]; div [unsafe_textarea "group" se.se_group];
] ]
in in
let voters = let voters =
let name : 'a Eliom_parameter.param_name = Obj.magic "voters" in
let value = String.concat "\n" (List.map (fun x -> x.sv_id) se.se_voters) in let value = String.concat "\n" (List.map (fun x -> x.sv_id) se.se_voters) in
div [ div [
div [pcdata "List of voters:"]; div [pcdata "List of voters:"];
div [textarea ~a:[a_id "voters"; a_rows 5; a_cols 40; a_readonly `ReadOnly] ~name ~value ()]; div [unsafe_textarea "voters" value];
] ]
in in
let interactivity = let interactivity =
...@@ -1049,13 +1051,11 @@ let election_setup_trustee token uuid se () = ...@@ -1049,13 +1051,11 @@ let election_setup_trustee token uuid se () =
) () ) ()
in in
let group = let group =
let name : 'a Eliom_parameter.param_name = Obj.magic "group" in
let value = se.se_group in
div div
~a:[a_style "display:none;"] ~a:[a_style "display:none;"]
[ [
div [pcdata "Group parameters:"]; div [pcdata "Group parameters:"];
div [textarea ~a:[a_id "group"; a_rows 5; a_cols 40; a_readonly `ReadOnly] ~name ~value ()]; div [unsafe_textarea "group" se.se_group];
] ]
in in
let interactivity = let interactivity =
...@@ -1077,11 +1077,6 @@ let election_setup_trustee token uuid se () = ...@@ -1077,11 +1077,6 @@ let election_setup_trustee token uuid se () =
] in ] in
base ~title ~content () base ~title ~content ()
let unsafe_textarea id contents =
Printf.ksprintf Unsafe.data
"<textarea id=\"%s\">%s</textarea>"
id contents
let election_setup_threshold_trustee token uuid se () = let election_setup_threshold_trustee token uuid se () =
let title = "Trustee for election " ^ se.se_questions.t_name in let title = "Trustee for election " ^ se.se_questions.t_name in
let div_link = let div_link =
...@@ -2194,18 +2189,14 @@ let booth () = ...@@ -2194,18 +2189,14 @@ let booth () =
script ~a:[a_src (uri_of_string (fun () -> "/static/booth.js"))] (pcdata ""); script ~a:[a_src (uri_of_string (fun () -> "/static/booth.js"))] (pcdata "");
] in ] in
let election_loader = let election_loader =
let name : 'a Eliom_parameter.param_name = Obj.magic "election_params" in
div ~a:[a_id "election_loader"; a_style "display:none;"] [ div ~a:[a_id "election_loader"; a_style "display:none;"] [
h1 [pcdata "Election loader"]; h1 [pcdata "Election loader"];
pcdata "Election parameters:"; pcdata "Election parameters:";
div [textarea ~name ~a:[a_id "election_params"; a_rows 1; a_cols 80] ()]; div [unsafe_textarea "election_params" ""];
div [button ~button_type:`Button ~a:[a_id "load_election"] [pcdata "Load election"]]; div [button ~button_type:`Button ~a:[a_id "load_election"] [pcdata "Load election"]];
] ]
in in
let text_choices = let text_choices = unsafe_textarea "choices" "" in
let name : 'a Eliom_parameter.param_name = Obj.magic "choices" in
textarea ~name ~a:[a_id "choices"; a_rows 1; a_cols 80; a_readonly `ReadOnly] ()
in
let ballot_form = let ballot_form =
post_form ~a:[a_id "ballot_form"] ~service:election_cast_post post_form ~a:[a_id "ballot_form"] ~service:election_cast_post
(fun (encrypted_vote, _) -> [ (fun (encrypted_vote, _) -> [
......
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