diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 5cab1af..2c8cafc 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -112,14 +112,18 @@ class NewsController < ApplicationController page = Page.where(:module => "news").first rescue nil ma = ModuleApp.find_by_key("news") rescue nil + + current_categories = OrbitHelper.widget_categories categories = ma.categories.enabled.collect do |cat| + if current_categories.include?(cat.id.to_s) { "name" => cat.title, "category-link" => "/#{I18n.locale.to_s + page.url}/?category=#{cat.to_param}" } + end end - - categories.unshift({"name" => t("news.all"), "category-link" => "/#{I18n.locale.to_s + page.url}/"}) + categories.delete(nil) + categories = {"name" => t("news.all"), "category-link" => "/#{I18n.locale.to_s + page.url}/"} if categories.count != 1 anns = news.collect do |a| if a.image_description.blank? @@ -140,8 +144,6 @@ class NewsController < ApplicationController elsif I18n.locale.to_s == 'en' subtitle = a.subtitle.truncate(200) end - - { "title" => HTMLEntities.new.encode(a.title),