From ac5e3489e8b886b7b8a7252ab56ddeb3d3bdadc7 Mon Sep 17 00:00:00 2001
From: The winner is:
- <%= @candidates[result.winner].name %>
There was a tie. The winners are: <%= - result.winners.collect {|w| @candidates[w]}.join(", ") %>
+ result.winners.collect {|w| @candidates[w].to_s.capitalize}.join(", ") %> <% else %>There is no winner using this method.
<% end %> diff --git a/app/views/quickvote/create.rhtml b/app/views/quickvote/create.rhtml index 7074218..0a5d4aa 100644 --- a/app/views/quickvote/create.rhtml +++ b/app/views/quickvote/create.rhtml @@ -1,15 +1,16 @@ <% -%> -Please review the data you've entered and confirm. The candidates for -the election submitted include:
+ +Please review the data you've entered and confirm it. The candidates +for the vote you've submitted include:
-<%= text_field 'quickvote', 'name' %>
+
+optional; one line summary on the first line
-<%= text_area 'quickvote', 'description', :rows => 2 %>
-Seperate choices with a ";". At least two are required.
+seperate choices with a ";"; at least two are required
-<%= text_area 'quickvote', 'candidatelist', :rows => 3 %>
<% if @quickvote -%> <%= submit_tag "Confirm" -%> <%= hidden_field :quickvote, :reviewed, :value => 1 %> <% else %> - <%= submit_tag "Create QuickVote" -%> + <%= submit_tag "Submit" -%> <%- end -%>
diff --git a/app/views/quickvote/index.rhtml b/app/views/quickvote/index.rhtml index 2c5bcd1..84211ff 100644 --- a/app/views/quickvote/index.rhtml +++ b/app/views/quickvote/index.rhtml @@ -1,10 +1,18 @@ <% %> -Description:
-<%= @voter.election.description %>+<% if @voter.election.shortdesc %> +
Description:
+<%= @voter.election.longdesc %>+ +
You have already voted. You can:
diff --git a/app/views/quickvote/results.rhtml b/app/views/quickvote/results.rhtml index ad71fa6..e3644c8 100644 --- a/app/views/quickvote/results.rhtml +++ b/app/views/quickvote/results.rhtml @@ -1,36 +1,77 @@ <% %> +Description:
+<%= @election.shortdesc %> + <% if @election.longdesc -%> ++<% end %> + +
+ <%= h(@election.longdesc) -%> + <% end -%> +
Candidates/choices:
+ +Number of voters:
++ <%= @election.voters.length %> (see below for details) ++ +
Total Votes: <%= @election.voters.length %>
(Assuming top two choices are "approved.")
<%= render :partial => 'result', :object => @approval_result %>IP Address | +DNS/Host | +Vote | +
---|---|---|
<%= voter.ipaddress %> | +<%= `host #{voter.ipaddress}`.sub(/^.*pointer (.*)\.$/, '\1') %> | +<%= voter.vote.votestring %> | +
Please direct voters to:
+ ++ <%= quickvote_url( :votename => @quickvote.name ) -%> ++ +
This vote will close on <%= @quickvote.enddate %>
QuickVotes are open to the public but are not publicly listed on the HyperChad site. Voters do not need to log in or authenticate to participate in this election.
-Direct voters to:
-<%= quickvote_url( :votename => @quickvote.name ) %>- -
This vote will expire on <%= @quickvote.enddate %>
- -<%= link_to "Visit in or vote in your QuickVote", quickvote_url( :votename => @quickvote.name ) %>
+<%= link_to "Jump to your QuickVote.", quickvote_url( :votename => @quickvote.name ) %>
diff --git a/app/views/quickvote/thanks.rhtml b/app/views/quickvote/thanks.rhtml index 794f412..4104612 100644 --- a/app/views/quickvote/thanks.rhtml +++ b/app/views/quickvote/thanks.rhtml @@ -1,11 +1,11 @@ <% %> - +Your vote has been recorded with the following ranked preferences:
QuickVotes are unstructured votes, more like polls, without -the voter verifiability, anonymity, and other more complex features of -HyperChad. They are the quickest way to make a decision using a variety -of preferential and non-preficial election methods, or to compare -between methods.
+QuickVotes are like polls: unstructured, non-anonymous and +without the complex features of HyperChad. They are the +quickest way to make a decision or to compare between voting +methods.
<%= link_to "Create QuickVote.", :controller => 'quickvote', :action => 'create' %>
diff --git a/app/views/voter/_vote.rhtml b/app/views/voter/_vote.rhtml index b9a2688..dc240af 100644 --- a/app/views/voter/_vote.rhtml +++ b/app/views/voter/_vote.rhtml @@ -3,12 +3,13 @@Candidates or choices:
In the box below, list each choice in order of most preferred to -least preferred. (For example, 123 or 321 or 213, etc.)
+least preferred. Please list all choices in every vote. +(For example, 123 or 321 or 213, etc.) <% if @voter.election.quickvote? %> <%= form_tag quickaction_url( :votename => @voter.election.name, :action => 'confirm') %> diff --git a/config/environment.rb b/config/environment.rb index dcc9fad..9eb4d57 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -57,6 +57,16 @@ require 'uniq_token' require 'randarray' require 'rubyvote' +class String + def capitalize + if self.length <= 1 + self.upcase + else + self.split(//)[0].upcase + self..split(//)[1..-1].join("") + end + end +end + module LoginEngine config :salt, "voothingboat" config :email_from, MAIL_CONFIG[:from] diff --git a/db/create.sql b/db/create.sql index a9d430c..e0c264f 100644 --- a/db/create.sql +++ b/db/create.sql @@ -42,6 +42,7 @@ create table voters ( contacted tinyint NOT NULL DEFAULT 0, election_id int NOT NULL, session_id varchar(32) DEFAULT NULL, + ipaddress varchar(32) DEFAULT NULL, constraint fk_election_voter foreign key (election_id) references election(id), primary key (id) ); diff --git a/public/stylesheets/vb.css b/public/stylesheets/vb.css index e694069..0a9f362 100644 --- a/public/stylesheets/vb.css +++ b/public/stylesheets/vb.css @@ -14,8 +14,9 @@ h1, h2, h3, h4 { text-shadow: #999999 0.2em 0.2em 3px; } + a:link { font-weight: bold; color: #BD7589; text-decoration: underline; } -a:visited { color: #BD7589; text-decoration: underline; } +a:visited { font-weight: bold; color: #BD7589; text-decoration: underline; } a:hover { color: #FFFFFF; text-decoration: none; background: #0063DC; } a:active { color: #FFFFFF; text-decoration: none; background: #0259C4; } @@ -67,8 +68,8 @@ a:active { color: #FFFFFF; text-decoration: none; background: #0259C4; } #top h3 { font-size: 30px; } #links { text-align : right; } -#links a { color: #FFF; } -#links a:visited { font-weight: bold; } +#links a { color: #FFF; font-weight: bold; } +#links a:visited { color: #FFF; font-weight: bold; } .ListLine0 { background: #e0f8f8; @@ -112,8 +113,8 @@ a:active { color: #FFFFFF; text-decoration: none; background: #0259C4; } .mainresultbox { width: 100%; padding: 7px; - margin-right: 10px; - margin-bottom: 10px; + margin-right: 30px; + margin-bottom: 30px; border-style: dotted; border-width: 1px; } @@ -131,4 +132,8 @@ a:active { color: #FFFFFF; text-decoration: none; background: #0259C4; } border-width: 1px; } +.clearbox { + clear: both; + margin: 30px; +} -- 2.39.5