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

Benjamin Mako Hill || Want to submit a patch?