From 704954583b9f7a1af3223c25ca979bca5bd046f6 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 16 Dec 2015 09:15:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=A0=8F=E7=9B=AE=E6=96=B0?= =?UTF-8?q?=E5=A2=9ETag=E5=90=8E=EF=BC=8C=E6=9B=B4=E6=96=B0=E7=9B=B8?= =?UTF-8?q?=E5=BA=94=E7=9A=84tag=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tags_controller.rb | 4 ++++ app/views/files/_subfield_tags.html.erb | 2 +- app/views/tags/tag_save.js.erb | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 82adc1fff..511fafdba 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -378,6 +378,10 @@ class TagsController < ApplicationController @course = @obj.container @tag_list = @tag_list = get_course_tag_list @course end + if @obj && @obj_flag == '6' && @obj.container.kind_of?(OrgSubfield) + @org_subfield = @obj.container + @tag_list = @tag_list = get_org_subfield_tag_list @org_subfield + end respond_to do |format| format.js format.html diff --git a/app/views/files/_subfield_tags.html.erb b/app/views/files/_subfield_tags.html.erb index 1a2c896fc..b037fcaf4 100644 --- a/app/views/files/_subfield_tags.html.erb +++ b/app/views/files/_subfield_tags.html.erb @@ -1,4 +1,4 @@ -<% if org_subfield && tag_list && tag_list.empty? == false%> +<% if org_subfield %> -<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_list', :locals => {:obj => @obj,:object_flag => @obj_flag,:select_tag_name => @select_tag_name}) %>'); $("#files_tag").html("<%= escape_javascript(render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => @course,:tag_name => @select_tag_name}) %>"); - <%else%> + <%elsif @project%> $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").replaceWith('<%= escape_javascript(render :partial => 'tags/tag_new', :locals => {:obj => @obj, :object_flag => "6"}) %>'); + <% else %> + $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); + $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").replaceWith('<%= escape_javascript(render :partial => 'tags/tag_new', :locals => {:obj => @obj, :object_flag => "6"}) %>'); + $("#files_tag").html("<%= escape_javascript(render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name})%>"); //render :partial => 'tags/course_attachment_tag_name', //:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) <%end%>