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|
|
||||
|
||||
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}" : ""
|
||||
ts = []
|
||||
files_by_category_tag.keys.each do |t|
|
||||
|
@ -39,10 +38,13 @@ class ArchivesController < ApplicationController
|
|||
if t.count > 1
|
||||
t.each do |inner_tag|
|
||||
index = ts.index{|tot| tot["tag-name"] == inner_tag.name}
|
||||
if !index.nil?
|
||||
ts[index]["archives"] << a
|
||||
if index.nil?
|
||||
ts << {
|
||||
"tag-name" => (inner_tag.name rescue ""),
|
||||
"archives" => [a]
|
||||
}
|
||||
else
|
||||
archives << a
|
||||
ts[index]["archives"] << a
|
||||
end
|
||||
end
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue