From 80bf3499bec2cadcd6cb703bf919fe524cbf2d69 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 19 Jun 2013 17:16:52 +0800 Subject: [PATCH] Calendar fixed... all views fixed plus event loading fixed and also agenda view fixed. --- .gitignore | 1 + Gemfile.lock | 409 ------------------ config/mongoid.yml | 24 - .../app/assets/javascripts/calendarAPI.js.erb | 13 +- .../calendar/back_end/cals_controller.rb | 7 +- .../calendar/back_end/events_controller.rb | 5 +- 6 files changed, 20 insertions(+), 439 deletions(-) delete mode 100644 Gemfile.lock delete mode 100644 config/mongoid.yml diff --git a/.gitignore b/.gitignore index 798150e7..9243ca71 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ uploads/**/* .sass-cache/* *.supported +mongoid.yml diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index e4750c63..00000000 --- a/Gemfile.lock +++ /dev/null @@ -1,409 +0,0 @@ -GIT - remote: git://github.com/amatsuda/kaminari.git - revision: 2e09b5374fec33b57c6387ca7bac89ecaa60c9eb - specs: - kaminari (0.14.1) - actionpack (>= 3.0.0) - activesupport (>= 3.0.0) - -GIT - remote: git://github.com/charlotte-ruby/impressionist.git - revision: 0894f6a550a33f83f4937d655e9f0774521781e4 - specs: - impressionist (1.2.0) - httpclient (~> 2.2) - nokogiri (~> 1.5) - -GEM - remote: http://rubygems.org/ - specs: - actionmailer (3.2.12) - actionpack (= 3.2.12) - mail (~> 2.4.4) - actionpack (3.2.12) - activemodel (= 3.2.12) - activesupport (= 3.2.12) - builder (~> 3.0.0) - erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.5) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.2.1) - activemodel (3.2.12) - activesupport (= 3.2.12) - builder (~> 3.0.0) - activerecord (3.2.12) - activemodel (= 3.2.12) - activesupport (= 3.2.12) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.12) - activemodel (= 3.2.12) - activesupport (= 3.2.12) - activesupport (3.2.12) - i18n (~> 0.6) - multi_json (~> 1.0) - arel (3.0.2) - attr_required (0.0.5) - bcrypt-ruby (3.0.0) - binding_of_caller (0.7.1) - debug_inspector (>= 0.0.1) - bourne (1.1.2) - mocha (= 0.10.5) - brakeman (1.9.2) - erubis (~> 2.6) - fastercsv (~> 1.5) - haml (~> 3.0) - highline (~> 1.6) - multi_json (~> 1.2) - ruby2ruby (~> 2.0) - ruby_parser (~> 3.1.1) - sass (~> 3.0) - terminal-table (~> 1.4) - bson (1.8.2) - bson_ext (1.8.2) - bson (~> 1.8.2) - builder (3.0.4) - capybara (2.0.2) - mime-types (>= 1.16) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - selenium-webdriver (~> 2.0) - xpath (~> 1.0.0) - carrierwave (0.6.2) - activemodel (>= 3.2.0) - activesupport (>= 3.2.0) - carrierwave-mongoid (0.2.2) - carrierwave (~> 0.6.1) - mongoid (~> 2.1) - childprocess (0.3.8) - ffi (~> 1.0, >= 1.0.11) - chinese_pinyin (0.4.1) - chronic (0.9.0) - coderay (1.0.9) - coffee-rails (3.2.2) - coffee-script (>= 2.2.0) - railties (~> 3.2.0) - coffee-script (2.2.0) - coffee-script-source - execjs - coffee-script-source (1.4.0) - columnize (0.3.6) - database_cleaner (0.9.1) - debug_inspector (0.0.2) - debugger (1.2.4) - columnize (>= 0.3.1) - debugger-linecache (~> 1.1.1) - debugger-ruby_core_source (~> 1.1.7) - debugger-linecache (1.1.2) - debugger-ruby_core_source (>= 1.1.1) - debugger-ruby_core_source (1.1.8) - delorean (2.1.0) - chronic - devise (1.5.3) - bcrypt-ruby (~> 3.0) - orm_adapter (~> 0.0.3) - warden (~> 1.1) - diff-lcs (1.1.3) - encrypted_strings (0.3.3) - erubis (2.7.0) - exception_notification (3.0.1) - actionmailer (>= 3.0.4) - execjs (1.4.0) - multi_json (~> 1.0) - factory_girl (4.2.0) - activesupport (>= 3.0.0) - factory_girl_rails (4.2.1) - factory_girl (~> 4.2.0) - railties (>= 3.0.0) - faker (1.1.2) - i18n (~> 0.5) - fastercsv (1.5.5) - fattr (2.2.1) - fb_graph (2.6.4) - httpclient (>= 2.2.0.2) - multi_json (>= 1.3) - rack-oauth2 (>= 0.14.4) - tzinfo - ffi (1.4.0) - haml (3.1.8) - highline (1.6.15) - hike (1.2.1) - httpclient (2.3.2) - i18n (0.6.1) - journey (1.0.4) - jquery-rails (2.1.4) - railties (>= 3.0, < 5.0) - thor (>= 0.14, < 2.0) - jquery-ui-rails (4.0.1) - jquery-rails - railties (>= 3.1.0) - json (1.7.7) - mail (2.4.4) - i18n (>= 0.4.0) - mime-types (~> 1.16) - treetop (~> 1.4.8) - metaclass (0.0.1) - method_source (0.8.1) - mime-types (1.21) - mini_magick (3.5.0) - subexec (~> 0.2.1) - mocha (0.10.5) - metaclass (~> 0.0.1) - mongo (1.8.2) - bson (~> 1.8.2) - mongo_session_store-rails3 (3.0.6) - actionpack (>= 3.0) - mongo - mongoid (2.6.0) - activemodel (~> 3.1) - mongo (~> 1.7) - tzinfo (~> 0.3.22) - mongoid-encryptor (0.0.5) - activesupport (~> 3.0) - encrypted_strings (~> 0.3.3) - mongoid (~> 2) - mongoid-tree (0.7.0) - mongoid (~> 2.0) - multi_json (1.6.1) - net-ldap (0.3.1) - nokogiri (1.5.6) - options (2.3.0) - fattr - orm_adapter (0.0.7) - polyglot (0.3.3) - pr_geohash (1.0.0) - progress_bar (0.4.0) - highline (~> 1.6.1) - options (~> 2.3.0) - pry (0.9.12) - coderay (~> 1.0.5) - method_source (~> 0.8) - slop (~> 3.4) - pry-debugger (0.2.1) - debugger (~> 1.2.0) - pry (~> 0.9.10) - pry-remote (0.1.6) - pry (~> 0.9) - slop (~> 3.0) - pry-stack_explorer (0.4.9) - binding_of_caller (>= 0.7) - pry (~> 0.9.11) - rack (1.4.5) - rack-cache (1.2) - rack (>= 0.4) - rack-gridfs (0.4.1) - mime-types - mongo (~> 1.2) - rack - rack-oauth2 (1.0.0) - activesupport (>= 2.3) - attr_required (>= 0.0.5) - httpclient (>= 2.2.0.2) - i18n - multi_json (>= 1.3.6) - rack (>= 1.1) - rack-protection (1.3.2) - rack - rack-ssl (1.3.3) - rack - rack-test (0.6.2) - rack (>= 1.0) - radius (0.7.3) - rails (3.2.12) - actionmailer (= 3.2.12) - actionpack (= 3.2.12) - activerecord (= 3.2.12) - activeresource (= 3.2.12) - activesupport (= 3.2.12) - bundler (~> 1.0) - railties (= 3.2.12) - railties (3.2.12) - actionpack (= 3.2.12) - activesupport (= 3.2.12) - rack-ssl (~> 1.3.2) - rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) - rake (10.0.3) - rdoc (3.12.1) - json (~> 1.4) - redis (3.0.2) - redis-namespace (1.2.1) - redis (~> 3.0.0) - redis-search (0.9.0) - chinese_pinyin (>= 0.3.0) - redis (>= 2.1.1) - redis-namespace (>= 1.0.2) - resque (1.23.0) - multi_json (~> 1.0) - redis-namespace (~> 1.0) - sinatra (>= 0.9.2) - vegas (~> 0.1.2) - resque-restriction (0.3.0) - resque (>= 1.7.0) - resque-scheduler (2.0.0) - redis (>= 2.0.1) - resque (>= 1.20.0) - rufus-scheduler - rmmseg-cpp-huacnlee (0.2.9) - rsolr (1.0.8) - builder (>= 2.1.2) - rspec (2.12.0) - rspec-core (~> 2.12.0) - rspec-expectations (~> 2.12.0) - rspec-mocks (~> 2.12.0) - rspec-core (2.12.2) - rspec-expectations (2.12.1) - diff-lcs (~> 1.1.3) - rspec-mocks (2.12.2) - rspec-rails (2.12.2) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 2.12.0) - rspec-expectations (~> 2.12.0) - rspec-mocks (~> 2.12.0) - ruby2ruby (2.0.3) - ruby_parser (~> 3.1) - sexp_processor (~> 4.0) - ruby_parser (3.1.1) - sexp_processor (~> 4.1) - rubyzip (0.9.9) - rufus-scheduler (2.0.17) - tzinfo (>= 0.3.23) - sass (3.2.5) - sass-rails (3.2.6) - railties (~> 3.2.0) - sass (>= 3.1.10) - tilt (~> 1.3) - select2-rails (3.3.1) - sass-rails (>= 3.2) - thor (~> 0.14) - selenium-webdriver (2.30.0) - childprocess (>= 0.2.5) - multi_json (~> 1.0) - rubyzip - websocket (~> 1.0.4) - sexp_processor (4.1.5) - shoulda-matchers (1.4.2) - activesupport (>= 3.0.0) - bourne (~> 1.1.2) - simplecov (0.7.1) - multi_json (~> 1.0) - simplecov-html (~> 0.7.1) - simplecov-html (0.7.1) - sinatra (1.3.4) - rack (~> 1.4) - rack-protection (~> 1.3) - tilt (~> 1.3, >= 1.3.3) - slop (3.4.3) - social-share-button (0.1.1) - spork (0.9.2) - sprockets (2.2.2) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - subexec (0.2.2) - sunspot (1.3.3) - pr_geohash (~> 1.0) - rsolr (~> 1.0.7) - sunspot-rails-tester (0.0.4) - sunspot_rails (~> 1.2) - sunspot_mongo (1.0.1) - sunspot_rails - sunspot_rails (1.3.3) - nokogiri - sunspot (= 1.3.3) - sunspot_solr (1.3.3) - syslog-logger (1.6.8) - terminal-table (1.4.5) - thor (0.17.0) - tilt (1.3.3) - tinymce-rails (3.5.8) - railties (>= 3.1.1) - treetop (1.4.12) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.35) - uglifier (1.3.0) - execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) - vegas (0.1.11) - rack (>= 1.0.0) - warden (1.2.1) - rack (>= 1.0) - watchr (0.7) - websocket (1.0.7) - xpath (1.0.0) - nokogiri (~> 1.3) - -PLATFORMS - ruby - -DEPENDENCIES - brakeman - bson_ext - capybara - carrierwave - carrierwave-mongoid - chinese_pinyin (= 0.4.1) - coffee-rails - database_cleaner - debugger - delorean - devise (= 1.5.3) - exception_notification - execjs - factory_girl_rails - faker - fb_graph - impressionist! - jquery-rails (= 2.1.4) - jquery-ui-rails - kaminari! - mime-types - mini_magick - mongo_session_store-rails3 (= 3.0.6) - mongoid (> 2.1, < 3.0.0) - mongoid-encryptor - mongoid-tree - net-ldap (~> 0.3.1) - nokogiri - progress_bar - pry - pry-debugger - pry-remote - pry-stack_explorer - rack-gridfs - radius - rails (~> 3.2.9) - rake - redis (>= 2.1.1) - redis-namespace - redis-search - resque - resque-restriction - resque-scheduler - rmmseg-cpp-huacnlee (= 0.2.9) - rspec (~> 2.0) - rspec-rails (~> 2.0) - rubyzip - sass-rails - select2-rails (= 3.3.1) - shoulda-matchers - simplecov - sinatra - social-share-button - spork - sprockets - sunspot-rails-tester - sunspot_mongo - sunspot_solr - syslog-logger - tinymce-rails - uglifier - watchr diff --git a/config/mongoid.yml b/config/mongoid.yml deleted file mode 100644 index 99a719c6..00000000 --- a/config/mongoid.yml +++ /dev/null @@ -1,24 +0,0 @@ -defaults: &defaults - host: localhost - # slaves: - # - host: slave1.local - port: 27017 - # - host: slave2.local - # port: 27019 - -development: - <<: *defaults - database: production_7 -test: - <<: *defaults - database: test_site - -# set these environment variables on your prod server -production: - # host: <%= ENV['MONGOID_HOST'] %> - # port: <%= ENV['MONGOID_PORT'] %> - # username: <%= ENV['MONGOID_USERNAME'] %> - # password: <%= ENV['MONGOID_PASSWORD'] %> - # database: <%= ENV['MONGOID_DATABASE'] %> - <<: *defaults - database: demo_site_production diff --git a/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb b/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb index 6a8564a7..9710f5f1 100644 --- a/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb +++ b/vendor/built_in_modules/calendar/app/assets/javascripts/calendarAPI.js.erb @@ -51,7 +51,14 @@ var calendarAPI = function(){ // c.loadMonthView(c.cur_month,c.cur_year); // c.loadWeekView(c.cur_week,c.cur_year); // c.loadDayView(c.cur_date,c.cur_month,c.cur_year); - c.loadAgendaView(); + agenda_end_month = c.cur_month + 5; + agenda_end_year = c.cur_year; + if(agenda_end_month > 12){ + agenda_end_month = agenda_end_month - 12; + agenda_end_year++; + } + + c.loadAgendaView(c.cur_month,c.cur_year,agenda_end_month,agenda_end_year); $(".calendar-filter-btn").each(function(){ c.calendars.push($(this).attr("href")); }) @@ -130,7 +137,7 @@ var calendarAPI = function(){ c.loadDayView(c.cur_date,c.cur_month,c.cur_year); break; case 'agenda': - c.loadAgendaView(); + c.loadAgendaView(c.cur_month,c.cur_year,agenda_end_month,agenda_end_year); break; } }) @@ -591,6 +598,8 @@ var calendarAPI = function(){ this.loadAgendaView = function(start_month,start_year,end_month,end_year){ c.view = "agenda"; var url = "cals/agenda_view"; + $(".mode_switch").removeClass("active"); + $(".mode_switch:eq(3)").addClass("active"); if(start_month && start_year && end_month && end_year) var url = "cals/agenda_view?s_month="+start_month+"&s_year="+start_year+"&e_month="+end_month+"&e_year="+end_year ; diff --git a/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/cals_controller.rb b/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/cals_controller.rb index 960ac2d7..a9b63a20 100644 --- a/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/cals_controller.rb +++ b/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/cals_controller.rb @@ -190,7 +190,8 @@ class Panel::Calendar::BackEnd::CalsController < OrbitBackendController end display_time = est + " " + event.start_am_pm + " - " + eet + " " + event.end_am_pm end - for c in start_date..(start_date + no_of_days) + + for c in start_date..(start_date + no_of_days - 1) if h.index(c) == nil h << c end @@ -296,7 +297,7 @@ class Panel::Calendar::BackEnd::CalsController < OrbitBackendController year = params[:year].to_i fromcalendars = params[:calendars] @d = getWeekDataSet(week,year) - events = Event.where(:cal_id.in=>fromcalendars).and(:start_week.lte => week).and(:start_year => year).and(:end_week.gte => week).and(:start_year => year).asc(:start_week).asc(:start_date) + events = Event.where(:cal_id.in=>fromcalendars).and(:start_week.lte => week).and(:start_year => year).and(:end_week.gte => week).asc(:start_week).asc(:start_date) @events = Array.new events.each_with_index do |event,i| # @temp = Array.new @@ -335,7 +336,7 @@ class Panel::Calendar::BackEnd::CalsController < OrbitBackendController startdt = @d[0].to_i event.all_day = true if event.end_week == week - colcount = 7 - @d.index(event.end_date.to_s).to_i + colcount = @d.index(event.end_date.to_s).to_i + 1 days = 7; startdt = event.start_date end diff --git a/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/events_controller.rb b/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/events_controller.rb index 4e477ded..a6cead67 100644 --- a/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/events_controller.rb +++ b/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/events_controller.rb @@ -90,7 +90,10 @@ class Panel::Calendar::BackEnd::EventsController < OrbitBackendController final_start_time = Date.new(start_year.to_i,start_month.to_i,start_date.to_i) final_end_time = Date.new(end_year.to_i,end_month.to_i,end_date.to_i) start_week = final_start_time.strftime("%U") - end_week = final_end_time.strftime("%U") + start_week = start_week.to_i + 1 + end_week = final_end_time.strftime("%U") + end_week = end_week.to_i + 1 + debugger total_days = final_end_time - final_start_time @event = Event.new @event.title = title