<div id="links">
<% if session[:user] %>
Welcome <strong><%= User.find(session[:user]).login.capitalize %></strong>
+ <%= link_to("Logout", :controller => "account", :action => "logout") %> |
<% else %>
<%= link_to("Login", :controller => "account", :action => "login")
%>/<%= link_to("Sign up", :controller => "account", :action => "signup")%>
<% end %> |
-
- <% if session[:user] %>
- <%= link_to("Logout", :controller => "account", :action => "logout") %> |
- <% end %>
<%= link_to("Help/About", :controller => "site", :action => "about") %>
</div>
<span><label for="quickvote_enddate">End Time</span><br />
<%= quickform.date_select(:enddate, :start_year => Time.now.year) %><br />
+</p>Want the results to be visible while the election is active?
+Yes <%= quickform.radio_button(:viewable, 1)%>
+No <%= quickform.radio_button(:viewable, 0)%></p>
+
+<% if session[:user] %>
+<p>Would you like to be e-mailed when this QuickVote concludes?
+Yes <%= quickform.radio_button(:notices, 1)%>
+No <%= quickform.radio_button(:notices, 0)%></p>
+<% end -%>
+
<% end %>
<% @myqvs.each do |quickvote| %>
<tr>
- <td>
- <%= link_to "#{quickvote.name}",
- quickaction_url( :ident => quickvote.name, :action => 'results' ) %>
+ <td>
+ <% if quickvote.active == 1 %>
+ <%= link_to "#{quickvote.name}",
+ quickaction_url( :ident => quickvote.name,
+ :action => 'results' ) %>
+ <% else %>
+ <%= quickvote.name %>
+ <% end %>
</td>
<td><%= quickvote.startdate.strftime("%x") %></td>
<td><%= quickvote.enddate.strftime("%x") %></td>
- <td><%= quickvote.description %>
+ <td><%= quickvote.description %></td>
</tr>
<% end %>
</table>
ActiveRecord::Schema.define() do
create_table "candidates", :force => true do |t|
- t.column "election_id", :integer, :null => false
- t.column "name", :string, :limit => 100, :default => "", :null => false
- t.column "description", :text
+ t.column "election_id", :integer, :null => false
+ t.column "name", :string, :limit => 100, :default => "", :null => false
+ t.column "description", :text
+ t.column "picture_filename", :string, :limit => 200
+ t.column "picture_data", :binary
+ t.column "picture_type", :string, :limit => 100
end
create_table "elections", :force => true do |t|
t.column "startdate", :datetime
t.column "enddate", :datetime, :null => false
t.column "active", :integer, :limit => 4, :default => 0, :null => false
+ t.column "viewable", :integer, :limit => 4, :default => 1, :null => false
+ t.column "notices", :integer, :limit => 4, :default => 0, :null => false
t.column "user_id", :integer
t.column "quickuser", :string
t.column "election_method", :string, :limit => 100, :default => "ssd"
add_index "elections", ["user_id"], :name => "fk_user_election"
- create_table "pictures", :force => true do |t|
- t.column "filename", :string, :limit => 200
- t.column "data", :binary
- t.column "filetype", :string, :limit => 100
- t.column "candidate_id", :integer
- end
-
- add_index "pictures", ["candidate_id"], :name => "fk_candidate_picture"
-
create_table "rankings", :force => true do |t|
t.column "vote_id", :integer
t.column "candidate_id", :integer