diff --git a/ballot.rb b/ballot.rb --- a/ballot.rb +++ b/ballot.rb @@ -548,6 +548,10 @@ erb :about end + get '/css/base.css' do + send_file 'static/css/base.css' + end + # Blank vote value, so redirect back to the front page get '/vote/?' do redirect '/' diff --git a/static/css/base.css b/static/css/base.css new file mode 100644 --- /dev/null +++ b/static/css/base.css @@ -0,0 +1,111 @@ +/* Custom to ballot.rb */ +.note { + font-weight: 700; + color:#ff7772; /* see txt-red below */ +} + +.btn-text-white { + color:white; + font-size:1.15em; /* h4 size below */ +} + +.vote-desc { + font-size:1.3em; /* h3 size below */ + font-weight:700; + background-color:#353535; /* bg-black below */ + color:#e2e5e9; /* txt-light-gray below */ + padding:0.2em; +} + +/*!LOTUS*/ +/* See https://goatslacker.github.io/lotus.css */ +@import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,700,300,400|Inconsolata); +body{background-color:#f0f0f0;color:#353535;font-family:'OpenSans',sans-serif;font-size:1em;line-height:1.5em} +code,pre,kbd,samp{font-family:'Inconsolata',monospace} +h1,h2,h3,h4,h5,h6{line-height:1.5em;margin:0 0 .5em} +h1,.h1{font-size:2em} +h2,.h2{font-size:1.5em} +h3,.h3{font-size:1.3em} +h4,.h4{font-size:1.15em} +h5,.h5{font-size:1em} +h6,.h6{font-size:.75em;text-transform:uppercase} +p{margin:0 0 1em} +blockquote{border-left:.1em solid #e2e5e9;margin:1.5em 0;padding:0 1.25em 0 1.24em} +hr{border-color:#e2e5e9;border-style:solid;border-width:.1em;margin:2em 0} +ol ol li{list-style-type:lower-alpha} +ol ol ol li{list-style-type:lower-roman} +b,strong{font-weight:700} +small{font-size:.8em;line-height:1.2em} +sub,sup{font-size:.6em;line-height:0;position:relative;vertical-align:baseline} +sup{top:-.5em} +@media (min-width:56em){ +.hide-lg{display:none} +.show-lg{display:block} +.show-md,.show-sm{display:none} +} +@media (max-width:55em){ +.hide-md{display:none} +.show-md{display:block} +.show-lg,.show-sm{display:none} +.cm12{width:100%} +.cm11{width:91.66%} +.cm10{width:83.33%} +.cm9{width:75%} +.cm8{width:66.66%} +.cm7{width:58.33%} +.cm6{width:50%} +.cm5{width:41.66%} +.cm4{width:33.33%} +.cm3{width:25%} +.cm2{width:16.66%} +.cm1{width:8.33%} +} +@media (max-width:30em){ +.hide-sm{display:none} +.hide-md,.show-sm{display:block} +.show-lg,.show-md{display:none} +.cs12{width:100%} +.cs11{width:91.66%} +.cs10{width:83.33%} +.cs9{width:75%} +.cs8{width:66.66%} +.cs7{width:58.33%} +.cs6{width:50%} +.cs5{width:41.66%} +.cs4{width:33.33%} +.cs3{width:25%} +.cs2{width:16.66%} +.cs1{width:8.33%} +} +.btn{background-color:#a8b2bd;border:0;border-radius:.25em;cursor:pointer;display:inline-block;padding:.5em 1.5em;outline:0;text-align:center} +.btn-sm{padding:.25em .75em} +.btn-lg{padding:1em 3em} +label{margin-bottom:.5em} +label,label textarea,label input,label select{display:block} +textarea,input,select{border:.1em solid #e2e5e9;padding:.5em} +textarea:focus,input:focus,select:focus{border-color:#70bde6} +textarea,input{outline:0;width:13em} +select{height:2.25em;width:14em} +input[type=checkbox],input[type=radio]{display:inline-block;width:auto} +input[disabled]{color:#e2e5e9} +.form-addon{background-color:#fff;border:.1em solid #e2e5e9;padding:.5em 1em} +.table{border-collapse:collapse;border-spacing:0;width:100%} +.table th,.table td{padding:.5em;text-align:left} +.table tbody>:nth-child(2n-1){background-color:#e2e5e9} +.bg-dark-gray{background-color:#a8b2bd} +.bg-light-gray{background-color:#e2e5e9} +.bg-red{background-color:#ff7772} +.bg-green{background-color:#67ba72} +.bg-blue{background-color:#70bde6} +.bg-yellow{background-color:#ffdd69} +.bg-magenta{background-color:#bf75ff} +.bg-cyan{background-color:#92f9f6} +.bg-black{background-color:#353535} +.txt-dark-gray{color:#a8b2bd} +.txt-light-gray{color:#e2e5e9} +.txt-red{color:#ff7772} +.txt-green{color:#67ba72} +.txt-blue{color:#70bde6} +.txt-yellow{color:#ffdd69} +.txt-magenta{color:#bf75ff} +.txt-cyan{color:#92f9f6} diff --git a/views/index.erb b/views/index.erb --- a/views/index.erb +++ b/views/index.erb @@ -17,7 +17,7 @@ along with Ballot. If not, see . <% end %> -Ballot:
Unbearably Ugly. Simply Secure.

