From 50aa22c5e53ebb68869b6288950c7df5db1b39f3 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 10 Sep 2015 10:01:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E7=9A=84=E2=80=9C=E7=82=B9=E5=87=BB=E5=B1=95=E5=BC=80=E6=9B=B4?= =?UTF-8?q?=E5=A4=9A=E2=80=9D=E6=94=B9=E4=B8=BA=E2=80=9C=E8=BD=BB=E6=8A=9A?= =?UTF-8?q?=E5=B1=95=E5=BC=80=E6=9B=B4=E5=A4=9A=E2=80=9D=EF=BC=8C=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E7=A7=BB=E5=88=B0=E6=96=B9=E6=A1=86=E4=B8=8A=E5=8D=B3?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8A=A0=E8=BD=BD=E6=9B=B4=E5=A4=9A=E5=8A=A8?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_activities.html.erb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index f071cbeb4..5ab315fab 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -62,5 +62,12 @@ <% end %> <% if user_activities.count == 10%> - <%= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> +
轻抚展开更多<%=link_to "", user_activities_path(@user.id,:type => type,:page => page),:id => "more_activities_link",:remote => "true",:class => "none" %>
+ <%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> <% end%> + + \ No newline at end of file From a29ab60481a788aaa1fb6ae9413bf760fed07980 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Thu, 10 Sep 2015 11:34:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=80=81=E5=B8=88=E7=9A=84=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=BB=93=E6=9E=9C=E8=83=BD=E6=98=BE=E7=A4=BA=E5=87=BA?= =?UTF-8?q?=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 2 +- app/controllers/users_controller.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 593d6bf53..018a293e3 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -631,7 +631,7 @@ class StudentWorkController < ApplicationController unless @homework.save logger.debug @homework.errors.full_messages else - student_work = @homework.student_works.where(user_id: User.current.id).first + student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id).first end end student_work diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9b2d49f2d..d71b24fc8 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -354,7 +354,7 @@ class UsersController < ApplicationController @user = User.current @homework = HomeworkCommon.find(params[:homework_id]) @is_test = params[:is_test] == 'true' - @student_work = @homework.student_works.where(user_id: User.current.id).first + @student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id).first if @student_work.nil? @student_work = StudentWork.new end @@ -369,7 +369,7 @@ class UsersController < ApplicationController def user_commit_homework homework = HomeworkCommon.find(params[:homework]) - student_work = homework.student_works.where(user_id: User.current.id).first + student_work = StudentWork.where(homework_common_id: homework.id, user_id: User.current.id).first if student_work student_work.save flash[:notice] = l(:notice_successful_create)