fixed tags problem
This commit is contained in:
parent
a595d1611b
commit
1526e3eccc
|
@ -4,7 +4,6 @@ class ArchivesController < ApplicationController
|
||||||
cats = files_by_cateogry.keys.collect do |cat|
|
cats = files_by_cateogry.keys.collect do |cat|
|
||||||
|
|
||||||
files_by_category_tag = files_by_cateogry[cat].group_by(&:tags)
|
files_by_category_tag = files_by_cateogry[cat].group_by(&:tags)
|
||||||
|
|
||||||
url_to_edit = OrbitHelper.user_has_cateogry?(cat) ? "/admin/archive_files?filters[category][]=#{cat.id.to_s}" : ""
|
url_to_edit = OrbitHelper.user_has_cateogry?(cat) ? "/admin/archive_files?filters[category][]=#{cat.id.to_s}" : ""
|
||||||
ts = []
|
ts = []
|
||||||
files_by_category_tag.keys.each do |t|
|
files_by_category_tag.keys.each do |t|
|
||||||
|
@ -39,10 +38,13 @@ class ArchivesController < ApplicationController
|
||||||
if t.count > 1
|
if t.count > 1
|
||||||
t.each do |inner_tag|
|
t.each do |inner_tag|
|
||||||
index = ts.index{|tot| tot["tag-name"] == inner_tag.name}
|
index = ts.index{|tot| tot["tag-name"] == inner_tag.name}
|
||||||
if !index.nil?
|
if index.nil?
|
||||||
ts[index]["archives"] << a
|
ts << {
|
||||||
|
"tag-name" => (inner_tag.name rescue ""),
|
||||||
|
"archives" => [a]
|
||||||
|
}
|
||||||
else
|
else
|
||||||
archives << a
|
ts[index]["archives"] << a
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue