b53122ed5094a898d026132ff464132128163f3d
[selectricity-live] / 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       <% ["Name", "Description", "Details"].each do |column| -%>
17             <th><%= column %></th>
18           <% end -%>
19     </tr>
20     
21     <% @user.elections.select {|e| e.instance_of?(Election)}.each do |election| %>
22     <tr>
23           <td style="text-align: left;">
24             <% if election.active == 1 -%>
25             <%= link_to "#{election.name}", :controller => 'election', 
26                             :action => 'show', :id => election %>
27                 <% else -%>
28                   <%=h election.name %>
29                 <% end -%>
30           </td>
31           <td style="text-align: left;"><%=h election.description %></td>
32           <td style="text-align: left;">
33         <strong>Start:</strong> <%=h election.startdate.strftime("%x") %><br />
34         <strong>End:</strong> <%=h election.enddate.strftime("%x") %><br />
35         <strong>Method:</strong> <%=h ELECTION_TYPES[election.election_method] %><br />
36             <strong>Open:</strong> <%= (not election.authenticated?).to_s.capitalize %>
37           </td>
38           
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?