fix new ui faq frontend

This commit is contained in:
Spen 2013-11-08 17:38:05 +08:00 committed by saurabhbhatia
parent 72a37afddb
commit 989002a5ae
4 changed files with 11 additions and 12 deletions

View File

@ -37,14 +37,14 @@ class Panel::Faq::FrontEnd::QasController < OrbitWidgetController
def show def show
@qa = Qa.find(params[:id]) @qa = Qa.find(params[:id])
get_categorys # get_categorys
end end
protected protected
def get_categorys def get_categorys
@qa_categorys = QaCategory.excludes('disable' => true) # @qa_categorys = QaCategory.excludes('disable' => true)
end end
end end

View File

@ -22,7 +22,7 @@ class Qa
accepts_nested_attributes_for :qa_files, :allow_destroy => true accepts_nested_attributes_for :qa_files, :allow_destroy => true
accepts_nested_attributes_for :qa_links, :allow_destroy => true accepts_nested_attributes_for :qa_links, :allow_destroy => true
belongs_to :qa_category # belongs_to :qa_category
before_save :clean_values before_save :clean_values

View File

@ -2,7 +2,7 @@
<h1 class="h1"><%= @qa.title %></h1> <h1 class="h1"><%= @qa.title %></h1>
<div class="info"> <div class="info">
<div class="info1"> <div class="info1">
<span><%= t(:category) %><%= @qa.qa_category.title rescue nil %></span> <span><%= t(:category) %><%= @qa.category.title rescue nil %></span>
</div> </div>
</div> </div>
<div class="news_paragraph"> <div class="news_paragraph">

View File

@ -16,7 +16,7 @@ module Faq
end end
end end
category ["QaCategory"] # category ["QaCategory"]
data_count 1..20 data_count 1..20
taggable taggable
@ -25,9 +25,9 @@ module Faq
widgets do widgets do
default_widget do default_widget do
query 'Qa.all' query 'Qa'
# enable ['typeA'] enable ['typeA']
link_field :qa_category_with_title,{:method => 'panel_faq_front_end_qas_path',:args=>{:category_id => [:qa_category,:id]}} 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_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' link_to_more 'panel_faq_front_end_qas_path',:title_i18n=> 'faq.default_widget.to_more'
end end
@ -45,7 +45,7 @@ module Faq
side_bar do side_bar do
head_label_i18n 'faq.faq',:icon_class=>"icons-help" head_label_i18n 'faq.faq',:icon_class=>"icons-help"
available_for [:admin,:guest,:manager,:sub_manager] 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'] active_for_object_auth ['QaCategory']
head_link_path "panel_faq_back_end_qas_path" head_link_path "panel_faq_back_end_qas_path"
@ -65,11 +65,10 @@ module Faq
context_link 'categories', context_link 'categories',
:link_path=>"admin_module_app_categories_path(get_module_app)" , :link_path=>"admin_module_app_categories_path(get_module_app)" ,
:priority=>3, :priority=>3,
:active_for_category => 'Qa', :active_for_category => 'Faq',
:available_for => [:manager] :available_for => [:manager]
context_link 'tags', 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, :priority=>4,
:active_for_tag => 'Faq', :active_for_tag => 'Faq',
:available_for => [:manager] :available_for => [:manager]