Commit 56e8028a authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Remove "start" param of election_pretty_ballots

parent 703eb4ec
......@@ -79,7 +79,7 @@ let election_vote = service ~path:["elections"] ~get_params:(suffix (uuid "uuid"
let election_cast = service ~path:["elections"] ~get_params:(suffix (uuid "uuid" ** suffix_const "cast")) ()
let election_cast_post = post_service ~fallback:election_cast ~post_params:(opt (string "encrypted_vote") ** opt (file "encrypted_vote_file")) ()
let election_cast_confirm = post_coservice ~csrf_safe:true ~fallback:election_cast ~post_params:unit ()
let election_pretty_ballots = service ~path:["elections"] ~get_params:(suffix_prod (uuid "uuid" ** suffix_const "ballots") (int "start")) ()
let election_pretty_ballots = service ~path:["elections"] ~get_params:(suffix (uuid "uuid" ** suffix_const "ballots")) ()
let election_pretty_ballot = service ~path:["elections"] ~get_params:(suffix_prod (uuid "uuid" ** suffix_const "ballot") (string "hash")) ()
let election_missing_voters = service ~path:["elections"] ~get_params:(suffix (uuid "uuid" ** suffix_const "missing")) ()
......
......@@ -1176,20 +1176,14 @@ let () =
let () =
Any.register
~service:election_pretty_ballots
(fun ((uuid, ()), start) () ->
(fun (uuid, ()) () ->
let uuid_s = Uuidm.to_string uuid in
lwt w = find_election uuid_s in
let module W = Web_election.Make ((val w)) (LwtRandom) in
let module B = W.B in
let module W = W.D in
lwt res, _ =
B.Ballots.fold
(fun h _ (accu, i) ->
if i >= start && i < start+1000 then
return (h :: accu, i+1)
else return (accu, i+1)
) ([], 1)
in T.pretty_ballots (module W) res () >>= Html5.send)
lwt res = B.Ballots.fold (fun h _ accu -> return (h :: accu)) [] in
T.pretty_ballots (module W) res () >>= Html5.send)
let () =
Any.register
......
......@@ -946,7 +946,7 @@ let election_home w state () =
~a:[a_style "font-size:25px;"]
~service:election_pretty_ballots [
pcdata "See accepted ballots"
] ((params.e_uuid, ()), 1)
] (params.e_uuid, ())
]
in
let footer = audit_footer w in
......@@ -1330,7 +1330,7 @@ let cast_confirmed w ~result () =
[pcdata " has been accepted, your smart ballot tracker is ";
b [pcdata hash];
pcdata ". You can check its presence in the ";
a ~service:election_pretty_ballots [pcdata "ballot box"] ((params.e_uuid, ()), 1);
a ~service:election_pretty_ballots [pcdata "ballot box"] (params.e_uuid, ());
pcdata " anytime during the election.";
pcdata " A confirmation e-mail has been sent to you.";
], "Thank you for voting!"
......
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