Commit 91d195e1 authored by Stephane Glondu's avatar Stephane Glondu

Remove short_name field of elections and templates

parent 4c4e5a60
......@@ -78,7 +78,6 @@ type 'a params = {
public_key : 'a;
questions : question list <ocaml repr="array">;
uuid : uuid;
short_name : string;
} <ocaml field_prefix="e_">
<doc text="Election parameters relevant for creating a ballot.">
......@@ -86,7 +85,6 @@ type template = {
description : string;
name : string;
questions : question list <ocaml repr="array">;
short_name : string;
} <ocaml field_prefix="t_">
<doc text="Election template.">
......
......@@ -62,7 +62,6 @@ let extractQuestion q =
let extractTemplate () =
let t_name = get_input "election_name" in
let t_short_name = get_input "election_short_name" in
let t_description = get_textarea "election_description" in
let questions = document##querySelectorAll (Js.string ".question_question") in
let t_questions =
......@@ -72,7 +71,7 @@ let extractTemplate () =
let q = questions##item (i) >>= extractQuestion in
Js.Opt.get q (fun () -> failwith "extractTemplate"))
in
{t_name; t_short_name; t_description; t_questions}
{t_name; t_description; t_questions}
(* Injecting the OCaml structure into the DOM *)
......@@ -170,16 +169,6 @@ let createTemplate template =
h_name##value <- Js.string template.t_name;
Dom.appendChild x h_name;
Dom.appendChild container x;
(* short name *)
let x = Dom_html.createDiv document in
x##style##display <- Js.string "none";
let t = document##createTextNode (Js.string "Short name: ") in
Dom.appendChild x t;
let h_short_name = Dom_html.createInput document in
h_short_name##id <- Js.string "election_short_name";
h_short_name##value <- Js.string template.t_short_name;
Dom.appendChild x h_short_name;
Dom.appendChild container x;
(* description *)
let x = Dom_html.createDiv document in
x##style##display <- Js.string "none";
......
......@@ -83,7 +83,6 @@ module Make (P : PARSED_PARAMS) : S = struct
e_public_key = {wpk_group = G.group; wpk_y = y};
e_questions = template.t_questions;
e_uuid = uuid;
e_short_name = template.t_short_name;
}
(* Generate and serialize election.json *)
......
......@@ -131,7 +131,6 @@ let finalize_election uuid se =
e_public_key = {wpk_group = G.group; wpk_y = y};
e_questions = template.t_questions;
e_uuid = uuid;
e_short_name = template.t_short_name;
} in
let raw_election = string_of_params (write_wrapped_pubkey G.write_group G.write) params in
(* write election files to disk *)
......@@ -340,7 +339,6 @@ let create_new_election owner cred auth =
t_description = "Description of the election.";
t_name = "Name of the election";
t_questions = [| question |];
t_short_name = "short_name";
} in
let se = {
se_owner = owner;
......
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