Add links to create new election/quick vote on the account summary screen.
[selectricity] / app / views / account / summary.rhtml
index e6d231f29fa1162fc3dfb0fed4be19cd67990ea9..4d79f5b18fe3b0011145a6981c9d69cd038bf31f 100644 (file)
@@ -13,38 +13,30 @@ Member since: <%=h @user.created_at.strftime("%x") %>
 <p>Your Elections:
   <table class="voterbox" id="election">
     <tr>
-         <% Election.content_columns.each do |column| -%>
-         <% next if column.name.eql?("viewable") || column.name.eql?("quickuser")\
-         || column.name.eql?("active") || column.name.eql?("anonymous") %>
-           <th><%= column.human_name %></th>
+      <% ["Name", "Description", "Details"].each do |column| -%>
+           <th><%= column %></th>
          <% end -%>
     </tr>
     
     <% @user.elections.select {|e| e.instance_of?(Election)}.each do |election| %>
     <tr>
-         <td>
-       <% if election.active == 1 -%>
+         <td style="text-align: left;">
            <%= link_to "#{election.name}", :controller => 'election', 
                            :action => 'show', :id => election %>
-               <% else -%>
-                 <%=h election.name %>
-               <% end -%>
          </td>
-         <td><%=h election.description %></td>
-         <td><%=h election.startdate.strftime("%x") %></td>
-      <td><%=h election.enddate.strftime("%x") %></td>
-      <td>
-         <% if election.notices == 0 -%>
-              No
-            <% else -%>
-              Yes
-            <% end -%>
-         </td>   
-         <td><%=h election.election_method %></td>
+         <td style="text-align: left;"><%=h election.description %></td>
+         <td style="text-align: left;">
+        <strong>Start:</strong> <%=h election.startdate.strftime("%x") %><br />
+        <strong>End:</strong> <%=h election.enddate.strftime("%x") %><br />
+        <strong>Method:</strong> <%=h ELECTION_TYPES[election.election_method] %><br />
+           <strong>Open:</strong> <%= (not election.authenticated?).to_s.capitalize %>
+         </td>
+         
     </tr>
     <% end -%>
   </table>
 </p>
+<p><%= link_to "Create a new election", :controller => 'election', :action => 'new' %>.</p>
 
 <br />
 
@@ -82,3 +74,4 @@ Your Quickvotes:
   </tr>
 <% end %>
 </table>
+<p><%= link_to( "Create a new QuickVote", :controller => 'quickvote', :action => 'create') %>.</p>

Benjamin Mako Hill || Want to submit a patch?