diff --git a/Gemfile b/Gemfile index a21488c9..3ea8359e 100644 --- a/Gemfile +++ b/Gemfile @@ -50,7 +50,7 @@ gem 'rb-readline' if RUBY_PLATFORM.downcase.include?("linux") gem "impressionist", :git => 'git://github.com/charlotte-ruby/impressionist.git' #gem 'contacts' -gem 'event-calendar', :require => 'event_calendar'#, :git => 'git://github.com/elevation/event_calendar.git' +#gem 'event-calendar', :require => 'event_calendar'#, :git => 'git://github.com/elevation/event_calendar.git' gem 'redis','>= 2.1.1' gem 'chinese_pinyin', '0.4.1' diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb index 964547c7..2ef9542f 100644 --- a/app/views/layouts/_side_bar.html.erb +++ b/app/views/layouts/_side_bar.html.erb @@ -107,7 +107,7 @@ <% end -%> <%= content_tag :li, :class => active_for_controllers('cals','calendar_categories') || active_for_app_auth("calendar") do -%> - <%#= link_to content_tag(:i, nil, :class => 'icons-calendar') + content_tag(:span, t('admin.calendar')), panel_calendar_back_end_cals_path %> + <%= link_to content_tag(:i, nil, :class => 'icons-calendar') + content_tag(:span, t('admin.calendar')), panel_calendar_back_end_cals_path %> <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('cals','calendar_categories') ) do -%> <%#= content_tag :li, link_to(t('admin.ad.all_banners'), admin_ad_banners_path), :class => active_for_action('ad_banners', 'index') %> <%#= content_tag :li, link_to(t('admin.ad.new_banner'), new_admin_ad_banner_path), :class => active_for_action('ad_banners', 'new') %> diff --git a/vendor/built_in_modules/calendar/Gemfile.lock b/vendor/built_in_modules/calendar/Gemfile.lock deleted file mode 100644 index 8058d021..00000000 --- a/vendor/built_in_modules/calendar/Gemfile.lock +++ /dev/null @@ -1,99 +0,0 @@ -PATH - remote: . - specs: - calendar (0.0.1) - rails (~> 3.1.4) - -GEM - remote: http://rubygems.org/ - specs: - actionmailer (3.1.8) - actionpack (= 3.1.8) - mail (~> 2.3.3) - actionpack (3.1.8) - activemodel (= 3.1.8) - activesupport (= 3.1.8) - builder (~> 3.0.0) - erubis (~> 2.7.0) - i18n (~> 0.6) - rack (~> 1.3.6) - rack-cache (~> 1.2) - rack-mount (~> 0.8.2) - rack-test (~> 0.6.1) - sprockets (~> 2.0.4) - activemodel (3.1.8) - activesupport (= 3.1.8) - builder (~> 3.0.0) - i18n (~> 0.6) - activerecord (3.1.8) - activemodel (= 3.1.8) - activesupport (= 3.1.8) - arel (~> 2.2.3) - tzinfo (~> 0.3.29) - activeresource (3.1.8) - activemodel (= 3.1.8) - activesupport (= 3.1.8) - activesupport (3.1.8) - multi_json (>= 1.0, < 1.3) - arel (2.2.3) - builder (3.0.3) - erubis (2.7.0) - hike (1.2.1) - i18n (0.6.1) - jquery-rails (2.1.2) - railties (>= 3.1.0, < 5.0) - thor (~> 0.14) - json (1.7.5) - mail (2.3.3) - i18n (>= 0.4.0) - mime-types (~> 1.16) - treetop (~> 1.4.8) - mime-types (1.19) - multi_json (1.2.0) - polyglot (0.3.3) - rack (1.3.6) - rack-cache (1.2) - rack (>= 0.4) - rack-mount (0.8.3) - rack (>= 1.0.0) - rack-ssl (1.3.2) - rack - rack-test (0.6.1) - rack (>= 1.0) - rails (3.1.8) - actionmailer (= 3.1.8) - actionpack (= 3.1.8) - activerecord (= 3.1.8) - activeresource (= 3.1.8) - activesupport (= 3.1.8) - bundler (~> 1.0) - railties (= 3.1.8) - railties (3.1.8) - actionpack (= 3.1.8) - activesupport (= 3.1.8) - rack-ssl (~> 1.3.2) - rake (>= 0.8.7) - rdoc (~> 3.4) - thor (~> 0.14.6) - rake (0.9.2.2) - rdoc (3.12) - json (~> 1.4) - sprockets (2.0.4) - hike (~> 1.2) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.6) - thor (0.14.6) - tilt (1.3.3) - treetop (1.4.10) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.33) - -PLATFORMS - ruby - -DEPENDENCIES - calendar! - jquery-rails - sqlite3 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 8a23d428..d5999917 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 @@ -3,31 +3,81 @@ $(window).load(function(){ $('.color-picker').miniColors(); // just in category view } + var view_url = 'http://localhost:3000/panel/calendar/back_end/cals/'; + // below calendar start - // month view - if($('#calendar_month').length > 0){ - var $c_table = $('#calendar_month'); - var sum_h = 0; - var context_h = $('#main-sidebar').outerHeight(); - $('#main-wrap > *').not('#orbit_calendar, .modal').each(function(){ - sum_h += $(this).outerHeight(); + $.get(view_url+'month_view', function(data) { + $('#view_holder').html(data); + month_fn(); }); + $.get(view_url+'new', function(data) { + $('#create .modal-body').html(data); + }); + + // view switch (for view test) + $('.mode_switch').click(function(){ + var target = $(this).text(); + $.get(view_url+target+'_view', function(data) { + $('#view_holder').html(data); + switch(target){ + case 'month': + month_fn(); + break; + case 'week': + week_fn(); + break; + case 'day': + day_fn(); + break; + case 'agenda': + agenda_fn(); + break; + } + }); + }); + + // month fn + var month_fn = function(){ + $('.current_day_title').text('September 2012'); + + // month view + if($('#calendar_month').length > 0){ + var $c_table = $('#calendar_month'); + var sum_h = 0; + var context_h = $('#main-sidebar').outerHeight(); + $('#main-wrap > *').not('#orbit_calendar, .modal').each(function(){ + sum_h += $(this).outerHeight(); + }); - $c_table - // .height(context_h-sum_h-64) - .find('.month_row') - .not('.month_row.header') - .height((context_h-sum_h-92) / 6); - - $(window).resize(function(){ $c_table + // .height(context_h-sum_h-64) .find('.month_row') .not('.month_row.header') - .height(($('#main-sidebar').outerHeight()-sum_h-92) / 6); - }); + .height((context_h-sum_h-92) / 6); + + $(window).resize(function(){ + $c_table + .find('.month_row') + .not('.month_row.header') + .height(($('#main-sidebar').outerHeight()-sum_h-92) / 6); + }); + } + }; + + // week fn + var week_fn = function(){ + $('.current_day_title').text('September 2 - 8, 2012'); } - $.get('http://localhost:3000/panel/calendar/back_end/cals/new', function(data) { - $('#create .modal-body').html(data); - }); + + // day fn + var day_fn = function(){ + $('.current_day_title').text('September 2, 2012'); + } + + // agenda fn + var agenda_fn = function(){ + $('.current_day_title').text('September 2, 2012'); + } + }); \ No newline at end of file diff --git a/vendor/built_in_modules/calendar/app/assets/stylesheets/calendar.css b/vendor/built_in_modules/calendar/app/assets/stylesheets/calendar.css index 0af3323d..e7d3e35c 100644 --- a/vendor/built_in_modules/calendar/app/assets/stylesheets/calendar.css +++ b/vendor/built_in_modules/calendar/app/assets/stylesheets/calendar.css @@ -13,9 +13,25 @@ margin-right: 4px; vertical-align: bottom; } +.current_day_title { + text-align: center; + line-height: 28px; +} .calendar_mode { float: right; } +.mode_switch { + text-transform: capitalize; +} +.today { + background-color: #D9EDF7; +} +.event { + font-size: 12px; + border-radius: 3px; + cursor: pointer; + padding: 1px 3px; +} /* month view */ #calendar_month { border-bottom: solid 1px #ddd; @@ -65,16 +81,11 @@ text-decoration: underline; } #calendar_month .month_row td.today { - background-color: #D9EDF7; border-bottom: solid 1px #fff; border-top: solid 1px #fff; } #calendar_month .month_row .event { - padding: 1px 3px; margin: 0 -2px; - font-size: 12px; - border-radius: 3px; - cursor: pointer; position: relative; color: #000; } @@ -87,6 +98,87 @@ border-left: solid 1px #ddd; } +/* agenda view */ +#calendar_agenda { + border-bottom: solid 1px #ddd; +} +#calendar_agenda .table { + margin-bottom: 0; +} +.event_time { + font-family: Tahoma, sans-serif; +} + +/* day view */ +#calendar_day .header { + margin-bottom: 10px; +} +#calendar_day .header th { + text-align: center; +} +#calendar_day td { + border: 0; +} +#calendar_day .event { + margin-bottom: 2px; +} +#calendar_day .all_day_event { + background: #eee; + border: solid 1px #ddd +} +#calendar_day .event_list .table { + border-top: solid 1px #ddd; +} +#calendar_day .event_list td { + padding: 0; +} +#calendar_day .event_list .day_time { + height: 30px; + border-bottom: solid 1px #ddd; + border-left: solid 1px #ddd; + text-align: right; + padding: 4px; +} +#calendar_day .event_list .cell { + height: 38px; + border: solid 1px #ddd; + border-top: 0; +} +#calendar_day .event_list .divide { + height: 18px; + margin-bottom: 18px; + border-bottom: solid 1px #eee; +} +#calendar_day .event_holder { + width: 100%; + height: 100%; + position: absolute; + top: 0; +} +#calendar_day .event_holder .event { + padding: 0px; + position: absolute; + width: 100%; +} +#calendar_day .event_holder .event.half { + +} +#calendar_day .event_holder .event.over { + outline: solid 1px #fff; +} +#calendar_day .event dl, #calendar_day .event dt, #calendar_day .event dd { + margin: 0; + padding: 0; +} +#calendar_day .event dl { + padding: 3px; +} +#calendar_day .event dt { + font-size: 11px; + font-weight: normal; + line-height: 12px; +} + /* calendars(category) */ .calendars_color_tag { diff --git a/vendor/built_in_modules/calendar/app/controllers/panel/orbitcalendar/back_end/calendar_categories_controller.rb b/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/calendar_categories_controller.rb similarity index 100% rename from vendor/built_in_modules/calendar/app/controllers/panel/orbitcalendar/back_end/calendar_categories_controller.rb rename to vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/calendar_categories_controller.rb 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 new file mode 100644 index 00000000..b55f5a35 --- /dev/null +++ b/vendor/built_in_modules/calendar/app/controllers/panel/calendar/back_end/cals_controller.rb @@ -0,0 +1,28 @@ +class Panel::Calendar::BackEnd::CalsController < OrbitBackendController + include AdminHelper + + def index + + end + + def new + render :layout => false + end + + def day_view + render :layout => false + end + + def week_view + render :layout => false + end + + def month_view + render :layout => false + end + + def agenda_view + render :layout => false + end + +end \ No newline at end of file diff --git a/vendor/built_in_modules/calendar/app/controllers/panel/orbitcalendar/back_end/calendar_controller.rb b/vendor/built_in_modules/calendar/app/controllers/panel/orbitcalendar/back_end/calendar_controller.rb deleted file mode 100644 index c060a7e3..00000000 --- a/vendor/built_in_modules/calendar/app/controllers/panel/orbitcalendar/back_end/calendar_controller.rb +++ /dev/null @@ -1,12 +0,0 @@ -class Panel::Orbitcalendar::BackEnd::CalendarController < ApplicationController - - def index - @month = (params[:month] || (Time.zone || Time).now.month).to_i - @year = (params[:year] || (Time.zone || Time).now.year).to_i - - @shown_month = Date.civil(@year, @month) - - @event_strips = Event.event_strips_for_month(@shown_month) - end - -end diff --git a/vendor/built_in_modules/calendar/app/controllers/panel/orbitcalendar/back_end/cals_controller.rb b/vendor/built_in_modules/calendar/app/controllers/panel/orbitcalendar/back_end/cals_controller.rb deleted file mode 100644 index d44cd3be..00000000 --- a/vendor/built_in_modules/calendar/app/controllers/panel/orbitcalendar/back_end/cals_controller.rb +++ /dev/null @@ -1,12 +0,0 @@ -class Panel::Calendar::BackEnd::CalsController < OrbitBackendController - include AdminHelper - - def index - - end - - def new - render :layout => false - end - -end \ No newline at end of file diff --git a/vendor/built_in_modules/calendar/app/helpers/panel/orbitcalendar/back_end/calendar_helper.rb b/vendor/built_in_modules/calendar/app/helpers/panel/orbitcalendar/back_end/calendar_helper.rb deleted file mode 100644 index ae0c77a2..00000000 --- a/vendor/built_in_modules/calendar/app/helpers/panel/orbitcalendar/back_end/calendar_helper.rb +++ /dev/null @@ -1,24 +0,0 @@ -module Panel::Orbitcalendar::BackEnd::CalendarHelper - def month_link(month_date) - link_to(I18n.localize(month_date, :format => "%B"), {:month => month_date.month, :year => month_date.year}) - end - - # custom options for this calendar - def event_calendar_opts - { - :year => @year, - :month => @month, - :event_strips => @event_strips, - :month_name_text => I18n.localize(@shown_month, :format => "%B %Y"), - :previous_month_text => "<< " + month_link(@shown_month.prev_month), - :next_month_text => month_link(@shown_month.next_month) + " >>" } - end - - def event_calendar - # args is an argument hash containing :event, :day, and :options - calendar event_calendar_opts do |args| - event = args[:event] - %(#{h(event.name)}) - end - end -end diff --git a/vendor/built_in_modules/calendar/app/models/event.rb b/vendor/built_in_modules/calendar/app/models/event.rb deleted file mode 100644 index b53963aa..00000000 --- a/vendor/built_in_modules/calendar/app/models/event.rb +++ /dev/null @@ -1,10 +0,0 @@ -class Event - include Mongoid::Document - include EventCalendar - has_event_calendar - - # def self.events_for_date_range(start_d, end_d, find_options = {}) - # where(find_options.merge(self.end_at_field.to_sym.lt => end_d.to_time.utc, - # self.start_at_field.to_sym.gt => start_d.to_time.utc)).asc(self.start_at_field) - # end -end diff --git a/vendor/built_in_modules/calendar/app/views/panel/orbitcalendar/back_end/calendar_categories/index.html.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/calendar_categories/index.html.erb similarity index 100% rename from vendor/built_in_modules/calendar/app/views/panel/orbitcalendar/back_end/calendar_categories/index.html.erb rename to vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/calendar_categories/index.html.erb diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/agenda_view.html.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/agenda_view.html.erb new file mode 100644 index 00000000..b7726e4c --- /dev/null +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/agenda_view.html.erb @@ -0,0 +1,48 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Thu, Sep 69:00am - 9:30am +
Commuting time, from home to RD
+
9:30am - 12:00am +
Work on Thu project, and ask ika for help if possible
+
13:30pm - 18:00pm +
Template design, at least finish 2 template
+
Fri, Sep 79:00am - 18:00pm +
Take a day off
+
Sat, Sep 87:00am - 7:50pm +
Work out with Joseph
+
+
\ No newline at end of file diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/day_view.html.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/day_view.html.erb new file mode 100644 index 00000000..047be06f --- /dev/null +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/day_view.html.erb @@ -0,0 +1,155 @@ +
+ + + + + + + + + +
+

