]> projects.mako.cc - selectricity-live/commitdiff
Started modifying the results page for final appearnces.
author<jlsharps@mit.edu> <>
Thu, 30 Aug 2007 23:07:41 +0000 (19:07 -0400)
committer<jlsharps@mit.edu> <>
Thu, 30 Aug 2007 23:07:41 +0000 (19:07 -0400)
app/models/election.rb
app/views/quickvote/results.rhtml
config/environment.rb

index 9c6337fdcf56ff78d7ee1d63a04ba1bfedf23bf0..7fa138ef4c433b4aafc239cd573aaf04a31bb8fb 100644 (file)
@@ -23,7 +23,7 @@ class Election < ActiveRecord::Base
 
   def other_methods
     if election_method
 
   def other_methods
     if election_method
-      @other_methods = ELECTION_TYPES.reject {|i| i == election_method}
+      @other_methods = ELECTION_TYPES.keys.reject {|i| i == election_method}
     else
       @other_methods = nil
     end
     else
       @other_methods = nil
     end
index eb149f605cca0ec68c9d403a18532b689daa9843..a51ca1db2e5bd7e6deaa8a0bd82d524817a1d164 100644 (file)
@@ -30,8 +30,8 @@
 
 <div class="normal-header">
   <span class="header">Winner</span>
 
 <div class="normal-header">
   <span class="header">Winner</span>
-  <span class="subheader">The chosen method is: 
-  <%= @election.election_method.capitalize %></span>
+  <span class="subheader">Computed with
+  <%= ELECTION_TYPES[@election.election_method] %></span>
 </div>
 
 <div class="mainresultbox">
 </div>
 
 <div class="mainresultbox">
index 49b0c48a0334cacd9e1f4c35038b7cbb176f3606..5ea9f103de256e61f44349285a358559b2b3a11c 100644 (file)
@@ -67,7 +67,11 @@ require 'gruff-0.2.8/lib/gruff'
 require 'sparklines'
 
 require 'rubyvote'
 require 'sparklines'
 
 require 'rubyvote'
-ELECTION_TYPES = %w(ssd plurality approval condorcet borda)
+ELECTION_TYPES = {'ssd' => "Schulze Sequential Dropping",
+                  'plurality' => "Plurality/First Past the Post",
+                  'approval' => "Approval (Top Two)",
+                  'condorcet' => "Simple Condorcet",
+                  'borda' => "Borda Count"}
 
 class String
   # alternate capitalization method that does not lowercase the rest of
 
 class String
   # alternate capitalization method that does not lowercase the rest of

Benjamin Mako Hill || Want to submit a patch?