+Ballot:
Bearably Ugly. Simply Secure.

See my available votes

About Ballot (including security information) diff --git a/views/layout.erb b/views/layout.erb --- a/views/layout.erb +++ b/views/layout.erb @@ -20,6 +20,7 @@ Ballot Voting System +

diff --git a/views/login.erb b/views/login.erb --- a/views/login.erb +++ b/views/login.erb @@ -17,6 +17,8 @@ along with Ballot. If not, see . <% end %> +

Login

+ <% if @status == "notcomplete" %> You must enter both a username and password. <% elsif @status == "notvalid" %> @@ -30,10 +32,17 @@ <% end %>

- Username:
- Password:
- <% if @use_yubikeys %> - YubiKey OTP (if configured for your account):
- <% end %> - + + + + + + + <% if @use_yubikeys %> + + + <% end %> + +

+
diff --git a/views/vote.erb b/views/vote.erb --- a/views/vote.erb +++ b/views/vote.erb @@ -17,12 +17,16 @@ along with Ballot. If not, see . <% end %> -Vote ID: <%=@votedata["id"]%>
-Vote Name: <%=@votedata["description"]%>
+Vote ID: <%=@votedata["id"]%> <% if @votedata.has_key?("expiration") %> - Vote Expiration: <%=Time.at(@votedata["expiration"]).utc%>
+ (vote expires <%=Time.at(@votedata["expiration"]).utc%>) <% end %> -
+ +

Voting On:

+ +
<%=@votedata["description"]%>
+

+ <% if @status == "returnvoter" %> Welcome back. You can change your vote, but only if you provide the exact unique key you provided when you originally cast your vote. <% elsif @status == "voted" and @scramblevalues == nil %> @@ -32,7 +36,7 @@ <% elsif @status == "failedchange" %> Could not change your vote; the unique key was not correct. <% elsif @status == "newvoter" %> - Make your selection below.

IMPORTANT: You must type a unique key. Once you press the "Vote!" button you will not be able to change your vote unless you provide that exact key! + Make your selection and re-voting key below. IMPORTANT: Once you vote you will not be able to change your vote unless you provide that exact key! <% elsif @status == "smssent" %> An SMS has been sent to your mobile phone. The decodes there are valid for this one page view only!

This vote has scrambling enabled for extra security.

Once you exit this page you will have to provide your exact unique key to change your vote! <% elsif @status == "invitemailsent" %> @@ -43,50 +47,54 @@ Results mails sent. <% end %>

-Instructions: <%=@votedata["instructions"]%> -

+

Instructions:

+

<%=@votedata["instructions"]%>

+ <% if @scramblevalues and @show_sms == nil and @show_gpg == nil %> This vote is scrambled, but you have neither your SMS number nor your public ASCII-armored GPG key entered in Identity. Therefore the values cannot be displayed to you.
<% else %> <% if @scramblevalues and @show_sms %>
- +
<% end %> <% if @administrator %>
You are an administrator of this vote, and you can send invite and reminder emails by clicking the buttons below:
- -
- -
+ + <% if @votecomplete %> - -
+ <% end %>

<% end %> - Your selection<%= " (entries in randomized order)" if @scramblevalues%>:
+ + 1. Make your selection<%= " (entries in randomized order)" if @scramblevalues%>:
<% @votedata["choices"].each_key do |choice| %> <% if @scramblevalues %> -
+ <% else %> -
+ <% end %> <% end %> +
- <% if not @status == "newvoter" %> - Your unique key:

- <% else %> - Your unique key (enter some text, punctuation and spaces are okay, only valid for this vote, cannot be changed!):

- <% end %> - + + +
+
<% end %> -
+

Open votes

Log out diff --git a/views/votes.erb b/views/votes.erb --- a/views/votes.erb +++ b/views/votes.erb @@ -17,18 +17,30 @@ along with Ballot. If not, see . <% end %> +

Your available votes:

+ <% if @votes.length == 0 %> - There are no votes available to you at this time. +

There are no votes available to you at this time.

<% else %> - Your available votes: -

+ + + + + + <% @votes.each_key do |vote| %> - <% if @votes[vote].has_key?("expiration") %> - <%=@votes[vote]["id"]%>: <%=@votes[vote]["description"]%> (valid until <%=Time.at(@votes[vote]["expiration"]).utc%>)
- <% else %> - <%=@votes[vote]["id"]%>: <%=@votes[vote]["description"]%>
- <% end %> + + + + <% if @votes[vote].has_key?("expiration") %> + + <% else %> + + <% end %> + <% end %> +
Vote IDDescriptionValid Until
<%=@votes[vote]["id"]%><%=@votes[vote]["description"]%><%=Time.at(@votes[vote]["expiration"]).utc%>No expiration listed
<% end %> +

Log out