fix multi-tag display error and url_to_edit
This commit is contained in:
		
							parent
							
								
									423326d67c
								
							
						
					
					
						commit
						12c5cdbfe4
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
 | 
			
		||||
				}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue