projects
/
selectricity
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ac0692b
)
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
patch
|
blob
|
history
app/views/quickvote/_methodinfo_condorcet.rhtml
patch
|
blob
|
history
app/views/quickvote/_methodinfo_plurality.rhtml
patch
|
blob
|
history
app/views/quickvote/_pref_tables.rhtml
patch
|
blob
|
history
app/views/quickvote/_result.rhtml
patch
|
blob
|
history
app/views/quickvote/_results_sidebar.rhtml
patch
|
blob
|
history
app/views/quickvote/results.rhtml
patch
|
blob
|
history
public/stylesheets/main.css
patch
|
blob
|
history
diff --git
a/app/views/quickvote/_methodinfo_borda.rhtml
b/app/views/quickvote/_methodinfo_borda.rhtml
index cc3167cf9b1dd1379fe50ee008415d21cf756dd0..644522a352b7c4acef916dd3ef6fb738dcb3555d 100644
(file)
--- a/
app/views/quickvote/_methodinfo_borda.rhtml
+++ b/
app/views/quickvote/_methodinfo_borda.rhtml
@@
-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>
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>
diff --git
a/app/views/quickvote/_methodinfo_condorcet.rhtml
b/app/views/quickvote/_methodinfo_condorcet.rhtml
index a02c1d7ecdacfddae2da2ff7b15eed39a3e0d653..b1e700537cdc0ffd66577b1e7555c4228c0cc686 100644
(file)
--- a/
app/views/quickvote/_methodinfo_condorcet.rhtml
+++ b/
app/views/quickvote/_methodinfo_condorcet.rhtml
@@
-11,4
+11,6
@@
will be the winner.</p>
"Simple Condorcet" to distinguish it from the Schulze method which is
another Condorcet system.</p>
"Simple Condorcet" to distinguish it from the Schulze method which is
another Condorcet system.</p>
+<%= render :partial => 'pref_tables' %>
+
</div>
</div>
diff --git
a/app/views/quickvote/_methodinfo_plurality.rhtml
b/app/views/quickvote/_methodinfo_plurality.rhtml
index 9411611c569462f59faca0b3a87309bd1fc55534..bc27dc868a24ab824f36846f75ec8ff2dc590fc1 100644
(file)
--- a/
app/views/quickvote/_methodinfo_plurality.rhtml
+++ b/
app/views/quickvote/_methodinfo_plurality.rhtml
@@
-12,4
+12,6
@@
voting.</p>
</div>
</div>
-<%= image_tag(graph_url( :action => 'plurality_pie', :id => @election ) )%>
+<div class="graph">
+ <%= image_tag(graph_url( :action => 'plurality_pie', :id => @election ) )%>
+</div>
diff --git
a/app/views/quickvote/_pref_tables.rhtml
b/app/views/quickvote/_pref_tables.rhtml
index 588ec22d8aa88e19883fc1cda0a08c06bb6edbcb..b9d41ececcb6b2738dbc639ddf4785956eca4915 100644
(file)
--- a/
app/views/quickvote/_pref_tables.rhtml
+++ b/
app/views/quickvote/_pref_tables.rhtml
@@
-4,12
+4,15
@@
<% victories = @election.ssd_result.victories_and_ties %>
<% if candidates.size <= 7 -%>
<% 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-->
<!-- This table shows how many times each choice was ranked above the other,
with percentages-->
+<div class="result_table">
<table class="preftable">
<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| -%>
<tr>
<td></td>
<% candidates.each do |candidate| -%>
@@
-34,12
+37,15
@@
left column.</caption>
</tr>
<% end -%>
</table>
</tr>
<% end -%>
</table>
-<
br /
>
+<
/div
>
<!-- This table generates a margin of victory -->
<!-- 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">
<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>
<% 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>
</tr>
<% end -%>
</table>
+</div>
<% end -%>
<% end -%>
diff --git
a/app/views/quickvote/_result.rhtml
b/app/views/quickvote/_result.rhtml
index e0ead6de4e3f27b60524554f0b06241578fcd169..b0a3a8522363fcdd8dde2eb70eb7c261ca7e6cb2 100644
(file)
--- a/
app/views/quickvote/_result.rhtml
+++ b/
app/views/quickvote/_result.rhtml
@@
-1,10
+1,12
@@
<div class="winner">
<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 %>
<% 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 %>
<% else %>
- <p>There is no winner using this method. </strong>
</p>
+ <p>There is no winner using this method. </strong>
<% end %>
<% end %>
+</p>
</div>
</div>
diff --git
a/app/views/quickvote/_results_sidebar.rhtml
b/app/views/quickvote/_results_sidebar.rhtml
index 773db655df2f999daf7f4f2c388c8a656233f002..30047a48347921ca790773ab2c6b5bb81623f103 100644
(file)
--- a/
app/views/quickvote/_results_sidebar.rhtml
+++ b/
app/views/quickvote/_results_sidebar.rhtml
@@
-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>
<p>This election was run using:
<strong><%= ELECTION_TYPES[@election.election_method] %></strong></p>
diff --git
a/app/views/quickvote/results.rhtml
b/app/views/quickvote/results.rhtml
index 4c91538992c3aa50850e009e28ccd8ac2d4c2d32..5fd5f9e4bc0d15cf5cd8defe0a71a97be85a167b 100644
(file)
--- a/
app/views/quickvote/results.rhtml
+++ b/
app/views/quickvote/results.rhtml
@@
-5,6
+5,10
@@
<span class="subheader">Results</span>
</div>
<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>
<% if @election.shortdesc %>
<p><strong>Vote Description:</strong></p>
<blockquote><em><%=h @election.shortdesc %></em>
diff --git
a/public/stylesheets/main.css
b/public/stylesheets/main.css
index 418e892534c4e06780c5d080b37331e0a06efbfb..0260bc4737a82f0541faab6827849e62ef8d96a0 100644
(file)
--- a/
public/stylesheets/main.css
+++ b/
public/stylesheets/main.css
@@
-71,15
+71,9
@@
label {
color: #666666;
}
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. */
/* Right column. Includes top-bar and main-box. */
@@
-266,6
+260,10
@@
li.moveable {
float: left;
}
float: left;
}
+.result_table {
+ text-align: center;
+ margin-bottom: 1em;
+}
.preftable {
font-family: verdana,arial,helvetica,sans-serif;
border-spacing: 0px;
.preftable {
font-family: verdana,arial,helvetica,sans-serif;
border-spacing: 0px;
@@
-274,10
+272,7
@@
li.moveable {
border-style: solid;
caption-side: top;
}
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;
.preftable th {
font-family: verdana,arial,helvetica,sans-serif;
border-width: 2px;
@@
-447,3
+442,25
@@
div.photo img {
border: 1px black solid;
}
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?