]> projects.mako.cc - selectricity/blobdiff - app/views/common/results.rhtml
fixed a large number of bugs in the software (see wiki) over a days work
[selectricity] / app / views / common / results.rhtml
diff --git a/app/views/common/results.rhtml b/app/views/common/results.rhtml
new file mode 100644 (file)
index 0000000..6f3a18d
--- /dev/null
@@ -0,0 +1,48 @@
+<!-- create the default variables -->
+<% @results = @election.results %>
+<% @names = @election.names_by_id %>
+<% @candidates = @election.candidate_hash %>
+
+<% require 'whois/whois' %>
+
+<div id="title-header">
+  <span class="header">Results</span>
+  <span class="subheader"><%= @election.name %></span>
+</div>
+
+<div id="winner_box">
+<%= render :partial => 'common/result', :object => @results[@election.election_method] %>
+</div>
+
+<% if @election.shortdesc %>
+  <p><strong>Vote Description:</strong></p>
+  <blockquote><em><%=h @election.shortdesc %></em>
+    <% if @election.longdesc -%>
+      <br />
+      <%= h(@election.longdesc) -%>
+    <% end -%>
+  </blockquote>
+<% end %>
+
+<p><strong>Number of voters:</strong></p>
+   <blockquote>
+     <%= @election.voters.reject {|v| not v.voted? }.length %>
+   </blockquote>
+
+<%= render :partial => 'common/result_box',
+           :locals => { :method => @election.election_method } %>
+
+<% for result_type in @election.other_methods %>
+
+<%= render :partial => 'common/result_box',
+           :locals => { :method => result_type } %>
+
+<% end %>
+
+
+<div class="clear-div"></div>
+
+<!--
+<%= image_tag( graph_url( :action => 'choices_positions', :id => @election ) ) %><br />
+-->
+

Benjamin Mako Hill || Want to submit a patch?