projects
/
selectricity
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
The defeats lsit partial contains the display logic for the mehtod added to condorcet...
[selectricity]
/
app
/
views
/
quickvote
/
_pref_table.rhtml
diff --git
a/app/views/quickvote/_pref_table.rhtml
b/app/views/quickvote/_pref_table.rhtml
index dfcb6cca9ea31438ad480ce56b8814761743b1b8..32f5de4bc81254afef3a36fbae12a82ab331d21b 100644
(file)
--- a/
app/views/quickvote/_pref_table.rhtml
+++ b/
app/views/quickvote/_pref_table.rhtml
@@
-1,13
+1,17
@@
-<% candidates = @election.candidates.sort.collect {|candidate| candidate.id} -%>
+<% candidates = @election.candidates.sort.collect {|candidate| candidate.id}-%>
+<% names = Hash.new -%>
+<% candidates.each do |candidate| -%>
+ <%names[candidate] = Candidate.find(candidate).name -%>
+<% end -%>
<table class="voterbox">
<tr>
<td> </td>
<% candidates.each do |candidate| -%>
<table class="voterbox">
<tr>
<td> </td>
<% candidates.each do |candidate| -%>
- <th><%=
candidate
-%></th>
+ <th><%=
names[candidate]
-%></th>
<% end -%>
<% candidates.each do |winner| -%>
<tr>
<% end -%>
<% candidates.each do |winner| -%>
<tr>
- <th><%=
winner
%></th>
+ <th><%=
names[winner]
%></th>
<% candidates.each do |loser| -%>
<% if winner == loser -%>
<td> -- </td>
<% candidates.each do |loser| -%>
<% if winner == loser -%>
<td> -- </td>
@@
-16,4
+20,5
@@
<% end -%>
<% end -%>
</tr>
<% end -%>
<% end -%>
</tr>
-<%end -%>
\ No newline at end of file
+<%
end -%>
+
Benjamin Mako Hill
||
Want to submit a patch?