merge from live
[selectricity] / app / views / election / show.rhtml
1 <div id="title-header">
2   <span class="header">Election Overview</span>
3   <span class="subheader"></span>
4 </div>
5
6 <% if @election.active? %>
7   <div id="status">Vote is in currently in progress. Return to
8         this page for results on <%= @election.enddate %>.</div>
9 <% elsif @election.done? %>
10   <div id="status">Election is finished. <%= link_to "View results",
11   :action => 'results', :id => @election.id %>.</div>
12 <% else %>
13   <p style="text-align: right;">
14     <%= link_to "Edit General Information",
15                 :action => 'edit_general_information', :id => @election.id %>
16   </p>
17 <% end %>
18
19 <p><strong>Summary</strong></p>
20
21 <blockquote>
22 <%= h(@election.name) %>
23 </blockquote>
24
25 <p><strong>Description</strong></p>
26
27 <blockquote>
28 <%= h(@election.description) %>
29 </blockquote>
30
31 <p><strong>Additional Information</strong></p>
32
33 <ul> <li>Elections will end at <strong><%= @election.enddate
34 %></strong>.</li> <li>Elections results <strong><% if
35 @election.early_results %>will be<% else %>will not be<% end
36 %></strong> will be visible while election is in progress.</li>
37
38 <% if @election.embeddable %>
39 <li>Elections <strong>will be</strong> embeddable.</li>
40 <% end %>
41
42 </ul>
43
44
45 <div class="normal-header">
46   <span class="header">Candidates</span>
47   <span class="subheader"></span>
48 </div>
49
50
51 <% if not (@election.active? or @election.done?) %>
52   <p style="text-align: right;">
53     <%= link_to "Edit Candidates",
54                :action => 'edit_candidates', :id => @election.id %></p>
55 <% end %>
56
57
58 <% if @election.candidates.empty? %>
59   <p><em>There are currently no candidates registered.</em>
60      <%= link_to "Add some!", :action => 'edit_candidates', :id => @election.id %>
61   </p>
62 <% else %>
63   <%= render :partial => 'candidate_list' %>
64 <% end %>
65
66 <div class="normal-header">
67   <span class="header">Voters</span>
68   <span class="subheader"></span>
69 </div>
70
71 <% if not (@election.active?  or @election.done?) %>
72 <p style="text-align: right;">
73   <%= link_to "Change Voters/Options",
74               :action => 'edit_voters', :id => @election.id %></p>
75 <% end %>
76
77 <% if not @election.authenticated? %>
78   <p><em>This election is open the public.</em></p>
79 <% elsif @election.voters.empty? %>
80   <p><em>There are currently no voters registered. </em>
81      <%= link_to "Add some!", :action => 'edit_voters',
82                  :id => @election.id %></p>
83 <% else %>
84   <%= render :partial => 'voter_list' %>
85   <p><em><%= link_to "Add or remove voters.", :action => 'edit_voters',
86               :id => @election.id unless @election.active? or @election.done? %>
87   </em></p>
88 <% end %>
89
90 <% if not (@election.active? or @election.done?)  %>
91
92 <div class="normal-header">
93   <span class="header">Start Election</span>
94   <span class="subheader"></span>
95 </div>
96
97   <% if @election.start_blockers.length > 0 %>
98     <p>Your vote cannot be started for the following reasons:</p>
99     <ul>
100     <% for reason in @election.start_blockers %>
101     <li><%= reason %></li>
102     <% end %>
103     </ul>
104   <% else %>
105     <p>Please check everything carefully on this page before starting this
106     vote. Once you begin the vote, you will <em>not</em> be able to add or
107     change candidates, modify the voting lists, or change the end
108     time.</p>
109
110     <p>When you begin the vote, the following will happen:</p>
111
112     <ul>
113     <li>The vote will be "frozen" so that further edits to the
114         candidate list and voting list cannot occur.</li>
115     <% if @election.authenticated? %>
116     <li>All voters will be emailed notifying them that the vote has
117         begun and of their unique login token.</li>
118     <% end %>
119     </ul>
120
121     <%= button_to 'Start Election!', :action => 'start_election', :id => @election.id %>
122   <% end %>
123
124 <% elsif @election.embeddable? %>
125
126 <div class="normal-header">
127   <span class="header">Embedding</span>
128   <span class="subheader"></span>
129 </div>
130
131
132 <p>To embed your election, copy and paste the following code into your
133 homepage:</p>
134
135 <pre><%= h("<iframe src='") + votepassword_url(:urlpassword => "open." + @election.id.to_s, :embed => "true") + h("' width='330px' height='370px'>") %>
136 <%= h("</iframe>") %></pre>
137
138 <% end %>

Benjamin Mako Hill || Want to submit a patch?