diff --git a/app/controllers/admin/feeds_controller.rb b/app/controllers/admin/feeds_controller.rb index 69e93f5..08ee76d 100644 --- a/app/controllers/admin/feeds_controller.rb +++ b/app/controllers/admin/feeds_controller.rb @@ -106,8 +106,8 @@ class Admin::FeedsController < OrbitAdminController @filter_fields = {} @filter_fields['feed.source'] = SiteFeed.all.pluck(:channel_title,:remote_site_url).collect do |a,b| tp = (a.blank? || a[I18n.locale].blank?) ? b.gsub(/http:\/\/|https:\/\//,'').gsub(/\./,'-') : a[I18n.locale] - {:title => tp,:id => tp} - end + tp + end.uniq.map{|tp| {:title => tp,:id => tp}} @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 @@ -195,7 +195,7 @@ class Admin::FeedsController < OrbitAdminController site_feeds = SiteFeed.where(:remote_site_url => params["url"]) site_feeds.each do |sf| sf.channel_title_translations = params["channel_title_translations"] - sf.instance_variable_set(:@skip_callback) + sf.instance_variable_set(:@skip_callback, true) sf.save sf.sync_data_to_annc end diff --git a/app/views/admin/feeds/index.html.erb b/app/views/admin/feeds/index.html.erb index 96e74c3..cded3da 100644 --- a/app/views/admin/feeds/index.html.erb +++ b/app/views/admin/feeds/index.html.erb @@ -4,35 +4,34 @@

Channel and feeds

+<% in_use_locales = ([I18n.locale] + (I18n.available_locales - [I18n.locale])) %>
<% @school_urls.each_with_index do |url,index| %>
+ <% first_record = @site_feeds[url].first %> @@ -70,6 +69,15 @@