Changed quickvotes so that they take an identifier as opposed to just a
[selectricity-live] / app / views / quickvote / index.rhtml
1 <% %>
2
3 <% if @voter.election.shortdesc %>
4   <h1><%= @voter.election.shortdesc %></h1>
5 <% else %>
6   <h1>QuickVote</h1>
7 <% end %>
8
9 <% if @voter.election.longdesc %>
10   <p><strong>Description:</strong></p>
11   <blockquote><%= @voter.election.longdesc %></blockquote>
12
13 <h2>Vote</h2>
14 <% end %>
15
16 <% if @voter.voted? %>
17   <p>You have already voted. You can:</p>
18   
19   <ul>
20     <li><%= link_to "Change your vote.", quickaction_url( :ident => @voter.election.name, :action => 'change' ) %></li>
21
22     <li><%= link_to "View election results.", quickaction_url( :ident => @voter.election.name, :action => 'results' ) %></li>
23   </ul>
24 <% else %>
25
26 <p>Drag and drop the items on the following list until they are in order
27 from <em>most preferred at the top</em> to <em>least preferred at the
28 bottom</em>. When you are done, press confirm to record your vote.</p>
29
30 <div id="sortable_list">
31 <ol id="rankings-list">
32   <% for ranking in @voter.vote.rankings %>
33     <li class="moveable" id="ranking_<%= ranking.candidate.id %>">
34       <%= ranking.candidate.name.capitalize %></li>
35   <% end %>
36 </ol>
37 </div>
38
39 <div class="clearbox"></div>
40
41 <%= button_to "Confirm Vote", quickaction_url( :action => 'confirm', :ident => @voter.election.name)  %>
42
43 <%= sortable_element 'rankings-list',
44     :url => { :action => "sort_candidates" , :id => @voter.vote.id },
45     :complete => visual_effect(:highlight, 'rankings-list') %> 
46
47 <% end %>

Benjamin Mako Hill || Want to submit a patch?