Fix bug.
This commit is contained in:
parent
589dc1adf2
commit
715c51552c
|
@ -121,6 +121,15 @@ class ArchivesController < ApplicationController
|
||||||
"url_to_edit" => url_to_edit
|
"url_to_edit" => url_to_edit
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
if ArchiveSortOrder.first['sort_order'] #Order with ascending
|
||||||
|
cats = cats.collect do |cat|
|
||||||
|
Hash[cat.map{|k,v| [k,k=='archives' ? (v.sort_by{|tp| [(tp['sort_number'].nil? ? Float::INFINITY : tp['sort_number'].to_i),-tp['created_at']]}) : v] }]
|
||||||
|
end
|
||||||
|
else
|
||||||
|
cats = cats.collect do |cat|
|
||||||
|
Hash[cat.map{|k,v| [k,k=='archives' ? (v.sort_by{|tp| [(tp['sort_number'].nil? ? Float::INFINITY : -tp['sort_number'].to_i),-tp['created_at']]}) : v] }]
|
||||||
|
end
|
||||||
|
end
|
||||||
if params[:data_count].to_i <=0
|
if params[:data_count].to_i <=0
|
||||||
page_data_count = 0
|
page_data_count = 0
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue