]> projects.mako.cc - selectricity-live/blob - app/views/account/summary.rhtml
The legend is now hidden when there is only one color to display on a graph.
[selectricity-live] / app / views / account / summary.rhtml
1 <h3>This is your user summary profile, <%=h @user.login.capitalize %></h3>
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" id="election">
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") || column.name.eql?("anonymous") %>
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><%=h election.startdate.strftime("%x") %></td>
30       <td><%=h election.enddate.strftime("%x") %></td>
31       <td>
32          <% if election.notices == 0 -%>
33                No
34              <% else -%>
35                Yes
36              <% end -%>
37           </td>   
38           <td><%=h election.election_method %></td>
39     </tr>
40     <% end -%>
41   </table>
42 </p>
43
44 <br />
45
46 <p>
47 Your Quickvotes:
48 <table class="voterbox">
49   <tr>
50   <% ["Name", "Description", "Start Date", "End Date", "Notices"].each do |column| %>
51         <th><%= column %></th>
52   <% end -%>
53   </tr>
54
55   <% @user.elections.select {|e| e.instance_of?(QuickVote)}.each do |quickvote|
56    %>
57   <tr>
58         <td>    
59           <% if quickvote.active == 1 %>
60             <%= link_to "#{quickvote.name}",
61                      quickaction_url( :ident => quickvote.name, 
62                                       :action => 'results' ) %>
63                 <% else %>
64                   <%=h quickvote.name %>
65                 <% end %>
66         </td>
67         <td><%=h quickvote.description %></td>
68     <td><%=h quickvote.startdate.strftime("%x") %></td>
69     <td><%=h quickvote.enddate.strftime("%x") %></td>
70     <td>
71          <% if quickvote.notices == 0 -%>
72                No
73              <% else -%>
74                Yes
75              <% end -%>
76           </td>
77   </tr>
78 <% end %>
79 </table>

Benjamin Mako Hill || Want to submit a patch?