]> projects.mako.cc - selectricity-live/blob - app/views/quickvote/create.rhtml
Conditional that redircts to user profile page if too many elections in control panel...
[selectricity-live] / app / views / quickvote / create.rhtml
1 <div id="title-header">
2         <span class="header">Quickvote</span>
3         <span class="subheader">Create New QuickVote</span>
4 </div>
5
6 <p><label for="quickvote_candidate_names">Choices</p>
7
8 <!-- the list of candidates -->
9 <div id="candidate_names">
10 <%= render :partial => 'candidate_list' %>
11 </div>
12
13 <% form_tag(:action => 'create') do %>
14 <!--[form:election]-->
15 <p><label for="quickvote_name">One Word Description (for URL)</label></p>
16
17 <p>required; 5-12 characters; only letters and numbers; no spaces</p>
18
19 <p><%= text_field 'quickvote', 'name', :size => 15, :maxsize => 12  %></p>
20
21 <p><label for="quickvote_description">Description</label></p>
22
23 <p><font size="-1">required; free-form</font></em><br/>
24
25 <%= text_field 'quickvote', 'description', :size => 50 %></p>
26
27 <div id="advanced" style="display: none">
28   <div class="normal-header">
29     <span class="header">Advanced Options</span>
30     <span class="subheader"></span>
31   </div>
32   <div class="clear-div"></div>
33
34   <% fields_for 'quickvote', @quickvote do |quickform| %>
35
36     <p><label for="quickvote_election_method">Election Method</label></p>
37
38 <!--
39 <% type_hash = {}; ELECTION_TYPES.each {|k,v| type_hash[v] = k} %>
40 <%= select_tag 'election_election_method', options_for_select(type_hash, @quickvote.election_method) %></p>
41 -->
42     <p><%= quickform.select('election_method', 
43         %w(ssd condorcet plurality approval borda) ) %></p>
44
45     <p><label for="quickvote_enddate">End Time</label></p>
46     <p><%= quickform.date_select(:enddate, :start_year => Time.now.year) %></p>
47
48     <p><label for="quickvote_visibility">Visibility</label></p>
49
50     <p>Do you want the results to be visible while the election is active?</p>
51
52     <p>Yes <%= quickform.radio_button(:viewable, 1)%>
53        No  <%= quickform.radio_button(:viewable, 0)%></p>
54
55     <% if session[:user] %>
56       <p>Notification</p>
57
58       <p>Would you like to be e-mailed when this QuickVote concludes?</p>
59
60       <p>Yes <%= quickform.radio_button(:notices, 1)%>
61          No  <%= quickform.radio_button(:notices, 0)%></p>
62     <% end -%>
63
64   <% end %>
65
66 </div>
67 <br />
68
69 <p><%= submit_tag "Create Quickvote" -%></p>
70
71 <% end %>
72

Benjamin Mako Hill || Want to submit a patch?