diff --git a/app/controllers/calendars_controller.rb b/app/controllers/calendars_controller.rb index 244bed0..ffb6ccf 100644 --- a/app/controllers/calendars_controller.rb +++ b/app/controllers/calendars_controller.rb @@ -68,6 +68,9 @@ class CalendarsController < ApplicationController subpartid = params[:subpart_id] page = Page.where(page_id: subpartid).first calendar_types = page.categories + if calendar_types.include?('all') + calendar_types = [] + end else calendar_types = [] end diff --git a/config/locales/en.yml b/config/locales/en.yml index 6a5edfe..71ceff9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -9,6 +9,7 @@ en: save: Save select_calendar: "Select Calendar" categories: Categories + categories_management: Categories Management new_category: New Category all_day: All Day note: Note diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 3e097b2..7c94ede 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -8,6 +8,7 @@ zh_tw: save: 儲存 select_calendar: 選取行事曆 categories: 類別 + categories_management: 類別管理 all_day: 全天 note: 註記 repeats: 重複 diff --git a/lib/calendar/engine.rb b/lib/calendar/engine.rb index f709fd9..4346a00 100644 --- a/lib/calendar/engine.rb +++ b/lib/calendar/engine.rb @@ -7,7 +7,7 @@ module Calendar widget_methods ["widget"] widget_settings [{"override_category_with"=>"calendar_type","multiselect"=>true,"display_field"=>"title"}] taggable "Event" - categorizable + # categorizable authorizable frontend_enabled data_count 1..10 @@ -23,7 +23,7 @@ module Calendar :priority=>1, :active_for_action=>{'admin/calendars'=>'index'}, :available_for => 'users' - context_link 'new_', + context_link 'calendar.categories_management', :link_path=>"admin_calendar_types_path" , :priority=>2, :active_for_action=>{'admin/calendar_types'=>'index'},