diff --git a/vendor/built_in_modules/announcement/app/models/announcement_tag.rb b/vendor/built_in_modules/announcement/app/models/announcement_tag.rb index 9656db7d6..9cb29038b 100644 --- a/vendor/built_in_modules/announcement/app/models/announcement_tag.rb +++ b/vendor/built_in_modules/announcement/app/models/announcement_tag.rb @@ -4,6 +4,7 @@ class AnnouncementTag < Tag def get_visible_bulletins(sort = :name) + date_now = Time.now self.bulletins.where(:is_hidden => false).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc(:is_top, sort) end diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/_bulletins.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/_bulletins.html.erb index 29fce0b13..de1cef795 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/_bulletins.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/_bulletins.html.erb @@ -1,6 +1,6 @@ <% @bulletins.each do |bulletin| %>
  • - <%= bulletin.title[I18n.locale] %> + <%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin) %>
  • <% end %> diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/bulletins_and_web_links.js.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/bulletins_and_web_links.js.erb index 017bb1fad..9439ce4df 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/bulletins_and_web_links.js.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/bulletins_and_web_links.js.erb @@ -1,3 +1,3 @@ $('#bulletins_web_links_tags').html("<%= j render :partial => 'tag', :collection => @tags %>") -$('#bulletins_web_links_bulletins').html("<%= j render 'bulletins' %>") -$('#bulletins_web_links_web_links').html("<%= j render 'web_links' %>") \ No newline at end of file +$('#bulletins_web_links_bulletins').html("<%= j render 'bulletins' if @bulletins %>") +$('#bulletins_web_links_web_links').html("<%= j render 'web_links' if @web_links %>") \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/reload_web_links.js.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/reload_web_links.js.erb index 55f1bc96f..d5abd76b6 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/reload_web_links.js.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/reload_web_links.js.erb @@ -1 +1 @@ -$('#bulletins_web_links_web_links').html("<%= j render 'web_links' id @web_links %>") \ No newline at end of file +$('#bulletins_web_links_web_links').html("<%= j render 'web_links' if @web_links %>") \ No newline at end of file