Commit 5cbba460 authored by Stephane Glondu's avatar Stephane Glondu

Check that name and description have been edited before validation

parent 872bbdb5
......@@ -297,6 +297,9 @@ let default_questions =
in
[| question |]
let default_name = "Name of the election"
let default_description = "Description of the election."
let default_creation_date = datetime_of_string "\"2018-06-06 00:00:00.000000\""
let default_validation_date = datetime_of_string "\"2015-10-01 00:00:00.000000\""
let default_tally_date = datetime_of_string "\"2018-06-06 00:00:00.000000\""
......
......@@ -112,6 +112,8 @@ val write_file : ?uuid:uuid -> string -> string list -> unit Lwt.t
val default_contact : string
val default_questions : question array
val default_name : string
val default_description : string
val default_creation_date : datetime
val default_validation_date : datetime
......
......@@ -513,8 +513,8 @@ let create_new_election owner cred auth =
e_server_is_trustee = None;
} in
let se_questions = {
t_description = "Description of the election.";
t_name = "Name of the election";
t_description = default_description;
t_name = default_name;
t_questions = default_questions;
} in
let se = {
......
......@@ -1387,11 +1387,24 @@ let election_draft_import_trustees uuid se elections =
let election_draft_confirm uuid se () =
let title = "Election " ^ se.se_questions.t_name ^ " — Validate creation" in
let ready = true in
let ready, name =
if se.se_questions.t_name = default_name then
false, "Not edited"
else
ready, "OK"
in
let ready, description =
if se.se_questions.t_description = default_description then
false, "Not edited"
else
ready, "OK"
in
let ready, questions =
if se.se_questions.t_questions = default_questions then
false, "Not edited"
else
true, "OK"
ready, "OK"
in
let ready, voters =
ready && not (se.se_voters = []),
......@@ -1446,6 +1459,14 @@ let election_draft_confirm uuid se () =
| Some _ -> "Yes", pcdata ""
in
let table_checklist = table [
tr [
td [pcdata "Name?"];
td [pcdata name];
];
tr [
td [pcdata "Description?"];
td [pcdata description];
];
tr [
td [pcdata "Questions?"];
td [pcdata questions];
......
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