From 12c5cdbfe4025f9a2a8f9e2733762ccbe35c31f6 Mon Sep 17 00:00:00 2001 From: Ruling-Mac Date: Fri, 17 Jul 2015 12:01:18 +0800 Subject: [PATCH] fix multi-tag display error and url_to_edit --- app/controllers/archives_controller.rb | 27 ++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/app/controllers/archives_controller.rb b/app/controllers/archives_controller.rb index febc87e..0a1c069 100644 --- a/app/controllers/archives_controller.rb +++ b/app/controllers/archives_controller.rb @@ -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 }