From 77da0ef6412bb1cf7fe9d56b30735c5bb7f8f992 Mon Sep 17 00:00:00 2001 From: Bohung Date: Thu, 12 Aug 2021 12:58:32 +0800 Subject: [PATCH] Fix bug. --- app/controllers/admin/feeds_controller.rb | 2 +- app/views/admin/feeds/_announcements.html.erb | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/admin/feeds_controller.rb b/app/controllers/admin/feeds_controller.rb index e2a4ef5..dccfaa9 100644 --- a/app/controllers/admin/feeds_controller.rb +++ b/app/controllers/admin/feeds_controller.rb @@ -70,7 +70,7 @@ class Admin::FeedsController < OrbitAdminController @filter_fields['feed.module_name'] = SiteFeed.all.map{|s| s.channel_key}.uniq.map do |key| {:title => I18n.t("module_name.#{key}"),:id => key} end - @module_name = params[:filters][:module_name] rescue [] + @module_name = params[:filters][:module_name].to_a rescue [] @module_name = SiteFeed.all.map{|s| s.channel_key}.uniq if @module_name == [] @all_feed_annc = SiteFeedAnnc.where(:channel_key.in => @module_name).order(created_at: 1).to_a rescue [] @source = params[:filters][:source] rescue [] diff --git a/app/views/admin/feeds/_announcements.html.erb b/app/views/admin/feeds/_announcements.html.erb index 532c275..eb5f40b 100644 --- a/app/views/admin/feeds/_announcements.html.erb +++ b/app/views/admin/feeds/_announcements.html.erb @@ -18,10 +18,8 @@ <% if @keywords.blank? || search_all_words(Nokogiri.HTML(annc_title).text()+' '+feed_name+' '+annc_tags.join(' '),@keywords) %> '> - <% if (!feed_annc.channel_title.to_s.empty? rescue false) %> - <%= feed_annc.channel_title %> -
- <% end %> + <%= (feed_annc.channel_title.include?("translation missing") || feed_annc.channel_title.blank?) ? t("feed.source") : feed_annc.channel_title %> +
<%= feed_name %>