From 46410c8e8dbd3b8974765bb5b934f314740d0a41 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 19 Mar 2015 16:02:02 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E5=88=A0=E9=99=A4T?= =?UTF-8?q?AG=E5=90=8Ejs=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2=202=E3=80=81?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=AF=BE=E7=A8=8BTAG=E6=97=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/tags_controller.rb | 4 ++-- app/views/tags/_new_tag.html.erb | 11 ----------- app/views/tags/_new_tag_name.html.erb | 16 ++++++++++++++-- app/views/tags/remove_tag.js.erb | 6 ++++-- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 5bd5fb0e3..6738d2135 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -73,7 +73,7 @@ class TagsController < ApplicationController @issues_results, @bids_results, @forums_results, - @attachments_results, + @attachments_results, @contests_results, @courses_results, @open_source_projects_results= refresh_results(@obj_id,@obj_flag,@selected_tags) @@ -109,7 +109,7 @@ class TagsController < ApplicationController @issues_results, @bids_results, @forums_results, - @attachments_results, + @attachments_results, @contests_results, @courses_results, @open_source_projects_results= refresh_results(@obj_id,@show_flag) diff --git a/app/views/tags/_new_tag.html.erb b/app/views/tags/_new_tag.html.erb index bc947e5c5..7db324cd7 100644 --- a/app/views/tags/_new_tag.html.erb +++ b/app/views/tags/_new_tag.html.erb @@ -18,17 +18,6 @@ <% else %>
<%= render :partial => "tags/new_tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %> - <% if User.current.logged?%> - <%= l(:label_add_tag)%> - - <% end%>
<% end %> diff --git a/app/views/tags/_new_tag_name.html.erb b/app/views/tags/_new_tag_name.html.erb index a1fb3fa46..6d8d58adb 100644 --- a/app/views/tags/_new_tag_name.html.erb +++ b/app/views/tags/_new_tag_name.html.erb @@ -9,9 +9,21 @@ <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id, :class => 'pt5' %> - <%= link_to('x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,:taggable_id => obj.id, :taggable_type => object_flag) if (CourseInfos.find_by_course_id(obj.id)).try(:user_id) == User.current.id %> + <%= link_to('x', remove_tag_path(:tag_name => tag,:taggable_id => obj.id, :taggable_type => object_flag), :remote => true, :confirm => l(:text_are_you_sure) ) if (CourseInfos.find_by_course_id(obj.id)).try(:user_id) == User.current.id %> <% end %> <% end %> -<% end %> \ No newline at end of file +<% end %> + +<% if User.current.logged?%> + <%= l(:label_add_tag)%> + +<% end%> \ No newline at end of file diff --git a/app/views/tags/remove_tag.js.erb b/app/views/tags/remove_tag.js.erb index dbad80f96..b102776d5 100644 --- a/app/views/tags/remove_tag.js.erb +++ b/app/views/tags/remove_tag.js.erb @@ -6,8 +6,10 @@ $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_n $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty(); $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_name', :locals => {:obj => @obj,:non_list_all => false, :object_flag => @object_flag}) %>'); -<% else %> +<% elsif @object_flag == '9'%> + $('#tags_show').html('<%= escape_javascript(render :partial => 'tags/new_tag_name', + :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>'); +<% else%> $('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name', :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>'); - <% end %> \ No newline at end of file