fixed up the results page in a number of ways
author<mako@atdot.cc> <>
Wed, 5 Sep 2007 17:09:46 +0000 (13:09 -0400)
committer<mako@atdot.cc> <>
Wed, 5 Sep 2007 17:09:46 +0000 (13:09 -0400)
app/views/quickvote/_methodinfo_borda.rhtml
app/views/quickvote/_methodinfo_condorcet.rhtml
app/views/quickvote/_methodinfo_plurality.rhtml
app/views/quickvote/_pref_tables.rhtml
app/views/quickvote/_result.rhtml
app/views/quickvote/_results_sidebar.rhtml
app/views/quickvote/results.rhtml
public/stylesheets/main.css

index cc3167cf9b1dd1379fe50ee008415d21cf756dd0..644522a352b7c4acef916dd3ef6fb738dcb3555d 100644 (file)
@@ -10,4 +10,7 @@ corresponding to the position in which he or she is ranked by each
 voter. Once all votes have been counted the candidate with the most
 points is the winner.</p>
 </div>
-<%= image_tag( graph_url( :action => 'borda_bar', :id => @election ) ) %>
+
+<div class="graph">
+  <%= image_tag( graph_url( :action => 'borda_bar', :id => @election ) ) %>
+</div>
index a02c1d7ecdacfddae2da2ff7b15eed39a3e0d653..b1e700537cdc0ffd66577b1e7555c4228c0cc686 100644 (file)
@@ -11,4 +11,6 @@ will be the winner.</p>
 "Simple Condorcet" to distinguish it from the Schulze method which is
 another Condorcet system.</p>
 
+<%= render :partial => 'pref_tables' %>
+
 </div>
index 9411611c569462f59faca0b3a87309bd1fc55534..bc27dc868a24ab824f36846f75ec8ff2dc590fc1 100644 (file)
@@ -12,4 +12,6 @@ voting.</p>
 
 </div>
 
-<%= image_tag(graph_url( :action => 'plurality_pie', :id => @election ) )%>
+<div class="graph">
+  <%= image_tag(graph_url( :action => 'plurality_pie', :id => @election ) )%>
+</div>
index 588ec22d8aa88e19883fc1cda0a08c06bb6edbcb..b9d41ececcb6b2738dbc639ddf4785956eca4915 100644 (file)
@@ -4,12 +4,15 @@
 <% victories = @election.ssd_result.victories_and_ties %>
 
 <% if candidates.size <= 7 -%>
+
+<p>Each number in the table below shows how many times the candidate on
+the left beat the matching candidate on the top. The winner is on the
+top of the left column.</p>
+
 <!-- This table shows how many times each choice was ranked above the other, 
        with percentages-->
+<div class="result_table">
 <table class="preftable">
-<caption>Each number shows how many times the candidate on the left beat the 
-matching candidate on the top. The Schulze/Condorcet winner is on the top of the 
-left column.</caption>
   <tr>
        <td></td>
        <% candidates.each do |candidate| -%>
@@ -34,12 +37,15 @@ left column.</caption>
  </tr>
 <% end -%>
 </table>
-<br />
+</div>
 <!-- This table generates a margin of victory -->
+
+<p>A simplification of the above data. The winner is on the left; each
+cell names the defeated candidate and the magnitude of the victory in
+parenthesis.</p>
+
+<div class="result_table">
 <table class="preftable">
-<caption>A simplification of the above data. The winner is on the left; each cell
-names the defeated candidate and the magnitude of the victory in parenthesis.
-</caption>
   <% candidates.each do |victor| %>
   <tr>
     <th><%=h @names[victor] %></th>
@@ -56,5 +62,6 @@ names the defeated candidate and the magnitude of the victory in parenthesis.
   </tr>
   <% end -%>
 </table>
+</div>
 <% end -%>
 
index e0ead6de4e3f27b60524554f0b06241578fcd169..b0a3a8522363fcdd8dde2eb70eb7c261ca7e6cb2 100644 (file)
@@ -1,10 +1,12 @@
 <div class="winner">
-<% if result.winner? and result.winners.length == 1%>
-  <p>The winner is:
-     <strong><%=h @candidates[result.winner].name.capitalize %></strong></p>
+<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 %>
-  <p>There was a tie. The winners are: <strong><%=h( result.winners.collect {|w| @candidates[w].to_s.capitalize}.join(", ") )%></strong></p>
+  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></p>
+  <p>There is no winner using this method. </strong>
 <% end %>
+</p>
 </div>
index 773db655df2f999daf7f4f2c388c8a656233f002..30047a48347921ca790773ab2c6b5bb81623f103 100644 (file)
@@ -1,5 +1,4 @@
-<h2>Winner</h2>
-<%= render :partial => 'result', :object => @results[@election.election_method] %>
+<h2>Method</h2>
 
 <p>This election was run using:
 <strong><%= ELECTION_TYPES[@election.election_method] %></strong></p>
index 4c91538992c3aa50850e009e28ccd8ac2d4c2d32..5fd5f9e4bc0d15cf5cd8defe0a71a97be85a167b 100644 (file)
@@ -5,6 +5,10 @@
   <span class="subheader">Results</span>
 </div>
 
+<div id="winner_box">
+<%= render :partial => 'result', :object => @results[@election.election_method] %>
+</div>
+
 <% if @election.shortdesc %>
   <p><strong>Vote Description:</strong></p>
   <blockquote><em><%=h @election.shortdesc %></em>
index 418e892534c4e06780c5d080b37331e0a06efbfb..0260bc4737a82f0541faab6827849e62ef8d96a0 100644 (file)
@@ -71,15 +71,9 @@ label {
        color: #666666;
 }
 
-/* #graph {
-       margin-top: 50px;
-       background: url(/images/graph.jpg) top left no-repeat;
-       height: 0px;
-       overflow: hidden;
-       padding-top: 243px;
-} */
-
-
+.graph {
+  text-align: center;
+}
 
 /* Right column. Includes top-bar and main-box. */
 
@@ -266,6 +260,10 @@ li.moveable {
   float: left;
 }
 
+.result_table {
+ text-align: center;
+ margin-bottom: 1em;
+}
 .preftable {
        font-family: verdana,arial,helvetica,sans-serif;
        border-spacing: 0px;
@@ -274,10 +272,7 @@ li.moveable {
        border-style: solid;
        caption-side: top;
 }
-.preftable caption { 
-  font-family: verdana,arial,helvetica,sans-serif;
-  font-size: 0.9em;
-}
+
 .preftable th {
        font-family: verdana,arial,helvetica,sans-serif;
        border-width: 2px;
@@ -447,3 +442,25 @@ div.photo img {
  border: 1px black solid;
 }
 
+.winner_text {
+ text-align: center;
+}
+
+#winner_box {
+ border: 3px white solid;
+ background-color: #666666;
+ color: white; 
+ margin: 0.5em 0 1em 0;
+}
+
+.winner_text {
+ font-size: 1.2em;
+}
+#winner_box .winner_text {
+ font-size: 2em;
+}
+
+#winner_box p {
+ margin: 0;
+ padding: 0;
+}

Benjamin Mako Hill || Want to submit a patch?