]> projects.mako.cc - selectricity/blob - app/views/account/summary.rhtml
Remove email_voter calls; don't do anything
[selectricity] / app / views / account / summary.rhtml
1 <h2>This is your user summary profile, <%=h @user.login.capitalize %></h2>
2
3 <p>
4 E-mail: <%=h @user.email %><br />
5 Member since: <%=h @user.created_at.strftime("%x") %>
6 </p>
7
8 <p>Your Elections:
9   <table class="voterbox">
10     <tr>
11           <% Election.content_columns.each do |column| -%>
12           <% next if column.name.eql?("viewable") || column.name.eql?("quickuser")\
13           || column.name.eql?("active") %>
14             <th><%= column.human_name %></th>
15           <% end -%>
16     </tr>
17     
18     <% @user.elections.select {|e| e.instance_of?(Election)}.each do |election| %>
19     <tr>
20           <td>
21         <% if election.active == 1 -%>
22             <%= link_to "#{election.name}", :controller => 'election', 
23                             :action => 'show', :id => election %>
24                 <% else -%>
25                   <%=h election.name %>
26                 <% end -%>
27           </td>
28           <td><%=h election.description %></td>
29           <td>
30          <% if election.anonymous == 0 -%>
31                No
32              <% else -%>
33                Yes
34              <% end -%>
35           </td>
36           <td><%=h election.startdate.strftime("%x") %></td>
37       <td><%=h election.enddate.strftime("%x") %></td>
38       <td>
39          <% if election.notices == 0 -%>
40                No
41              <% else -%>
42                Yes
43              <% end -%>
44           </td>   
45           <td><%=h election.election_method %></td>
46     </tr>
47     <% end -%>
48   </table>
49 </p>
50
51 <p>
52 Your Quickvotes:
53 <table class="voterbox">
54   <tr>
55   <% ["Name", "Description", "Start Date", "End Date", "Notices"].each do |column| %>
56         <th><%= column %></th>
57   <% end -%>
58   </tr>
59
60   <% @user.elections.select {|e| e.instance_of?(QuickVote)}.each do |quickvote|
61    %>
62   <tr>
63         <td>    
64           <% if quickvote.active == 1 %>
65             <%= link_to "#{quickvote.name}",
66                      quickaction_url( :ident => quickvote.name, 
67                                       :action => 'results' ) %>
68                 <% else %>
69                   <%=h quickvote.name %>
70                 <% end %>
71         </td>
72         <td><%=h quickvote.description %></td>
73     <td><%=h quickvote.startdate.strftime("%x") %></td>
74     <td><%=h quickvote.enddate.strftime("%x") %></td>
75     <td>
76          <% if quickvote.notices == 0 -%>
77                No
78              <% else -%>
79                Yes
80              <% end -%>
81           </td>
82   </tr>
83 <% end %>
84 </table>

Benjamin Mako Hill || Want to submit a patch?