Sunday 9/2

+
+
event1
+
event2
+
+
+ + + + + +
+
12am
+
1am
+
2am
+
3am
+
4am
+
5am
+
6am
+
7am
+
8am
+
9am
+
10am
+
11am
+
12am
+
1pm
+
2pm
+
3pm
+
4pm
+
5pm
+
6pm
+
7pm
+
8pm
+
9pm
+
10pm
+
11pm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
10:30am - 11:00am
+
template
+
+
+
+
+
10:30am - 11:00am
+
template
+
+
+
+
+
10:30am - template
+
+
+
+
+
+
10:30am - 11:00am
+
template
+
+
+
+
+
10:30am - 11:00am
+
template
+
+
+
+
+
+
\ No newline at end of file diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/index.html.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/index.html.erb new file mode 100644 index 00000000..2dc89700 --- /dev/null +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/index.html.erb @@ -0,0 +1,67 @@ +<%= stylesheet_link_tag "font-awesome" %> +<%= stylesheet_link_tag "calendar" %> +<%= stylesheet_link_tag "bootstrap-responsive" %> +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "calendarAPI" %> +<% end %> + + +
+
+
+
+
+ +
+
+ + +
+
+
+
+

Semptember 2012

+
+
+
+ + + + +
+
+
+
+
+
+
+
+
+
+ Add +
+
+
+ \ No newline at end of file diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/month_view.html.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/month_view.html.erb new file mode 100644 index 00000000..bff812b0 --- /dev/null +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/month_view.html.erb @@ -0,0 +1,182 @@ +
+
+ + + + + + + + + + +
SunMonTueWedThuFriSat
+
+
+ + + + + + + + + + +
+ + + + + + + + + + +
Aug 262728293031Sep 1
+
+
+ + + + + + + + + + +
+ + + + + + + + + + +
2345678
+
+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
9101112131415
7pm - 9pm test event
7pm - 9pm test event
+
+
+ + + + + + + + + + +
+ + + + + + + + + + +
16171819202122
+
+
+ + + + + + + + + + +
+ + + + + + + + + + +
23242526272829
+
+
+ + + + + + + + + + +
+ + + + + + + + + + +
30Nov 123456
+
+
+ \ No newline at end of file diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/new.html.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/new.html.erb index 25de617a..9611b121 100644 --- a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/new.html.erb +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/new.html.erb @@ -1,5 +1,8 @@
+
+ +
diff --git a/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/week_view.html.erb b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/week_view.html.erb new file mode 100644 index 00000000..359237f1 --- /dev/null +++ b/vendor/built_in_modules/calendar/app/views/panel/calendar/back_end/cals/week_view.html.erb @@ -0,0 +1 @@ +week \ No newline at end of file diff --git a/vendor/built_in_modules/calendar/app/views/panel/orbitcalendar/back_end/calendar/index.html.erb b/vendor/built_in_modules/calendar/app/views/panel/orbitcalendar/back_end/calendar/index.html.erb deleted file mode 100644 index c1059cbc..00000000 --- a/vendor/built_in_modules/calendar/app/views/panel/orbitcalendar/back_end/calendar/index.html.erb +++ /dev/null @@ -1,6 +0,0 @@ - -<%= stylesheet_link_tag "event_calendar" %> - -

