89e384ca9d5c1885b6dd8ee2dff5bb56ae81c7fa
[selectricity-live] / app / views / embed / full_vote.rhtml
1 <div id="header">
2 <%= link_to '<img id="header_icon" src="/images/embed_header_icon.png" />',
3             {:controller => 'front'}, {:target => "_parent"} %><h2>Vote Now</h2>
4 </div>
5
6 <div id="voting-box" height="<%=(@election.candidates.length + 2)*53 %>px">
7         <%@election.candidates.length.times do |count|%>
8                 <% if (count%2)==0%>
9                         <img src="/images/widget_dark.png" 
10                         style="position:absolute;top:<%=(count+1)*53%>px;">
11                         <% else %>
12                         <img src="/images/widget_light.png" 
13                         style="position:absolute;top:<%=(count+1)*53%>px">
14                 <% end %>
15                 <p class="position"
16                 style="position:absolute;top:<%=(10+(count+1)*53)%>px;left:10px">
17                         <%=count+1%>
18                 </p>
19         <%end%>
20         
21         <ul id="rankings-list">
22       <% @voter.vote.rankings.each do |ranking| %>
23                 <li class="ranking" id="ranking_<%= ranking.candidate.id %>">
24                         <img alt="<%= white_list ranking.candidate.name %>"
25                  src="<% if ranking.candidate.picture -%>
26                       <%= url_for ranking.candidate.picture.public_filename(:thumb) -%>
27                      <%- else -%>
28                      /images/default_icon.png
29                      <%- end %>" />
30                         <p class="ranking-info">
31             <strong><%= white_list ranking.candidate.name %></strong><br />
32             <%= white_list ranking.candidate.description %></p>
33                 </li>
34       <% end %>
35         </ul>
36         
37         <div style="clear:both;"></div>
38         
39         <div id="voting-bottom" style="
40         <% if @election.candidates.length%2 == 0 %>
41         background-image:url(/images/bottom_dark.png)
42         <%else%>
43         background-image:url(/images/bottom_light.png)
44         <%end%>" >
45                 <div id="container">
46                         <a href="<%= url_for :action => :confirm, :id => @password, :embed => 'true' %>"><h2 id="submit_vote_button">Submit Vote</h2></a>
47                         <p><b>Drag and drop</b> to rank the choices.</p>
48                 </div>
49         </div>
50 </div>
51
52 <%= sortable_element 'rankings-list',
53     :url => { :action => "sort_candidates", :id => @voter.vote.id } %>
54

Benjamin Mako Hill || Want to submit a patch?