if no data , hide title&table
This commit is contained in:
parent
05eb32cbd2
commit
2921aa62d4
|
@ -33,6 +33,12 @@ class AnnouncementsController < ApplicationController
|
|||
"view_count" => a.view_count
|
||||
}
|
||||
end
|
||||
|
||||
#If no data , hide title&table
|
||||
if announcements.count == 0
|
||||
display = "hide"
|
||||
end
|
||||
|
||||
{
|
||||
"announcements" => anns,
|
||||
"extras" => {
|
||||
|
@ -44,7 +50,8 @@ class AnnouncementsController < ApplicationController
|
|||
"subtitle-head" => t('announcement.table.sub_title'),
|
||||
"category-head" => t('announcement.table.category'),
|
||||
"link-head" => t('announcement.table.link'),
|
||||
"file-head" => t('announcement.table.file')
|
||||
"file-head" => t('announcement.table.file'),
|
||||
"display" => display
|
||||
},
|
||||
"total_pages" => announcements.total_pages
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue