From 878f48079d0e1964b6aa465b13066903822f7a55 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sat, 29 Aug 2015 10:36:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=85=A8=E9=80=89=E6=A1=86=E5=9C=A8?= =?UTF-8?q?=E7=BF=BB=E9=A1=B5=E5=90=8E=E4=B9=9F=E5=BA=94=E8=AF=A5=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E4=B8=BA=E4=B8=8D=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_resource.js.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/users/user_resource.js.erb b/app/views/users/user_resource.js.erb index 3ebb308b4..dcb22ccf3 100644 --- a/app/views/users/user_resource.js.erb +++ b/app/views/users/user_resource.js.erb @@ -1,4 +1,5 @@ $("#search_div").html('<%= escape_javascript( render :partial => 'resource_search_form',:locals => {:user=>@user,:type=>@type} ) %>'); $("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>'); $("#pages").html('<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>'); -$("#res_count").html(0); \ No newline at end of file +$("#res_count").html(0); +$("#checkboxAll").attr('checked',false); \ No newline at end of file From a111b9a3fd0dd625cd2b89349ea9ba995132439f Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 29 Aug 2015 11:29:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=85=B3=E6=B3=A8ajax?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_show.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/users/_user_show.html.erb b/app/views/users/_user_show.html.erb index 7cbb20e40..9eabb2be5 100644 --- a/app/views/users/_user_show.html.erb +++ b/app/views/users/_user_show.html.erb @@ -30,9 +30,13 @@ 编辑资料 <%else%> <%if(user.watched_by?(User.current))%> - 取消关注 + + <%=link_to "取消关注", watch_path(:object_type=> 'user',:object_id=>user.id,:target_id=>user.id, :remote => "true"), :class => "fr qx_btn mr10", :method => "delete", :title => "取消关注" %> + <% else %> - 添加关注 + + <%= link_to "添加关注", watch_path(:object_type=>'user',:object_id=>user.id,:target_id=>user.id, :remote => "true"), :class => "fr gz_btn mr10", :method => "post", :title => "添加关注" %> + <% end %> <% end%> <% end %> From 2b7beaeae8c2b0c9cb732d7a6ab798be7877d9ff Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sat, 29 Aug 2015 11:35:33 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=B8=8A=E6=AC=A1=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E7=9A=84=E5=9C=B0=E5=9D=80=E7=94=A8=E6=88=B7id=E5=8F=98?= =?UTF-8?q?=E4=B8=BA=E5=BD=93=E5=89=8D=E7=94=A8=E6=88=B7id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 10e5e6f06..698b0de48 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -563,6 +563,7 @@ class ApplicationController < ActionController::Base uri = URI.parse(back_url) # do not redirect user to another host or to the login or register page if (uri.relative? || (uri.host == request.host)) && !uri.path.match(%r{/(login|account/register)}) + back_url = back_url.gsub(%r{\/users\/(\d+)},"/users/"+default.id.to_s) redirect_to(back_url) return end