Update archives_controller.rb

This commit is contained in:
chiu 2019-09-20 14:10:46 +08:00
parent e35990d364
commit 06fa9989fc
1 changed files with 4 additions and 0 deletions

View File

@ -251,6 +251,7 @@ F cats = files_by_cateogry.keys.collect do |cat|
end end
def widget def widget
begin
check_cat_sort_data() check_cat_sort_data()
if ArchiveSortOrder.count == 0 if ArchiveSortOrder.count == 0
ArchiveSortOrder.new('sort_order' => false).save ArchiveSortOrder.new('sort_order' => false).save
@ -316,6 +317,9 @@ F cats = files_by_cateogry.keys.collect do |cat|
"archives" => archives "archives" => archives
} }
end end
rescue => e
puts e
end
{ {
"categories" => cats, "categories" => cats,
"extras" => {"widget-title" => "Archives","more_url" => (OrbitHelper.widget_more_url + '?data_count=' + page_data_count.to_s)} "extras" => {"widget-title" => "Archives","more_url" => (OrbitHelper.widget_more_url + '?data_count=' + page_data_count.to_s)}