From 14b19d814f46159ab56ff3f1a20bc48c37ec2d5f Mon Sep 17 00:00:00 2001 From: Bernie Chiu Date: Thu, 22 Aug 2013 15:38:06 +0800 Subject: [PATCH] Add category controller --- .../dictionary_vocab_categorys_controller.rb | 22 +++++++++++++++++++ .../dictionary/config/routes.rb | 1 + 2 files changed, 23 insertions(+) create mode 100644 vendor/built_in_modules/dictionary/app/controllers/panel/dictionary/back_end/dictionary_vocab_categorys_controller.rb diff --git a/vendor/built_in_modules/dictionary/app/controllers/panel/dictionary/back_end/dictionary_vocab_categorys_controller.rb b/vendor/built_in_modules/dictionary/app/controllers/panel/dictionary/back_end/dictionary_vocab_categorys_controller.rb new file mode 100644 index 000000000..caf40df90 --- /dev/null +++ b/vendor/built_in_modules/dictionary/app/controllers/panel/dictionary/back_end/dictionary_vocab_categorys_controller.rb @@ -0,0 +1,22 @@ +class Panel::Dictionary::BackEnd::DictionaryVocabCategorysController < OrbitBackendController + include OrbitControllerLib::DivisionForDisable + + before_filter :for_app_manager,:except => [:index,:get_categorys_json,:get_dictionary_vocabs_json] + + before_filter :force_order_for_visitor,:only=>[:index,:get_categorys_json,:get_dictionary_vocabs_json] + before_filter :force_order_for_user,:except => [:index,:get_categorys_json,:get_dictionary_vocabs_json] + before_filter :for_app_sub_manager,:except => [:index,:get_categorys_json,:get_dictionary_vocabs_json] + + def index + @dictionary_vocab_categorys = get_categories_for_index("DictionaryVocabCategory") + # @archive_file_categorys = ArchiveFileCategory.all + @dictionary_vocab_category = DictionaryVocabCategory.new(:display => 'List') + + @url = panel_dictionary_back_end_dictionary_vocab_categorys_path + + respond_to do |format| + format.html # index.html.erb + format.js + end + end +end \ No newline at end of file diff --git a/vendor/built_in_modules/dictionary/config/routes.rb b/vendor/built_in_modules/dictionary/config/routes.rb index 8cfeea242..972bdef50 100644 --- a/vendor/built_in_modules/dictionary/config/routes.rb +++ b/vendor/built_in_modules/dictionary/config/routes.rb @@ -10,6 +10,7 @@ Rails.application.routes.draw do resources :dictionary_vocab_categorys resources :tags end + namespace :front_end do match "dictionary_vocabs" => "dictionary_vocabs#index" resources :dictionary_vocabs