]> projects.mako.cc - selectricity-live/blob - app/views/embed/full_vote.rhtml
4eca8c4f4320e598f6b00573ff820e7fc9218c79
[selectricity-live] / app / views / embed / full_vote.rhtml
1 <head>
2 <%javascript_include_tag :defaults %>
3 <%if @top_bar %>
4 <script type="text/javascript">
5
6 document.getElementById("header").style.backgroundImage="<%=url_for @top_bar.public_filename%>"
7
8 </script>
9 <% end %>
10 </head>
11 <div id="header">
12 <%= link_to '<img id="header_icon" src="/images/embed_header_icon.png" />',
13             {:controller => 'front'}, {:target => "_parent"} %><h2>Vote Now</h2>
14 </div>
15
16 <div id="voting-box" height="<%=(@election.candidates.length + 2)*53 %>px">
17         
18         <%= render :partial => '/embed/backdrop' %>
19         <ul id="rankings-list">
20       <% @voter.vote.rankings.each do |ranking| %>
21                 <li class="ranking" id="ranking_<%= ranking.candidate.id %>">
22                         <img alt="<%= white_list ranking.candidate.name %>"
23                  src="<% if ranking.candidate.picture -%>
24                       <%= url_for ranking.candidate.picture.public_filename(:thumb) -%>
25                                           <% elsif @default_image %>
26                                           <%= url_for @default_image.public_filename %>
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 @bottom_bar %>
41         background-image:url(<%= url_for @bottom_bar.public_filename %>)
42         <% elsif @election.candidates.length%2 == 0 %>
43         background-image:url(/images/bottom_dark.png)
44         <%else%>
45         background-image:url(/images/bottom_light.png)
46         <%end%>" >
47                 <div id="container">
48                         <a href="<%= url_for :action => :confirm, :id => @password, :embed => 'true' %>"><h2 id="submit_vote_button">Submit Vote</h2></a>
49                         <p><b>Drag and drop</b> to rank the choices.</p>
50                 </div>
51         </div>
52 </div>
53
54 <%= sortable_element 'rankings-list',
55     :url => { :action => "sort_candidates", :id => @voter.vote.id } %>
56

Benjamin Mako Hill || Want to submit a patch?