Fix bug.
This commit is contained in:
parent
89d328c640
commit
ddbe773d25
|
@ -167,7 +167,7 @@ class AnnouncementsController < ApplicationController
|
||||||
else
|
else
|
||||||
cats = ["all"] + cats
|
cats = ["all"] + cats
|
||||||
end
|
end
|
||||||
anns = anns.sort_by { |a| tmp=a["postdate"].blank?;[tmp ? 0 : 1, tmp ? nil : a["postdate"].to_time] }.reverse
|
anns = anns.sort_by { |a| [ (a["is_top"] ? 1 : 0) , a["postdate"].blank? ? nil : a["postdate"].to_time] }.reverse
|
||||||
end
|
end
|
||||||
cats = cats.uniq
|
cats = cats.uniq
|
||||||
tags = tags.uniq
|
tags = tags.uniq
|
||||||
|
|
|
@ -45,6 +45,7 @@ module AnnouncementsHelper
|
||||||
doc = Nokogiri::HTML(a.title)
|
doc = Nokogiri::HTML(a.title)
|
||||||
title = doc.text.empty? ? 'no content' : doc.text
|
title = doc.text.empty? ? 'no content' : doc.text
|
||||||
{
|
{
|
||||||
|
"is_top" => a.is_top,
|
||||||
"bulletin_links" => links,
|
"bulletin_links" => links,
|
||||||
"bulletin_files" => files,
|
"bulletin_files" => files,
|
||||||
"title" => a.title,
|
"title" => a.title,
|
||||||
|
|
Loading…
Reference in New Issue