modify news url about category
This commit is contained in:
parent
4276840113
commit
499f389da5
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue