From 8a6da7a0a1bd487acd308035a6ac5aac7e479857 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sun, 2 Nov 2014 13:18:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=8F=82=E4=B8=8E=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E5=A2=9E=E5=8A=A0=E9=80=80=E5=87=BA=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA=EF=BC=8C=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E5=8F=82=E4=B8=8E=E4=BA=BA=E5=91=98=E8=87=AA=E4=B8=BB=E9=80=80?= =?UTF-8?q?=E5=87=BA=E4=BD=9C=E4=B8=9A=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_attach_controller.rb | 3 +++ app/views/homework_attach/_homework.html.erb | 5 +++++ app/views/homework_attach/destory_homework_users.js.erb | 5 ++++- config/locales/zh.yml | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 38195bd5b..76342862e 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -182,6 +182,9 @@ class HomeworkAttachController < ApplicationController homework_user = @homework.homework_users.where("user_id = #{params[:user_id]}").first homework_user.destroy get_homework_member @homework + + @homework_list = [] + @is_my_homework = true respond_to do |format| format.js end diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb index b84f36984..27cdc0fa6 100644 --- a/app/views/homework_attach/_homework.html.erb +++ b/app/views/homework_attach/_homework.html.erb @@ -45,8 +45,13 @@
  • <%= link_to l(:button_edit), edit_homework_attach_path(homework) %> <% if homework.user == User.current || User.current.admin? %> + <%= link_to(l(:label_bid_respond_delete), homework, method: :delete, :confirm => l(:text_are_you_sure), :remote => true ) %> + <% else %> + + <%= link_to l(:label_logout), destory_homework_users_homework_attach_path(homework,:user_id=>User.current.id), + :remote => true, :confirm => l(:label_sure_exit_homework) %> <% end %>
  • <% elsif is_student_batch_homework%> diff --git a/app/views/homework_attach/destory_homework_users.js.erb b/app/views/homework_attach/destory_homework_users.js.erb index dc4b0cc56..5df8597d8 100644 --- a/app/views/homework_attach/destory_homework_users.js.erb +++ b/app/views/homework_attach/destory_homework_users.js.erb @@ -1 +1,4 @@ -$('#content2').html('<%= escape_javascript(render(:partial => 'homework_member', :locals => {:members => @members,:hoemwork_users =>@hoemwork_users,:homework => @homework} )) %>'); \ No newline at end of file +$('#content2').html('<%= escape_javascript(render(:partial => 'homework_member', :locals => {:members => @members,:hoemwork_users =>@hoemwork_users,:homework => @homework} )) %>'); + +$('#tbc_01').html('<%= escape_javascript(render(:partial => 'homeworks_list', + :locals => {:homeworks => @homework_list, :bid => @bid, :remote => true, :is_my_homework => @is_my_homework} )) %>'); \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 3df099ef5..1bbc2354e 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2179,3 +2179,4 @@ zh: label_create_person: 创建人员 label_participation_person: 参与人员 label_homework_without_description: 该作业无任何描述! + label_sure_exit_homework: 是否确认退出该作业