fix new ui announcement widget_style "bulletins_and_web_links"

This commit is contained in:
Spen 2014-01-10 17:46:12 +08:00 committed by Saurabh Bhatia
parent a85de4ae00
commit 304bf0d445
2 changed files with 11 additions and 3 deletions

View File

@ -98,9 +98,17 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
@bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:tagged_ids => @selected_tag.id.to_s, :is_hidden => false).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc(:is_top, :postdate).page(params[:page]).per(@page_num) rescue nil @bulletins = Bulletin.available_for_lang(I18n.locale).can_display.where(:tagged_ids => @selected_tag.id.to_s, :is_hidden => false).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc(:is_top, :postdate).page(params[:page]).per(@page_num) rescue nil
if @part.widget_style == 'bulletins_and_web_links' if @part.widget_style == 'bulletins_and_links'
@ModuleApp_w = ModuleApp.first(:conditions => {:key=>'web_resource'}) @ModuleApp_w = ModuleApp.first(:conditions => {:key=>'web_resource'})
@link_selected_tag = Tag.first(:conditions => {:name => @selected_tag.name, :module_tag_id => @ModuleApp_w.id})
@link_module_tag = ModuleTag.first(:conditions => {:name => @selected_tag.name, :module_app_id => @ModuleApp_w.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 @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 end

View File

@ -16,7 +16,7 @@
</ul> </ul>
</div> </div>
<% if @part.widget_style == 'bulletins_and_web_links' %> <% if @part.widget_style == 'bulletins_and_links' %>
<div class="links_block"> <div class="links_block">
<h3 class="links_title"><%= t(:related_links) %></h3> <h3 class="links_title"><%= t(:related_links) %></h3>