added first full working version of embeddable elections
[selectricity] / app / views / embed / full_vote.rhtml
diff --git a/app/views/embed/full_vote.rhtml b/app/views/embed/full_vote.rhtml
new file mode 100644 (file)
index 0000000..70a6825
--- /dev/null
@@ -0,0 +1,35 @@
+<div id="header">
+<img id="header_icon" src="/images/embed_header_icon.png" />
+<h2>Vote Now</h2>
+</div>
+<div id="voting-box">
+       
+       <ul id="rankings-list">
+      <% @voter.vote.rankings.each do |ranking| %>
+               <li class="ranking" id="ranking_<%= ranking.candidate.id %>">
+                       <img alt="<%= white_list ranking.candidate.name %>"
+                 src="<% if ranking.candidate.picture -%>
+                      <%= url_for ranking.candidate.picture.public_filename(:thumb) -%>
+                     <%- else -%>
+                     /images/default_icon.png
+                     <%- end %>" />
+                       <p class="ranking-info">
+            <strong><%= white_list ranking.candidate.name %></strong><br />
+            <%= white_list ranking.candidate.description %></p>
+               </li>
+      <% end %>
+       </ul>
+       
+       <div style="clear:both;"></div>
+       
+       <div id="voting-bottom">
+               <div id="container">
+                       <a href="<%= url_for :action => :confirm, :id => @password, :embed => 'true' %>"><h2 id="submit_vote_button">Submit Vote</h2></a>
+                       <p><b>Drag and drop</b> to rank your favorite videos</p>
+               </div>
+       </div>
+</div>
+
+<%= sortable_element 'rankings-list',
+    :url => { :action => "sort_candidates", :id => @voter.vote.id } %>
+

Benjamin Mako Hill || Want to submit a patch?