From e4ea97486b5c77555eb2a7ab6920cdcc441c3b9a Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 19 Mar 2015 15:43:52 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=87=E7=AD=BE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/tags/_new_tag.html.erb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/views/tags/_new_tag.html.erb b/app/views/tags/_new_tag.html.erb index 7db324cd7..ddaa6bf2f 100644 --- a/app/views/tags/_new_tag.html.erb +++ b/app/views/tags/_new_tag.html.erb @@ -18,6 +18,15 @@ <% else %>
<%= render :partial => "tags/new_tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %> + + 添加标签 +
<% end %> From 308568d668a347d46dfb3c73b4ef0ff3d8a4cd07 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 19 Mar 2015 15:48:50 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=9C=AA=E7=99=BB=E5=BD=95=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=B8=8D=E5=AE=B9=E8=AE=B8=E7=BB=99=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/tags/_new_tag.html.erb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/views/tags/_new_tag.html.erb b/app/views/tags/_new_tag.html.erb index ddaa6bf2f..bc947e5c5 100644 --- a/app/views/tags/_new_tag.html.erb +++ b/app/views/tags/_new_tag.html.erb @@ -18,15 +18,17 @@ <% 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 %> 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 3/5] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E5=88=A0?= =?UTF-8?q?=E9=99=A4TAG=E5=90=8Ejs=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2=202?= =?UTF-8?q?=E3=80=81=E5=88=A0=E9=99=A4=E8=AF=BE=E7=A8=8BTAG=E6=97=B6?= =?UTF-8?q?=E5=A2=9E=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 From 3bd0bf3c4962f3bc6857f7c667ee4a5988403a58 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 19 Mar 2015 16:20:32 +0800 Subject: [PATCH 4/5] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E6=A0=87?= =?UTF-8?q?=E7=AD=BEurl=E4=BF=AE=E6=94=B9=202=E3=80=81=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=98=AFjs=E9=A1=B5=E9=9D=A2=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/tags/_new_tag_name.html.erb | 2 +- app/views/tags/tag_save.js.erb | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/views/tags/_new_tag_name.html.erb b/app/views/tags/_new_tag_name.html.erb index 6d8d58adb..3e8c2c021 100644 --- a/app/views/tags/_new_tag_name.html.erb +++ b/app/views/tags/_new_tag_name.html.erb @@ -19,7 +19,7 @@ <% if User.current.logged?%> <%= l(:label_add_tag)%>