Variety of improvements and additions:
[selectricity-live] / app / views / elections / list.rhtml
index 40e24b5fbf039d7036d1e4ba79ba23d82d74614d..83be6c6c28671bf728c27ce8e36b628cfa2a1734 100644 (file)
@@ -1,20 +1,28 @@
+<% %>
 <h1>Listing elections</h1>
 
-<table>
-  <tr>
-  <% for column in Election.content_columns %>
-    <th><%= column.human_name %></th>
-  <% end %>
-  </tr>
-  
+<table cellpadding="10px">
+
 <% for election in @elections %>
   <tr>
-  <% for column in Election.content_columns %>
-    <td><%=h election.send(column.name) %></td>
-  <% end %>
-    <td><%= link_to 'Show', :action => 'show', :id => election %></td>
-    <td><%= link_to 'Edit', :action => 'edit', :id => election %></td>
-    <td><%= link_to 'Destroy', { :action => 'destroy', :id => election }, :confirm => 'Are you sure?' %></td>
+    <td valign="top"><h2><%= link_to election.name, :action => 'show', :id => election %></h2>
+        <p><strong>Description:</strong></p>
+       <blockquote><%= election.description %></blockquote>
+       
+        <p><strong>Election Information:</strong></p>
+       <ul>
+          <li><%= election.voters.length %> registered voters</li>
+          <li><%= "<strong>Not</strong> " unless election.anonymous == 1 %>Anonymous</li>
+         <li>Starts <%= election.startdate %></li>
+         <li>Ends <%= election.enddate %></li>
+        </ul> 
+    </td>
+    <td valign="top">
+        <p><strong>Candidates:</strong></p>
+       <% @election = election %><%= render :partial => 'candidate_list', :id => election.id %>
+    </td>
+    <td valign="top">
+        <%= link_to 'Destroy', { :action => 'destroy', :id => election }, :confirm => 'Are you sure?' %></td>
   </tr>
 <% end %>
 </table>

Benjamin Mako Hill || Want to submit a patch?