资源栏目新增Tag后,更新相应的tag数量

This commit is contained in:
ouyangxuhua 2015-12-16 09:15:54 +08:00
parent af157a9c63
commit 704954583b
3 changed files with 10 additions and 2 deletions

View File

@ -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

View File

@ -1,4 +1,4 @@
<% if org_subfield && tag_list && tag_list.empty? == false%>
<% if org_subfield %>
<span class="files_tag_icon" >
<a title=""
onclick="search_org_subfield_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','','<%= @q%>','<%= org_subfield.id%>');"

View File

@ -18,9 +18,13 @@ $('#tags_name2').val("");
$("#tags_show-<%=@obj.class%>-<%=@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%>