只有全部列表中的学生可编辑分班
This commit is contained in:
parent
0d8052da28
commit
a7b9d8424a
|
@ -242,9 +242,14 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
|
||||
def teacher_assign_group
|
||||
member = Member.where(:course_id => @course.id, :user_id => User.current.id).first
|
||||
member = Member.where(:course_id => @course.id, :user_id => params[:user_id]).first
|
||||
member.course_group_id = params[:course_group_id].to_i
|
||||
member.save
|
||||
@course_groups = @course.course_groups
|
||||
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def join_group
|
||||
|
|
|
@ -60,12 +60,12 @@
|
|||
<% end%>
|
||||
</ul>
|
||||
<% if User.current.allowed_to?(:as_teacher, @course) || User.current.admin? %>
|
||||
<% if @course.course_groups.nil? %>
|
||||
<% if @course.course_groups.nil? || @group %>
|
||||
<div class="select-class-option fl" style="margin-left: 105px;">
|
||||
<span style="width: 100px; text-align: center; float: left;" class="hidden">暂无</span>
|
||||
<span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %>
|
||||
<%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %>
|
||||
<div class="select-class-option fl" style="margin-left: 105px;"><span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
|
||||
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2 ml5"></a>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
$("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>");
|
Loading…
Reference in New Issue