diff --git a/Gemfile b/Gemfile index f3dc73c1..4df6a25f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'rails', '3.2.11' +gem 'rails', '3.2.15' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' @@ -36,8 +36,9 @@ end gem 'will_paginate' gem 'paperclip', '~> 3.0' gem 'jquery-rails' +gem 'jquery-ui-rails' gem 'jquery-fileupload-rails' -gem 'devise' +gem 'devise', '~> 2.2' gem 'cancan' gem "haml" gem 'bcrypt-ruby', '~> 3.0.0' diff --git a/Gemfile.lock b/Gemfile.lock index e95ca596..d4ac419f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,34 +2,34 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.0.2) - actionmailer (3.2.11) - actionpack (= 3.2.11) - mail (~> 2.4.4) - actionpack (3.2.11) - activemodel (= 3.2.11) - activesupport (= 3.2.11) + actionmailer (3.2.15) + actionpack (= 3.2.15) + mail (~> 2.5.4) + actionpack (3.2.15) + activemodel (= 3.2.15) + activesupport (= 3.2.15) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) - rack (~> 1.4.0) + rack (~> 1.4.5) rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.2.1) active_model_serializers (0.8.1) activemodel (>= 3.0) - activemodel (3.2.11) - activesupport (= 3.2.11) + activemodel (3.2.15) + activesupport (= 3.2.15) builder (~> 3.0.0) - activerecord (3.2.11) - activemodel (= 3.2.11) - activesupport (= 3.2.11) + activerecord (3.2.15) + activemodel (= 3.2.15) + activesupport (= 3.2.15) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activeresource (3.2.11) - activemodel (= 3.2.11) - activesupport (= 3.2.11) - activesupport (3.2.11) - i18n (~> 0.6) + activeresource (3.2.15) + activemodel (= 3.2.15) + activesupport (= 3.2.15) + activesupport (3.2.15) + i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) acts_as_commentable_with_threading (1.1.3) activerecord (>= 3.0) @@ -39,15 +39,15 @@ GEM arel (3.0.2) awesome_nested_set (2.1.6) activerecord (>= 3.0.0) - axlsx (1.3.6) + axlsx (2.0.1) htmlentities (~> 4.3.1) nokogiri (>= 1.4.1) - rubyzip (>= 0.9.5) - axlsx_rails (0.1.4) + rubyzip (~> 1.0.0) + axlsx_rails (0.1.5) axlsx rails (>= 3.1) bcrypt-ruby (3.0.1) - bootstrap-sass (2.3.2.0) + bootstrap-sass (2.3.2.2) sass (~> 3.2) builder (3.0.4) cancan (1.6.10) @@ -62,12 +62,12 @@ GEM ffi (~> 1.0, >= 1.0.11) climate_control (0.0.3) activesupport (>= 3.0) - cocaine (0.5.1) + cocaine (0.5.2) climate_control (>= 0.0.3, < 1.0) - cocoon (1.1.2) + cocoon (1.2.1) coderay (1.0.9) daemons (1.1.9) - devise (2.2.4) + devise (2.2.7) bcrypt-ruby (~> 3.0) orm_adapter (~> 0.1) railties (~> 3.1) @@ -75,47 +75,46 @@ GEM diff-lcs (1.1.3) erubis (2.7.0) eventmachine (1.0.3) - execjs (1.4.0) - multi_json (~> 1.0) + execjs (2.0.2) ffi (1.9.0) formtastic (2.2.1) actionpack (>= 3.0) - formtastic-bootstrap (2.1.1) + formtastic-bootstrap (2.1.3) formtastic (~> 2.2) gravtastic (3.2.6) - haml (4.0.2) + haml (4.0.3) tilt - hashery (2.1.0) - hike (1.2.2) + hashery (2.1.1) + hike (1.2.3) htmlentities (4.3.1) - i18n (0.6.4) + i18n (0.6.5) journey (1.0.4) jquery-fileupload-rails (0.4.1) actionpack (>= 3.1) railties (>= 3.1) - jquery-rails (2.2.1) + jquery-rails (3.0.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - json (1.8.0) - libv8 (3.11.8.17) - mail (2.4.4) - i18n (>= 0.4.0) + jquery-ui-rails (4.0.5) + railties (>= 3.1.0) + json (1.8.1) + libv8 (3.16.14.3) + mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) - method_source (0.8.1) - mime-types (1.23) - mini_portile (0.5.0) - multi_json (1.7.3) - mysql2 (0.3.11) + method_source (0.8.2) + mime-types (1.25) + mini_portile (0.5.1) + multi_json (1.8.2) + mysql2 (0.3.13) nokogiri (1.6.0) mini_portile (~> 0.5.0) orm_adapter (0.4.0) - paper_trail (2.7.1) + paper_trail (2.7.2) activerecord (~> 3.0) railties (~> 3.0) - paperclip (3.4.1) + paperclip (3.5.1) activemodel (>= 3.0.0) - activerecord (>= 3.0.0) activesupport (>= 3.0.0) cocaine (~> 0.5.0) mime-types @@ -143,22 +142,22 @@ GEM rack rack-test (0.6.2) rack (>= 1.0) - rails (3.2.11) - actionmailer (= 3.2.11) - actionpack (= 3.2.11) - activerecord (= 3.2.11) - activeresource (= 3.2.11) - activesupport (= 3.2.11) + rails (3.2.15) + actionmailer (= 3.2.15) + actionpack (= 3.2.15) + activerecord (= 3.2.15) + activeresource (= 3.2.15) + activesupport (= 3.2.15) bundler (~> 1.0) - railties (= 3.2.11) - railties (3.2.11) - actionpack (= 3.2.11) - activesupport (= 3.2.11) + railties (= 3.2.15) + railties (3.2.15) + actionpack (= 3.2.15) + activesupport (= 3.2.15) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - rake (10.0.4) + rake (10.1.0) rdoc (3.12.2) json (~> 1.4) ref (1.0.5) @@ -176,26 +175,26 @@ GEM railties (>= 3.0) rspec (~> 2.11.0) ruby-rc4 (0.1.5) - rubyzip (0.9.9) - sass (3.2.5) - sass-rails (3.2.5) + rubyzip (1.0.0) + sass (3.2.12) + sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - selenium-webdriver (2.33.0) + selenium-webdriver (2.37.0) childprocess (>= 0.2.5) multi_json (~> 1.0) - rubyzip + rubyzip (~> 1.0.0) websocket (~> 1.0.4) - slop (3.4.5) + slop (3.4.6) sprockets (2.2.2) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.7) - therubyracer (0.11.4) - libv8 (~> 3.11.8.12) + sqlite3 (1.3.8) + therubyracer (0.12.0) + libv8 (~> 3.16.14.0) ref thin (1.5.1) daemons (>= 1.0.9) @@ -203,19 +202,19 @@ GEM rack (>= 1.0.0) thor (0.18.1) tilt (1.4.1) - transitions (0.1.8) - treetop (1.4.12) + transitions (0.1.11) + treetop (1.4.15) polyglot polyglot (>= 0.3.1) ttfunk (1.0.3) - tzinfo (0.3.37) - uglifier (2.1.1) + tzinfo (0.3.38) + uglifier (2.2.1) execjs (>= 0.3.0) multi_json (~> 1.0, >= 1.0.2) - warden (1.2.1) + warden (1.2.3) rack (>= 1.0) websocket (1.0.7) - will_paginate (3.0.4) + will_paginate (3.0.5) xpath (0.1.4) nokogiri (~> 1.3) @@ -231,19 +230,20 @@ DEPENDENCIES cancan capybara (= 1.1.2) cocoon - devise + devise (~> 2.2) formtastic-bootstrap gravtastic haml jquery-fileupload-rails jquery-rails + jquery-ui-rails mysql2 paper_trail paperclip (~> 3.0) prawn prawn_rails pry - rails (= 3.2.11) + rails (= 3.2.15) rspec-rails (= 2.11.0) sass-rails (~> 3.2.3) sqlite3 diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 1eb791b1..288f730d 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,7 +12,7 @@ // //= require jquery //= require jquery_ujs -//= require jquery-ui +//= require jquery.ui.all //= require jquery-fileupload //= require jquery-ui-timepicker-addon //= require jquery.dataTables diff --git a/app/controllers/admin/stats_controller.rb b/app/controllers/admin/stats_controller.rb index f83bb675..29b08d84 100644 --- a/app/controllers/admin/stats_controller.rb +++ b/app/controllers/admin/stats_controller.rb @@ -28,20 +28,22 @@ class Admin::StatsController < ApplicationController @mydays = [] @mytickets = [] - (@conference.registration_start_date..@conference.end_date).each do |day| - day_reg_count = @registrations.where("created_at LIKE '%#{day}%' ").count - day_ticket_count = @tickets.where("supporter_registrations.created_at LIKE '%#{day}%' ").count - if day_reg_count != 0 - @mydays << {"status" => "#{day}", "value" => day_reg_count} - end - @conference.supporter_levels.each do |level| - day_ticket_count = @tickets.where("supporter_registrations.created_at LIKE ? AND supporter_levels.title LIKE ?", "%#{day}%", "%#{level.title}%").count - if day_ticket_count !=0 - @mytickets << {"status" => "#{day}", "ticket" => "#{level}", "value" => day_ticket_count} + if @conference.registration_start_date and @conference.end_date + (@conference.registration_start_date..@conference.end_date).each do |day| + day_reg_count = @registrations.where("created_at LIKE '%#{day}%' ").count + day_ticket_count = @tickets.where("supporter_registrations.created_at LIKE '%#{day}%' ").count + if day_reg_count != 0 + @mydays << {"status" => "#{day}", "value" => day_reg_count} + end + @conference.supporter_levels.each do |level| + day_ticket_count = @tickets.where("supporter_registrations.created_at LIKE ? AND supporter_levels.title LIKE ?", "%#{day}%", "%#{level.title}%").count + if day_ticket_count !=0 + @mytickets << {"status" => "#{day}", "ticket" => "#{level}", "value" => day_ticket_count} + end end end end - + @other_info = [ {"status" => "with partner (registered)", "value" => @registered_with_partner}, {"status" => "with partner (attended)", "value" => @attended_with_partner}, diff --git a/app/views/admin/stats/_registrations.html.haml b/app/views/admin/stats/_registrations.html.haml index 53abef12..f216dbac 100644 --- a/app/views/admin/stats/_registrations.html.haml +++ b/app/views/admin/stats/_registrations.html.haml @@ -1,6 +1,9 @@ .row-fluid .span4 - %h4{:style => "text-indent: 25px"}= "Registrations - Attendees (#{(@attendees.to_f / @registered * 100).round}%)" + - if @attendees > 0 + %h4{:style => "text-indent: 25px"}= "Registrations - Attendees (#{(@attendees.to_f / @registered * 100).round }%)" + - else + %h4{:style => "text-indent: 25px"}= "Registrations - Attendees" .row-fluid .span12#registrations_attendees diff --git a/db/migrate/20131022131450_add_created_at_to_supporter_registrations.rb b/db/migrate/20131022131450_add_created_at_to_supporter_registrations.rb new file mode 100644 index 00000000..9ec2317a --- /dev/null +++ b/db/migrate/20131022131450_add_created_at_to_supporter_registrations.rb @@ -0,0 +1,5 @@ +class AddCreatedAtToSupporterRegistrations < ActiveRecord::Migration + def change + add_column :supporter_registrations, :created_at, :datetime + end +end diff --git a/db/schema.rb b/db/schema.rb index 75658aca..7e6d2465 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,16 +11,19 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130712072609) do +ActiveRecord::Schema.define(:version => 20131022131450) do create_table "call_for_papers", :force => true do |t| - t.date "start_date", :null => false - t.date "end_date", :null => false - t.date "hard_deadline", :null => false - t.text "description", :null => false + t.date "start_date", :null => false + t.date "end_date", :null => false + t.date "hard_deadline", :null => false + t.text "description", :null => false t.integer "conference_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "schedule_changes", :default => false + t.integer "rating" + t.text "rating_desc" end create_table "comments", :force => true do |t| @@ -227,13 +230,14 @@ ActiveRecord::Schema.define(:version => 20130712072609) do end create_table "supporter_registrations", :force => true do |t| - t.integer "registration_id" - t.integer "supporter_level_id" - t.integer "conference_id" - t.string "name" - t.string "email" - t.string "code" - t.boolean "code_is_valid", :default => false + t.integer "registration_id" + t.integer "supporter_level_id" + t.integer "conference_id" + t.string "name" + t.string "email" + t.string "code" + t.boolean "code_is_valid", :default => false + t.datetime "created_at" end create_table "tracks", :force => true do |t| @@ -293,4 +297,12 @@ ActiveRecord::Schema.define(:version => 20130712072609) do add_index "versions", ["item_type", "item_id"], :name => "index_versions_on_item_type_and_item_id" + create_table "votes", :force => true do |t| + t.integer "person_id" + t.integer "event_id" + t.integer "rating" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + end