Added a list of recent votes to the homepage.
[selectricity] / app / views / site / index.rhtml
1 <% %>
2
3 <table width="auto" padding="5px">
4 <tr>
5 <td width="47%" valign="top">
6
7 <h2>QuickVotes</h2>
8
9 <p><em>QuickVotes</em> are like polls: unstructured, non-anonymous and
10 without the complex features of <em>HyperChad</em>. They are the
11 quickest way to make a decision or to compare between voting
12 methods.</p>
13
14 <p><%= link_to "Create a QuickVote", :controller => 'quickvote', :action => 'create' %></p>
15
16 <p>Recent <em>QuickVotes</em> include:</p>
17
18 <ul>
19 <% for quickvote in @quickvotes %>
20 <li><%= link_to (quickvote.shortdesc || "Unnamed"), quickvote_url(:votename => quickvote.name) %></li>
21 <% end %>
22 </ul>
23
24 <h2>Voters</h2>
25
26 <p>If you have received an email with a token inviting you to vote in an
27 ongoing election, you can log in to vote using your token here.</p>
28
29 <%= form_tag :controller => 'voter', :action => 'index' %>
30 <%= text_field :vote, :password %>
31 <%= submit_tag "Log In" %>
32 <%= end_form_tag %>
33
34 <p><%= link_to 'Lost or forgot your token?', :controller => 'voter', :action => 'forgot_password' %></p>
35 </td>
36
37 <td width="6%"></td>
38
39 <td width="47%" valign="top">
40
41 <% if session[:user] %>
42   <%= render_partial 'user_summary' %> 
43 <% else %>
44   <h2>Vote Administrators</h2>
45   <p>You must have an account to start a new vote or to administer an
46   existing vote. You can log in or create a new account below.</p>
47
48   <%= render_partial 'basic_login' %>
49 <% end %>
50 </td>
51 </tr>
52 </table>

Benjamin Mako Hill || Want to submit a patch?