added support for results for full elections
[selectricity-live] / app / views / common / _result.rhtml
diff --git a/app/views/common/_result.rhtml b/app/views/common/_result.rhtml
new file mode 100644 (file)
index 0000000..b0a3a85
--- /dev/null
@@ -0,0 +1,12 @@
+<div class="winner">
+<p class="winner_text">
+<% if result.winner? and result.winners.length == 1 -%>
+  The winner is:
+     <strong><%=h @candidates[result.winner].name.capitalize %></strong>
+<% elsif result.winner? and result.winners.length > 1 %>
+  There was a tie. The winners are: <strong><%=h( result.winners.collect {|w| @candidates[w].to_s.capitalize}.join(", ") )%></strong>
+<% else %>
+  <p>There is no winner using this method. </strong>
+<% end %>
+</p>
+</div>

Benjamin Mako Hill || Want to submit a patch?