]> projects.mako.cc - selectricity/blob - app/views/account/summary.rhtml
added first full working version of embeddable elections
[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           <% next if column.name.eql?("viewable") || column.name.eql?("quickuser")\
18           || column.name.eql?("active") || column.name.eql?("anonymous") %>
19             <th><%= column.human_name %></th>
20           <% end -%>
21     </tr>
22     
23     <% @user.elections.select {|e| e.instance_of?(Election)}.each do |election| %>
24     <tr>
25           <td>
26         <% if election.active == 1 -%>
27             <%= link_to "#{election.name}", :controller => 'election', 
28                             :action => 'show', :id => election %>
29                 <% else -%>
30                   <%=h election.name %>
31                 <% end -%>
32           </td>
33           <td><%=h election.description %></td>
34           <td><%=h election.startdate.strftime("%x") %></td>
35       <td><%=h election.enddate.strftime("%x") %></td>
36       <td>
37          <% if election.notices == 0 -%>
38                No
39              <% else -%>
40                Yes
41              <% end -%>
42           </td>   
43           <td><%=h election.election_method %></td>
44     </tr>
45     <% end -%>
46   </table>
47 </p>
48
49 <br />
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?