diff --git a/vendor/built_in_modules/faq/app/controllers/panel/faq/front_end/qas_controller.rb b/vendor/built_in_modules/faq/app/controllers/panel/faq/front_end/qas_controller.rb index 6a89d5f25..8cf0c0b69 100644 --- a/vendor/built_in_modules/faq/app/controllers/panel/faq/front_end/qas_controller.rb +++ b/vendor/built_in_modules/faq/app/controllers/panel/faq/front_end/qas_controller.rb @@ -37,14 +37,14 @@ class Panel::Faq::FrontEnd::QasController < OrbitWidgetController def show @qa = Qa.find(params[:id]) - get_categorys + # get_categorys end protected def get_categorys - @qa_categorys = QaCategory.excludes('disable' => true) + # @qa_categorys = QaCategory.excludes('disable' => true) end end diff --git a/vendor/built_in_modules/faq/app/models/qa.rb b/vendor/built_in_modules/faq/app/models/qa.rb index 0871923be..0273fc4f1 100644 --- a/vendor/built_in_modules/faq/app/models/qa.rb +++ b/vendor/built_in_modules/faq/app/models/qa.rb @@ -22,7 +22,7 @@ class Qa accepts_nested_attributes_for :qa_files, :allow_destroy => true accepts_nested_attributes_for :qa_links, :allow_destroy => true - belongs_to :qa_category + # belongs_to :qa_category before_save :clean_values diff --git a/vendor/built_in_modules/faq/app/views/panel/faq/front_end/qas/show.html.erb b/vendor/built_in_modules/faq/app/views/panel/faq/front_end/qas/show.html.erb index 970edbd53..7ee6d1b99 100644 --- a/vendor/built_in_modules/faq/app/views/panel/faq/front_end/qas/show.html.erb +++ b/vendor/built_in_modules/faq/app/views/panel/faq/front_end/qas/show.html.erb @@ -2,7 +2,7 @@

<%= @qa.title %>

- <%= t(:category) %>:<%= @qa.qa_category.title rescue nil %> + <%= t(:category) %>:<%= @qa.category.title rescue nil %>
diff --git a/vendor/built_in_modules/faq/init.rb b/vendor/built_in_modules/faq/init.rb index 85d119130..cd75cfc54 100644 --- a/vendor/built_in_modules/faq/init.rb +++ b/vendor/built_in_modules/faq/init.rb @@ -16,7 +16,7 @@ module Faq end end - category ["QaCategory"] + # category ["QaCategory"] data_count 1..20 taggable @@ -25,9 +25,9 @@ module Faq widgets do default_widget do - query 'Qa.all' - # enable ['typeA'] - link_field :qa_category_with_title,{:method => 'panel_faq_front_end_qas_path',:args=>{:category_id => [:qa_category,:id]}} + query 'Qa' + enable ['typeA'] + link_field :qa_category_with_title,{:method => 'panel_faq_front_end_qas_path',:args=>{:category_id => [:category,:id]}} link_field :title, {:method => 'panel_faq_front_end_qa_path',:args=>:self} link_to_more 'panel_faq_front_end_qas_path',:title_i18n=> 'faq.default_widget.to_more' end @@ -45,7 +45,7 @@ module Faq side_bar do head_label_i18n 'faq.faq',:icon_class=>"icons-help" available_for [:admin,:guest,:manager,:sub_manager] - active_for_controllers ({:private=>['qas', 'qa_categorys']}) + active_for_controllers ({:private=>['qas', 'qa_categorys','module_tags', 'categories']}) active_for_object_auth ['QaCategory'] head_link_path "panel_faq_back_end_qas_path" @@ -65,11 +65,10 @@ module Faq context_link 'categories', :link_path=>"admin_module_app_categories_path(get_module_app)" , :priority=>3, - :active_for_category => 'Qa', + :active_for_category => 'Faq', :available_for => [:manager] - context_link 'tags', - :link_path=>"admin_module_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'Faq'}))" , + :link_path=>"admin_module_tags_path(module_app_id: get_module_app)" , :priority=>4, :active_for_tag => 'Faq', :available_for => [:manager]