From 57a193789d1f48a856816c357483cfd7c621cd9d Mon Sep 17 00:00:00 2001
From:
-<%= check_box :election, :embeddable %>
++<%= check_box :election, :verifiable%>
-+
<%= check_box :election, :early_results%>
++<%= check_box :election, :embeddable %>
+ ++Warning: This will let users vote multiple times +from the same computer! +<%= check_box :election, :kiosk%>
+ diff --git a/app/views/election/show.rhtml b/app/views/election/show.rhtml index 5de6081..ff116f4 100644 --- a/app/views/election/show.rhtml +++ b/app/views/election/show.rhtml @@ -51,12 +51,31 @@Link
-<%= (link_to ("Go Vote!", - :controller => 'voter', :action => 'index', :election_id => @election.id)).to_s %> +Link to election:
+Description:
<%= @voter.election.description %>
+<% if @voter.election.authenticated? %><%= @voter.email %>
diff --git a/app/views/voter/kiosk_ready.rhtml b/app/views/voter/kiosk_ready.rhtml new file mode 100644 index 0000000..7773dd8 --- /dev/null +++ b/app/views/voter/kiosk_ready.rhtml @@ -0,0 +1,9 @@ +Selectricity is running in kiosk mode and is ready for the next +voter. Press the button below to generate a new ballot.
+ +<%= button_to "Vote!", :action => "index", :urlpassword => @password, :kiosk => true %>
diff --git a/db/migrate/20090607094837_kiosk_mode.rb b/db/migrate/20090607094837_kiosk_mode.rb new file mode 100644 index 0000000..57ea98d --- /dev/null +++ b/db/migrate/20090607094837_kiosk_mode.rb @@ -0,0 +1,18 @@ +class KioskMode < ActiveRecord::Migration + def self.up + add_column :elections, :kiosk, :boolean, + :null => false, :default => false + add_column :elections, :verifiable, :boolean, + :null => false, :default => true + + Election.find(:all).select {|e| e.class == QuickVote }.each do |e| + e.verifiable = false + e.save + end + end + + def self.down + remove_column :elections, :kiosk + remove_column :elections, :verifiable + end +end diff --git a/db/schema.rb b/db/schema.rb index c30d3f6..0d99d2e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,7 +9,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 3) +ActiveRecord::Schema.define(:version => 3) do create_table "candidates", :force => true do |t| t.integer "election_id", :null => false @@ -18,34 +18,38 @@ ActiveRecord::Schema.define(:version => 3) end create_table "elections", :force => true do |t| - t.string "name", :limit => 100, :null => false - t.text "description", :null => false - t.integer "anonymous", :limit => 1, :default => 1, :null => false + t.string "name", :limit => 100, :null => false + t.text "description", :null => false + t.integer "anonymous", :limit => 1, :default => 1, :null => false t.datetime "startdate" - t.datetime "enddate", :null => false - t.integer "active", :limit => 1, :default => 0, :null => false - t.integer "viewable", :limit => 1, :default => 1, :null => false - t.integer "notices", :limit => 1, :default => 0, :null => false + t.datetime "enddate", :null => false + t.integer "active", :limit => 1, :default => 0, :null => false + t.integer "viewable", :limit => 1, :default => 1, :null => false + t.integer "notices", :limit => 1, :default => 0, :null => false t.integer "user_id" t.string "quickuser" - t.string "election_method", :limit => 100, :default => "ssd" - t.string "type", :limit => 100, :null => false - t.boolean "embeddable", :default => false, :null => false - t.boolean "authenticated", :default => true, :null => false - t.boolean "early_results", :default => false, :null => false + t.string "election_method", :limit => 100, :default => "ssd" + t.string "type", :limit => 100, :null => false + t.boolean "embeddable", :default => false, :null => false + t.boolean "authenticated", :default => true, :null => false + t.boolean "early_results", :default => false, :null => false + t.string "embed_custom_string" end add_index "elections", ["user_id"], :name => "fk_user_election" create_table "pictures", :force => true do |t| - t.string "filename", :limit => 200 - t.binary "data" - t.string "filetype", :limit => 100 - t.integer "candidate_id" + t.string "filename" + t.string "content_type" + t.integer "size" + t.integer "width" + t.integer "height" + t.integer "parent_id" + t.string "thumbnail" + t.datetime "created_at" + t.integer "candidate_id" end - add_index "pictures", ["candidate_id"], :name => "fk_candidate_picture" - create_table "rankings", :force => true do |t| t.integer "vote_id" t.integer "candidate_id" -- 2.39.5