From 528912ae3e7279dfd3e9d90cf0c8034f1ec5838a Mon Sep 17 00:00:00 2001 From: spen Date: Thu, 8 May 2014 14:12:06 +0800 Subject: [PATCH] fix widget reload_web_links --- .../panel/announcement/widget/bulletins_controller.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/panel/announcement/widget/bulletins_controller.rb b/app/controllers/panel/announcement/widget/bulletins_controller.rb index 2bebdd0..cb7df5b 100644 --- a/app/controllers/panel/announcement/widget/bulletins_controller.rb +++ b/app/controllers/panel/announcement/widget/bulletins_controller.rb @@ -146,7 +146,15 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController @selected_tag = Tag.find(params[:tag_id]).first @ModuleApp = ModuleApp.first(:conditions => {:key=>'web_resource'}) - @link_selected_tag = Tag.first(:conditions => {:name => @selected_tag.name, :module_tag_id => @ModuleApp.id}) + @link_module_tag = ModuleTag.first(:conditions => {:name => @selected_tag.name, :module_app_id => @ModuleApp.id}) + # @link_selected_tag = Tag.first(:conditions => {:name => @selected_tag.name, :tag_lease_id => @ModuleApp.id}) + + if !@link_module_tag.blank? + @link_selected_tag = Tag.first(:conditions => {:name => @selected_tag.name, :tag_lease_id => @link_module_tag.id}) + else + @link_selected_tag = @link_module_tag + end + @web_links = WebLink.where(:tagged_ids => @link_selected_tag.id.to_s, :is_hidden => false).desc(:is_top,:created_at).available_for_lang(I18n.locale).page(params[:page]).per(@page_num) rescue nil end