Mostly worked on the candidate adding feature to include pictures and
[selectricity] / app / views / election / edit_candidates.rhtml
index 0c416d5ee071cb757a11c9b3ff73e10869b23333..b5f06ff31856dd1e0822ed12cf5388f353a7509f 100644 (file)
@@ -1,14 +1,16 @@
-<% @edit = true %>
 <h1><strong><%= @election.name %>:</strong> Edit Candidates</h1>
 
-<p>The following are valid options or candidates in this election:</p>
+<% unless @election.candidates.empty? %>
+  <p>The following are valid options or candidates in this election:</p>
 
-<ul>
-<% @election.candidates.each do |candidate| %>
-   <% @candidate = candidate %>
-   <%= render :partial => 'candidate_line' %>
-<% end %>
-</ul>
+  <% @election.candidates.each do |candidate| %>
+    <% @current_candidate = candidate %>
+    <%= render :partial => 'candidate_line_edit' %>
+  <% end %>
 
+<% else %>
+  <p>There are no candidates registered for this election.</p>
+<% end %>
+<p>Please enter new candidates below.</p>
 <%= render :partial => 'candidates_form' %>
 <%= button_to "Done!", :action => 'show', :id => @election %>

Benjamin Mako Hill || Want to submit a patch?