committed css changes from courtland fixing some headerbar wonkiness
[selectricity] / app / views / quickvote / create.rhtml
index 7074218ecd17e5a336b9b4cd9195986a2d84f837..c05424e119bfac8b521e12eb8cd87c4916230c96 100644 (file)
@@ -1,46 +1,68 @@
-<% -%>
-<h1>Create QuickVote</h1>
+<div id="title-header">
+       <span class="header">Quickvote</span>
+       <span class="subheader">Create New QuickVote</span>
+</div>
 
-<%= error_messages_for 'quickvote' %>
+<p><label for="quickvote_candidate_names">Choices</p>
 
-<% if @quickvote %>
-<p>Please review the data you've entered and confirm. The candidates for
-the election submitted include:</p>
+<!-- the list of candidates -->
+<div id="candidate_names">
+<%= render :partial => 'candidate_list' %>
+</div>
 
-<ul>
-<% for candidate in @quickvote.raw_candidates %>
-  <li><%= candidate %></li>
-<% end %>
-</ul>
+<% form_tag(:action => 'create') do %>
+<!--[form:election]-->
+<p><label for="quickvote_name">One Word Description (for URL)</label></p>
 
-<% end %>
+<p>required; 5-12 characters; only letters and numbers; no spaces</p>
 
-<%= form_tag :action => 'create' %>
-<!--[form:election]-->
+<p><%= text_field 'quickvote', 'name', :size => 15, :maxsize => 12  %></p>
+
+<p><label for="quickvote_description">Description</label></p>
+
+<p><font size="-1">required; free-form</font></em><br/>
+
+<%= text_field 'quickvote', 'description', :size => 50 %></p>
 
-<p><label for="quickvote_name">Vote Name<br />
+<div id="advanced" style="display: none">
+  <div class="normal-header">
+    <span class="header">Advanced Options</span>
+    <span class="subheader"></span>
+  </div>
+  <div class="clear-div"></div>
 
-<em><font size="-1">Required; 5-12 characters; only letters and numbers; no spaces</font></em></label><br/>
+  <% fields_for 'quickvote', @quickvote do |quickform| %>
 
-<%= text_field 'quickvote', 'name'  %></p>
+    <p><label for="quickvote_election_method">Election Method</label></p>
 
-<p><label for="quickvote_description">Description <em><font
-size="-1">Optional</font></em></label><br/>
+    <p><%= quickform.select('election_method', 
+        %w(ssd condorcet plurality approval borda) ) %></p>
 
-<%= text_area 'quickvote', 'description', :rows => 2 %></p>
+    <p><label for="quickvote_enddate">End Time</label></p>
+    <p><%= quickform.date_select(:enddate, :start_year => Time.now.year) %></p>
 
-<p><label for="quickvote_candidatelist">Choices/Candidates<em><br />
-<font size="-1">Seperate choices with a ";". At least two are required.</font></em></label><br/>
+    <p><label for="quickvote_visibility">Visibility</label></p>
 
-<%= text_area 'quickvote', 'candidatelist', :rows => 3 %></p>
+    <p>Do you want the results to be visible while the election is active?</p>
 
-<p><% if @quickvote -%>
-     <%= submit_tag "Confirm" -%>
-     <%= hidden_field :quickvote, :reviewed, :value => 1 %>
-   <% else %>
-     <%= submit_tag "Create QuickVote" -%>
-   <%- end -%>
-</p>
+    <p>Yes <%= quickform.radio_button(:viewable, 1)%>
+       No  <%= quickform.radio_button(:viewable, 0)%></p>
 
-<%= end_form_tag %>
+    <% if session[:user] %>
+      <p>Notification</p>
+
+      <p>Would you like to be e-mailed when this QuickVote concludes?</p>
+
+      <p>Yes <%= quickform.radio_button(:notices, 1)%>
+         No  <%= quickform.radio_button(:notices, 0)%></p>
+    <% end -%>
+
+  <% end %>
+
+</div>
+<br />
+
+<p><%= submit_tag "Create Quickvote" -%></p>
+
+<% end %>
 

Benjamin Mako Hill || Want to submit a patch?