Fix bug.
This commit is contained in:
parent
89d328c640
commit
ddbe773d25
|
@ -167,7 +167,7 @@ class AnnouncementsController < ApplicationController
|
|||
else
|
||||
cats = ["all"] + cats
|
||||
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
|
||||
cats = cats.uniq
|
||||
tags = tags.uniq
|
||||
|
|
|
@ -45,6 +45,7 @@ module AnnouncementsHelper
|
|||
doc = Nokogiri::HTML(a.title)
|
||||
title = doc.text.empty? ? 'no content' : doc.text
|
||||
{
|
||||
"is_top" => a.is_top,
|
||||
"bulletin_links" => links,
|
||||
"bulletin_files" => files,
|
||||
"title" => a.title,
|
||||
|
|
Loading…
Reference in New Issue