Added support for voting in QuickVotes.
[selectricity-live] / app / views / voter / _vote.rhtml
diff --git a/app/views/voter/_vote.rhtml b/app/views/voter/_vote.rhtml
new file mode 100644 (file)
index 0000000..e742021
--- /dev/null
@@ -0,0 +1,37 @@
+<% %>
+
+<% if @voter.election.quickvote? %>
+  <h1>QuickVote: <em><%= @voter.election.name %></em></h1>
+  <p><strong>Description:</strong></p>
+  <blockquote><%= @voter.election.description %></blockquote>
+<% else %>
+  <p><strong>Election:</strong> <%= @voter.election.name %></p>
+  <p><strong>Voter:</strong> <%= @voter.email %></p>
+  <p><strong>Description:</strong></p>
+  <blockquote><%= @voter.election.description %></blockquote>
+<% end %>
+
+<p><strong>Candidates:</strong></p>
+<ol>
+<% for candidate in @voter.election.candidates.sort %>
+  <li><%= candidate.name %></li>
+<% end %>
+</ol>
+
+<hr />
+
+<h2>Place Your Vote Here</h2>
+
+<p>Rank each candidate in order of more preferred to least
+preferred. (e.g., 123 or 321 or 213, etc.)</p>
+
+<% if @voter.election.quickvote? %>
+  <%= form_tag quickconfirm_url( :votename => @voter.election.name ) %>
+<% else %>
+  <%= form_tag :action => 'review', :id => @voter.password %>
+<% end %>
+
+<%= text_field :vote, :votestring -%>
+<%= submit_tag "Submit!" %>
+<%= end_form_tag %>
+

Benjamin Mako Hill || Want to submit a patch?