作业参与人员增加退出作业按钮显示,实现参与人员自主退出作业的功能

This commit is contained in:
sw 2014-11-02 13:18:02 +08:00
parent 78bc458e84
commit 8a6da7a0a1
4 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -45,8 +45,13 @@
<li class="wmine">
<%= 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 %>
</li>
<% elsif is_student_batch_homework%>

View File

@ -1 +1,4 @@
$('#content2').html('<%= escape_javascript(render(:partial => 'homework_member', :locals => {:members => @members,:hoemwork_users =>@hoemwork_users,:homework => @homework} )) %>');
$('#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} )) %>');

View File

@ -2179,3 +2179,4 @@ zh:
label_create_person: 创建人员
label_participation_person: 参与人员
label_homework_without_description: 该作业无任何描述!
label_sure_exit_homework: 是否确认退出该作业