Adjust code.
This commit is contained in:
parent
1eecd099f4
commit
e4888e1421
|
@ -41,7 +41,7 @@ class ArchivesController < ApplicationController
|
||||||
if !params['title'].nil?
|
if !params['title'].nil?
|
||||||
files_by_category = ArchiveFile.can_display.sorted.group_by(&:category)
|
files_by_category = ArchiveFile.can_display.sorted.group_by(&:category)
|
||||||
categories = files_by_category.keys
|
categories = files_by_category.keys
|
||||||
categories_sort = get_sorted_cat_with_filter(categories,'orm')
|
categories_sort = get_sorted_cat_with_filter(categories, :orm)
|
||||||
categories_sort.each_with_index do |category, cat_idx|
|
categories_sort.each_with_index do |category, cat_idx|
|
||||||
url_to_edit = ""
|
url_to_edit = ""
|
||||||
flag = false
|
flag = false
|
||||||
|
@ -144,7 +144,7 @@ class ArchivesController < ApplicationController
|
||||||
files_by_category = ArchiveFile.can_display.filter_by_categories(categories).filter_by_tags(tags).sorted.group_by(&:category)
|
files_by_category = ArchiveFile.can_display.filter_by_categories(categories).filter_by_tags(tags).sorted.group_by(&:category)
|
||||||
each_data_count = []
|
each_data_count = []
|
||||||
categories = files_by_category.keys
|
categories = files_by_category.keys
|
||||||
categories_sort = get_sorted_cat_with_filter(categories,'orm')
|
categories_sort = get_sorted_cat_with_filter(categories, :orm)
|
||||||
cats = categories_sort.collect.with_index do |category, cat_idx|
|
cats = categories_sort.collect.with_index do |category, cat_idx|
|
||||||
url_to_edit = OrbitHelper.user_has_cateogry?(category) ? "/admin/archive_files?filters[category][]=#{category.id.to_s}" : ""
|
url_to_edit = OrbitHelper.user_has_cateogry?(category) ? "/admin/archive_files?filters[category][]=#{category.id.to_s}" : ""
|
||||||
serial_number = 0
|
serial_number = 0
|
||||||
|
@ -332,7 +332,7 @@ class ArchivesController < ApplicationController
|
||||||
categorie_ids = []
|
categorie_ids = []
|
||||||
if categories.first == "all"
|
if categories.first == "all"
|
||||||
categories = OrbitHelper.widget_module_app.categories
|
categories = OrbitHelper.widget_module_app.categories
|
||||||
categories_sort = get_sorted_cat_with_filter(categories,'orm')
|
categories_sort = get_sorted_cat_with_filter(categories, :orm)
|
||||||
@categories = categories_sort.collect do |cat|
|
@categories = categories_sort.collect do |cat|
|
||||||
cat_id = cat.id.to_s
|
cat_id = cat.id.to_s
|
||||||
categorie_ids << cat_id
|
categorie_ids << cat_id
|
||||||
|
@ -342,7 +342,7 @@ class ArchivesController < ApplicationController
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
categories_sort = get_sorted_cat_with_filter(categories,'id')
|
categories_sort = get_sorted_cat_with_filter(categories, :id)
|
||||||
@categories = categories_sort.collect do |cat|
|
@categories = categories_sort.collect do |cat|
|
||||||
cat_id = cat.id.to_s
|
cat_id = cat.id.to_s
|
||||||
categorie_ids << cat_id
|
categorie_ids << cat_id
|
||||||
|
@ -392,7 +392,7 @@ class ArchivesController < ApplicationController
|
||||||
all_categories_id = all_categories_no_nil.concat(all_categories_with_nil).collect do |cat|
|
all_categories_id = all_categories_no_nil.concat(all_categories_with_nil).collect do |cat|
|
||||||
cat.category_id.to_s
|
cat.category_id.to_s
|
||||||
end
|
end
|
||||||
if cat_type=='id'
|
if cat_type == :id
|
||||||
categories_temp = ModuleApp.where(:key => "archive").first.categories
|
categories_temp = ModuleApp.where(:key => "archive").first.categories
|
||||||
categories = categories_temp.select{|cat| categories.include? cat.id.to_s}
|
categories = categories_temp.select{|cat| categories.include? cat.id.to_s}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue