Commit d6d8fe47 authored by Stephane Glondu's avatar Stephane Glondu

New experimental booth

parent 48f77bf8
......@@ -2,4 +2,5 @@
<src/platform/native/*>: package(zarith), package(calendar), package(cryptokit)
<src/web/*.{ml,mli,byte,native,odoc}>: thread, package(eliom.server), syntax(camlp4o), package(lwt.syntax), package(csv)
<src/tool/tool_cmdline.*>: package(zarith), package(calendar), package(cryptokit), package(cmdliner), use_platform-native
<src/tool/tool_js.*> or <src/platform/js/*>: package(js_of_ocaml), syntax(camlp4o), package(js_of_ocaml.syntax), use_platform-js
<src/tool/tool_js.*> or <src/platform/js/*> or <src/booth/*>: package(js_of_ocaml), syntax(camlp4o), package(js_of_ocaml.syntax), use_platform-js
<src/booth/*>: package(lwt.syntax)
......@@ -2,3 +2,4 @@ minimal.otarget
src/lib/lib.cma
src/web/server.cma
src/tool/belenios-tool.html.otarget
src/booth/vote.html.otarget
......@@ -86,6 +86,7 @@ let () = dispatch & function
Pathname.define_context "src/web" ["src/lib"];
Pathname.define_context "src/tool" ["src/lib"];
Pathname.define_context "src/booth" ["src/lib"];
Pathname.define_context "demo" ["src/lib"];
Pathname.define_context "stuff" ["src/lib"];
Pathname.define_context "." ["src/lib"];
......@@ -112,6 +113,8 @@ let () = dispatch & function
copy_rule "belenios-tool" ("src/tool/tool_cmdline" ^ exe_suffix) "belenios-tool";
List.iter (copy_ext_js_rule "src/tool") ["jsbn.js"; "jsbn2.js"; "sjcl.js"];
List.iter (copy_ext_js_rule "src/booth") ["jsbn.js"; "jsbn2.js"; "sjcl.js"];
copy_platform_js_rule "src/tool" "random.js";
copy_platform_js_rule "src/booth" "random.js";
| _ -> ()
This diff is collapsed.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Belenios Booth</title>
<script src="sjcl.js"></script>
<script src="jsbn.js"></script>
<script src="jsbn2.js"></script>
<script src="random.js"></script>
<script src="booth.js"></script>
</head>
<body>
<div id="election_loader" style="display:none;">
<h1>Election loader</h1>
Election parameters:
<div><textarea id="election_params" rows="1" cols="80"></textarea></div>
<div><button id="load_election">Load election</button></div>
</div>
<div id="booth_div" style="display:none;">
<div align="center">
<h1 id="election_name"></h1>
<p id="election_description"></p>
<div>
<div>Election UUID: <span id="election_uuid"></span></div>
<div>Election Fingerprint: <span id="election_fingerprint"></span></div>
</div>
</div>
<div id="intro">
<p>To cast a vote, you will be led through the following steps. If you have not yet logged in, you will be asked to do so at the very end of the process.</p>
<ol>
<li><b>Enter</b> your credential.</li>
<li>
<b>Select</b> your options.
<div>Answer the questions, and review your choices.</div>
</li>
<li>
<b>Encrypt</b> your selection.
<div>Your selection is encrypted safely inside your browser.</div>
<div>A smart ballot tracker is given to let you track your ballot.</div>
</li>
<li>
<b>Submit</b> your encrypted ballot.
<div>Proceed to log in and cast your encrypted ballot for tallying.</div>
</li>
</ol>
</div>
<div id="question_div"></div>
<div id="plaintext_div" style="display:none;">
<h2>Review your ballot</h2>
<div id="pretty_choices"></div>
<div style="display:none;">
Plaintext raw ballot:
<div><textarea id="choices" rows="1" cols="80" readonly="readonly"></textarea></div>
</div>
<div><button id="encrypt">Confirm and encrypt</button></div>
<div id="ballot_div" style="display:none;">
<form id="ballot_form" method="POST">
<div style="display:none;">
Encrypted ballot:
<div>
<textarea id="ballot" rows="1" cols="80" name="encrypted_vote" readonly="readonly"></textarea>
</div>
</div>
<p>
Your ballot has been successfully encrypted!
Your smart ballot tracker is <span id="ballot_tracker"></span>.
Refresh this page to start again from the beginning.
</p>
<input type="submit" value="Submit"/>
</form>
</div>
</div>
</div>
</body>
</html>
sjcl.js
jsbn.js
jsbn2.js
random.js
booth.js
vote.html
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