fix multi-tag display error and url_to_edit

This commit is contained in:
Ruling-Mac 2015-07-17 12:01:18 +08:00
parent 423326d67c
commit 12c5cdbfe4
1 changed files with 23 additions and 4 deletions

View File

@ -9,7 +9,7 @@ class ArchivesController < ApplicationController
ts = files_by_category_tag.keys.collect do |t|
archives = files_by_category_tag[t].collect do |archive|
statuses = archive.statuses_with_classname.collect do |status|
{
"status" => status["name"] || "",
@ -37,8 +37,18 @@ class ArchivesController < ApplicationController
"files" => files
}
end
tag_name = ""
if(!t.nil?)
t.each do |item|
tag_name += item.name + " + "
end
end
tag_name = (tag_name[0...-2] rescue "")
{
"tag-name" => (t[0].name rescue ""),
"tag-name" => tag_name,
"archives" => archives
}
@ -54,7 +64,7 @@ class ArchivesController < ApplicationController
{
"category-title" => cat.title || "",
"tags" => ts,
"link_to_edit" => url_to_edit
"url_to_edit" => url_to_edit
}
end
@ -91,8 +101,17 @@ class ArchivesController < ApplicationController
"archive_url" => OrbitHelper.widget_more_url
}
end
tag_name = ""
if(!t.nil?)
t.each do |item|
tag_name += item.name + " + "
end
end
tag_name = (tag_name[0...-2] rescue "")
{
"tag-name" => (t[0].name rescue ""),
"tag-name" => tag_name,
"archives" => archives
}