X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/c933ff40da110253bc4c474d9c79c3a4ed98721d..cfe645440c51b66c088f19e84de650f026cf77f5:/app/views/election/show.rhtml
diff --git a/app/views/election/show.rhtml b/app/views/election/show.rhtml
index 954e480..39621bf 100644
--- a/app/views/election/show.rhtml
+++ b/app/views/election/show.rhtml
@@ -1,18 +1,175 @@
-<% %>
-
Information On <%= @election.name %>
+
+<% if @election.enddate < Time.now %>
+Election is finished. <%= link_to "View results",
+ :controller => 'voter', :action => 'index',
+ :election_id => @election.id %>.
-Overview <%= link_to "edit", :action => 'edit', :id => @election.id %>
+<% elsif (@election.active? && @election.early_results? ) %>
+ You have decided that the results
+ should be viewable while the election is in progress.
+ <%if @election.voters.select {|v| v.vote.confirmed?}.empty? %>
+ However, no one has voted yet.
+ <% else %>
+ <%= link_to "View results", :controller => 'election', :action => 'results',
+ :id => @election.id %>.
+ <% end %>
+
+<% elsif @election.active? %>
+ Vote is in currently in progress. Return to
+ this page for results on <%= @election.enddate %>.
+
+<% else %>
+
+ <%= link_to "Edit General Information",
+ :action => 'edit_general_information', :id => @election.id %>
+
+<% end %>
+
+Summary
+
+
+<%= h(@election.name) %>
+
Description
-<%= @election.description %>
+<%= h(@election.description) %>
-Candidates <%= link_to "edit", :action => 'edit_candidates', :id => @election.id %>
+Additional Information
+
+ - Elections will end at <%= @election.enddate
+%>.
- Elections results <% if
+@election.early_results %>will be<% else %>will not be<% end
+%> visible while election is in progress.
+
+<% if @election.embeddable %>
+- Elections will be embeddable.
+<% end %>
+
+<% if @election.kiosk %>
+- Selectricity's kiosk mode will be available.
+<% end %>
+
+<% if @election.verifiable%>
+- Voters will be given tokens to verify their votes.
+<% else %>
+- Elections will not be voter verifiable.
+<% end %>
+
+
+
+<% if @election.active? and not @election.authenticated? %>
+Link to election:
+
+- <%= (link_to ("Vote in election",
+ :controller => 'voter', :action => 'index', :election_id => @election.id)).to_s %>
+ (<%= votepassword_url(:urlpassword => "open." + @election.id.to_s) %>)
+
+<% if @election.kiosk %>
+- <%= link_to("Kiosk mode",
+ kiosk_ready_url(:urlpassword => "open." + @election.id.to_s,
+ :kiosk => true)) %>
+ (<%= kiosk_ready_url(:urlpassword => "open." + @election.id.to_s, :kiosk => true) %>)
+ <% end %>
+
+<% end -%>
+
+
+
+
+<% if not (@election.active? or @election.done?) %>
+
+ <%= link_to "Edit Candidates",
+ :action => 'edit_candidates', :id => @election.id %>
+<% end %>
+
+
+<% if @election.candidates.empty? %>
+ There are currently no candidates registered.
+ <%= link_to "Add some!", :action => 'edit_candidates', :id => @election.id %>
+
+<% else %>
+ <%= render :partial => 'candidate_list' %>
+<% end %>
+
+
+
+<% if not (@election.active? or @election.done?) %>
+
+ <%= link_to "Change Voters/Options",
+ :action => 'edit_voters', :id => @election.id %>
+<% end %>
+
+<% if not @election.authenticated? %>
+ This election is open the public.
+<% elsif @election.voters.empty? %>
+ There are currently no voters registered.
+ <%= link_to "Add some!", :action => 'edit_voters',
+ :id => @election.id %>
+<% else %>
+ <%= render :partial => 'voter_list' %>
+ <%= link_to "Add or remove voters.", :action => 'edit_voters',
+ :id => @election.id unless @election.active? or @election.done? %>
+
+<% end %>
+
+<% if not (@election.active? or @election.done?) %>
+
+
+
+ <% if @election.start_blockers.length > 0 %>
+ Your vote cannot be started for the following reasons:
+
+ <% for reason in @election.start_blockers %>
+ - <%= reason %>
+ <% end %>
+
+ <% else %>
+ Please check everything carefully on this page before starting this
+ vote. Once you begin the vote, you will not be able to add or
+ change candidates, modify the voting lists, or change the end
+ time.
+
+ When you begin the vote, the following will happen:
+
+
+ - The vote will be "frozen" so that further edits to the
+ candidate list and voting list cannot occur.
+ <% if @election.authenticated? %>
+ - All voters will be emailed notifying them that the vote has
+ begun and of their unique login token.
+ <% end %>
+
+
+ <%= button_to 'Start Election!', :action => 'start_election', :id => @election.id %>
+ <% end %>
+
+<% elsif @election.embeddable? %>
+
+
+
-<%= render :partial => 'candidate_list' %>
+To embed your election, copy and paste the following code into your
+homepage:
-Voters <%= link_to "edit", :action => 'edit_voters', :id => @election.id %>
+<%= h("") %>
-<%= render :partial => 'voter_list' %>
+<% end %>