Calendar

- -<%= raw(event_calendar) %> diff --git a/vendor/built_in_modules/calendar/app/views/panel/orbitcalendar/back_end/cals/index.html.erb b/vendor/built_in_modules/calendar/app/views/panel/orbitcalendar/back_end/cals/index.html.erb deleted file mode 100644 index ee6c7126..00000000 --- a/vendor/built_in_modules/calendar/app/views/panel/orbitcalendar/back_end/cals/index.html.erb +++ /dev/null @@ -1,246 +0,0 @@ -<%= stylesheet_link_tag "font-awesome" %> -<%= stylesheet_link_tag "calendar" %> -<%= stylesheet_link_tag "bootstrap-responsive" %> -<% content_for :page_specific_javascript do %> - <%= javascript_include_tag "calendarAPI" %> -<% end %> - - -
-
-
-

Semptember 2012

-
-
-
- - - - -
-
-
-
-
- - - - - - - - - - -
SunMonTueWedThuFriSat
-
-
- - - - - - - - - - -
- - - - - - - - - - -
Aug 262728293031Sep 1
-
-
- - - - - - - - - - -
- - - - - - - - - - -
2345678
-
-
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
9101112131415
7pm - 9pm test event
7pm - 9pm test event
-
-
- - - - - - - - - - -
- - - - - - - - - - -
16171819202122
-
-
- - - - - - - - - - -
- - - - - - - - - - -
23242526272829
-
-
- - - - - - - - - - -
- - - - - - - - - - -
30Nov 123456
-
-
-
-
-
-
-
-
- -
-
- - -
-
-
-
- Add -
-
-
- - \ No newline at end of file diff --git a/vendor/built_in_modules/calendar/config/routes.rb b/vendor/built_in_modules/calendar/config/routes.rb index 5f961513..36aa3e6f 100644 --- a/vendor/built_in_modules/calendar/config/routes.rb +++ b/vendor/built_in_modules/calendar/config/routes.rb @@ -1,9 +1,13 @@ Rails.application.routes.draw do namespace :panel do - namespace :orbitcalendar do + namespace :calendar do namespace :back_end do - match '/calendar(/:year(/:month))' => 'calendar#index', :as => :calendar, :constraints => {:year => /\d{4}/, :month => /\d{1,2}/} + match 'cals/agenda_view' => 'cals#agenda_view', :via => :get + match 'cals/month_view' => 'cals#month_view', :via => :get + match 'cals/day_view' => 'cals#day_view', :via => :get + match 'cals/week_view' => 'cals#week_view', :via => :get + resources :cals resources :calendar_categories end