Merge jdong
[selectricity] / app / views / election / show.rhtml
1 <h1>Vote Information</h1>
2
3 <% if @election.active? %>
4   <div id="status">Vote is in currently in progress. Return to
5         this page for results on <%= @election.enddate %>.</div>
6 <% elsif @election.done? %>
7   <div id="status">Election is finished. <%= link_to "View results",
8   :action => 'results', :id => @election.id %>.</div>
9 <% end %>
10
11 <h2>Overview</h2> 
12
13 <p><strong>Summary</strong></p>
14
15 <blockquote>
16 <%= h(@election.name) %>
17 </blockquote>
18
19 <p><strong>Description</strong></p>
20
21 <blockquote>
22 <%= h(@election.description) %>
23 </blockquote>
24
25 <p><strong>End Date</strong></p>
26
27 <blockquote>
28 <%= @election.enddate %>
29 </blockquote>
30
31 <% unless @election.active %>
32 <p><%= link_to "Edit overview.", :action => 'edit', :id => @election.id %></p>
33 <% end %>
34
35 <h2>Candidates</h2> 
36 <% %>
37 <% unless @election.candidates.empty? %>
38   <%= render :partial => 'candidate_list' %>
39   <% unless @election.active %>
40   <p><%= link_to "Add, remove, or edit candidates.", :action => 'edit_candidates', :id => @election.id %></p>
41   <% end %>
42 <% else %>
43   <p><em>There are currently no candidates registered.  <%= link_to "Add some!", :action => 'edit_candidates', :id => @election.id unless @election.active %></em></p>
44
45 <% end %>
46
47 <h2>Voters</h2>
48
49 <% unless @election.voters.empty? %>
50   <%= render :partial => 'voter_list' %>
51   <%= link_to "Add or remove voters.", :action => 'edit_voters', :id => @election.id unless @election.active %></em></p>
52 <% else %>
53   <p><em>There are currently no voters registered.  <%= link_to "Add some!", :action => 'edit_voters', :id => @election.id unless @election.active %></em></p>
54 <% end %>
55
56 <% unless @election.active? %>
57   <h2>Start Election</h2>
58
59   <% if @election.start_blockers.length > 0 %>
60     <p>Your vote cannot be started for the following reasons:</p>
61     <ul>
62     <% for reason in @election.start_blockers %>
63     <li><%= reason %></li>
64     <% end %>
65     </ul>
66   <% else %>
67     <p>Please check everything carefully on this page before starting this
68     vote. Once you begin the vote, you will <em>not</em> be able to add or
69     change candidates, modify the voting lists, or change the end
70     time.</p>
71
72     <p>When you begin the vote, the following will happen:</p>
73
74     <ul>
75     <li>The vote will be "frozen" so that further edits to the
76         candidate list and voting list cannot occur.</li>
77     <li>All voters will be emailed notifying them that the vote has
78         begun and of their unique login token.</li>
79     </ul>
80
81     <%= button_to 'Start Election!', :action => 'start_election', :id => @election.id %>
82   <% end %>
83
84 <% end %>

Benjamin Mako Hill || Want to submit a patch?