Merge branch 'cxt_course' of https://git.trustie.net/jacknudt/trustieforge into cxt_course
This commit is contained in:
commit
f730b48eac
|
@ -292,30 +292,79 @@ class CoursesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def teacher_assign_group
|
def teacher_assign_group
|
||||||
member = Member.where(:course_id => @course.id, :user_id => params[:user_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.course_group_id = params[:course_group_id].to_i
|
||||||
member.save
|
@member.save
|
||||||
|
if params[:group_id] && params[:group_id] != "-1"
|
||||||
|
@group = CourseGroup.find params[:group_id]
|
||||||
|
results = student_homework_score(@group.id,0,0,"desc")
|
||||||
|
@limit = 50
|
||||||
|
@page = params[:page].nil? ? 1 : params['page'].to_i
|
||||||
|
@members_count = results.count
|
||||||
|
@mem_pages = Paginator.new @members_count, @limit, @page
|
||||||
|
@results = paginateHelper results, @limit
|
||||||
|
else
|
||||||
@course_groups = @course.course_groups
|
@course_groups = @course.course_groups
|
||||||
@no_group_count = @course.student.count - @course.members.where("course_group_id != 0").count
|
@no_group_count = @course.student.count - @course.members.where("course_group_id != 0").count
|
||||||
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
end
|
||||||
|
@canShowCode = isCourseTeacher(User.current.id,@course)
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def join_group
|
def join_group
|
||||||
@subPage_title = l :label_student_list
|
|
||||||
group = CourseGroup.find(params[:object_id])
|
group = CourseGroup.find(params[:object_id])
|
||||||
member = Member.where(:course_id => @course.id, :user_id => User.current.id).first
|
member = Member.where(:course_id => @course.id, :user_id => User.current.id).first
|
||||||
member.course_group_id = group.id
|
member.course_group_id = group.id
|
||||||
member.save
|
member.save
|
||||||
@group = group
|
@group = group
|
||||||
|
|
||||||
@course_groups = @course.course_groups
|
#@course_groups = @course.course_groups
|
||||||
@no_group_count = @course.student.count - @course.members.where("course_group_id != 0").count
|
#@no_group_count = @course.student.count - @course.members.where("course_group_id != 0").count
|
||||||
|
redirect_to group_member_course_path(@course, :group_id => @group.id)
|
||||||
search_group_members group
|
#search_group_members group
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#查找未分班的学生
|
||||||
|
def search_not_group_member
|
||||||
|
@group = CourseGroup.find params[:group_id]
|
||||||
|
@search = params[:search]
|
||||||
|
q = params[:search] ? "#{params[:search].strip}" : ""
|
||||||
|
@members = []
|
||||||
|
if q.nil? || q == ""
|
||||||
|
@course.members.includes(:user =>[:user_extensions =>[]]).where("course_group_id = 0").each do |m|
|
||||||
|
if m && m.user && m.user.join_in?(@course)
|
||||||
|
@members << m
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
@course.members.includes(:user =>[:user_extensions =>[]]).where("course_group_id = 0").each do |m|
|
||||||
|
username = m.user[:lastname].to_s.downcase + m.user[:firstname].to_s.downcase
|
||||||
|
if m && m.user && m.user.join_in?(@course) && (m.user[:login].to_s.downcase.include?(q) || m.user.user_extensions[:student_id].to_s.downcase.include?(q) || username.include?(q))
|
||||||
|
@members << m
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@is_search = params[:is_search] ? 1 : 0
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def add_members
|
||||||
|
@group = CourseGroup.find params[:group_id]
|
||||||
|
if @group && params[:chooseStudent]
|
||||||
|
params[:chooseStudent].each do |mem|
|
||||||
|
member = Member.find mem
|
||||||
|
if member && member.course == @course
|
||||||
|
member.update_attribute('course_group_id', @group.id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
redirect_to group_member_course_path(@course, :group_id => @group.id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def unjoin_group
|
def unjoin_group
|
||||||
@subPage_title = l :label_student_list
|
@subPage_title = l :label_student_list
|
||||||
group = CourseGroup.find(params[:object_id])
|
group = CourseGroup.find(params[:object_id])
|
||||||
|
@ -353,6 +402,28 @@ class CoursesController < ApplicationController
|
||||||
@results = paginateHelper @results, @limit
|
@results = paginateHelper @results, @limit
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def group_member
|
||||||
|
@canShowCode = isCourseTeacher(User.current.id,@course)
|
||||||
|
@sort_type = 'score'
|
||||||
|
@score_sort_by = "desc"
|
||||||
|
if params[:group_id] && params[:group_id] != "0" && params[:group_id] != "-1"
|
||||||
|
@group = CourseGroup.find(params[:group_id])
|
||||||
|
@results = student_homework_score(@group.id,0, 0,"desc")
|
||||||
|
else
|
||||||
|
page_from = params[:page].nil? ? 0 : (params[:page].to_i - 1)
|
||||||
|
@results = student_homework_score(0,page_from, 10,"desc")
|
||||||
|
end
|
||||||
|
@limit = 50
|
||||||
|
@page = params[:page].nil? ? 1 : params['page'].to_i
|
||||||
|
@members_count = @results.count
|
||||||
|
@mem_pages = Paginator.new @members_count, @limit, @page
|
||||||
|
@results = paginateHelper @results, @limit
|
||||||
|
respond_to do |format|
|
||||||
|
format.html {render :layout => 'base_courses'}
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def member
|
def member
|
||||||
## 有角色参数的才是课程,没有的就是项目
|
## 有角色参数的才是课程,没有的就是项目
|
||||||
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
|
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
|
||||||
|
@ -399,7 +470,14 @@ class CoursesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def export_course_member_excel
|
def export_course_member_excel
|
||||||
|
if params[:group_id]
|
||||||
|
group = CourseGroup.find params[:group_id]
|
||||||
|
unless group.nil?
|
||||||
|
@all_members = student_homework_score(@group.id,0,0,"desc")
|
||||||
|
end
|
||||||
|
else
|
||||||
@all_members = student_homework_score(0,0,0,"desc")
|
@all_members = student_homework_score(0,0,0,"desc")
|
||||||
|
end
|
||||||
@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at asc")
|
@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at asc")
|
||||||
filename="#{@course.teacher.lastname.to_s + @course.teacher.firstname.to_s }_#{@course.name}_#{@course.time.to_s + @course.term}#{l(:excel_member_list)}";
|
filename="#{@course.teacher.lastname.to_s + @course.teacher.firstname.to_s }_#{@course.name}_#{@course.time.to_s + @course.term}#{l(:excel_member_list)}";
|
||||||
|
|
||||||
|
@ -486,6 +564,7 @@ class CoursesController < ApplicationController
|
||||||
#添加成员消息状态
|
#添加成员消息状态
|
||||||
join_course_messages = CourseMessage.where("user_id =? and course_message_type =? and course_id =? and status = ? and viewed =?", User.current.id, 'JoinCourse', @course.id, 1, 0)
|
join_course_messages = CourseMessage.where("user_id =? and course_message_type =? and course_id =? and status = ? and viewed =?", User.current.id, 'JoinCourse', @course.id, 1, 0)
|
||||||
join_course_messages.update_all(:viewed => true)
|
join_course_messages.update_all(:viewed => true)
|
||||||
|
@tab = params[:tab].to_i || 0
|
||||||
if User.current.allowed_to?(:as_teacher,@course)
|
if User.current.allowed_to?(:as_teacher,@course)
|
||||||
@select_tab = params[:tab]
|
@select_tab = params[:tab]
|
||||||
@issue_custom_fields = IssueCustomField.sorted.all
|
@issue_custom_fields = IssueCustomField.sorted.all
|
||||||
|
@ -1366,14 +1445,16 @@ class CoursesController < ApplicationController
|
||||||
|
|
||||||
#当加入,退出分班时查询分班的学生
|
#当加入,退出分班时查询分班的学生
|
||||||
def search_group_members group
|
def search_group_members group
|
||||||
@subPage_title = l :label_student_list
|
|
||||||
@render_file = 'new_member_list'
|
@render_file = 'new_member_list'
|
||||||
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
@canShowCode = isCourseTeacher(User.current.id,@course)
|
||||||
@is_remote = true
|
@is_remote = true
|
||||||
@score_sort_by = "desc"
|
@score_sort_by = "desc"
|
||||||
page_from = params[:page].nil? ? 0 : (params[:page].to_i - 1)
|
|
||||||
@results = student_homework_score(group.id,0,0, "desc")
|
@results = student_homework_score(group.id,0,0, "desc")
|
||||||
|
@limit = 50
|
||||||
|
@page = params[:page].nil? ? 1 : params['page'].to_i
|
||||||
|
@members_count = @results.count
|
||||||
|
@mem_pages = Paginator.new @members_count, @limit, @page
|
||||||
|
@results = paginateHelper @results, @limit
|
||||||
end
|
end
|
||||||
|
|
||||||
def member_to_xls homeworks, course, members,groups
|
def member_to_xls homeworks, course, members,groups
|
||||||
|
|
|
@ -149,34 +149,14 @@ module WatchersHelper
|
||||||
link_to text, url, :remote => true, :method => method, :id => "#{course.id}", :class => []+options
|
link_to text, url, :remote => true, :method => method, :id => "#{course.id}", :class => []+options
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def join_in_course_group(coursegroups,group, user, options=[])
|
def join_in_course_group(course, group, user, options=[])
|
||||||
return '' unless user && user.logged?
|
return '' unless user && user.logged? && user.member_of_course?(course)
|
||||||
|
|
||||||
@isjoin = false
|
|
||||||
coursegroups.each do |g|
|
|
||||||
g.members.each do |mem|
|
|
||||||
if mem.user_id == user.id
|
|
||||||
@isjoin = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
url_t = join_group_path(:object_id => group.id)
|
|
||||||
url_f = join_group_path(:object_id => group.id)
|
|
||||||
if @isjoin == true
|
|
||||||
joined = user.member_of_course_group?(group)
|
joined = user.member_of_course_group?(group)
|
||||||
text = l(:label_exit_group)
|
|
||||||
|
|
||||||
if joined
|
unless joined
|
||||||
link_to text, {:controller => "courses", :action => "join_group", :object_id => "#{group.id}"},
|
text = l(:label_join_group)
|
||||||
:remote => true, :method => 'delete',
|
form_tag({:controller => "courses", :action => "join_group", :object_id => "#{group.id}"},:id => 'join_coursegroup_form', :method => 'post') do
|
||||||
:id => "#{group.id}", :style => "padding: 2px 8px 2px; background-color:#15bccf; color:#fff; ",
|
link_to text, 'javascript:void(0)', :class => 'sy_btn_green fl mr10', :onclick => "$('#join_coursegroup_form').submit();"
|
||||||
:confirm => l(:text_are_you_sure_out_group), :class => 'group_in'
|
|
||||||
|
|
||||||
end
|
|
||||||
else
|
|
||||||
text = l(:label_new_join_group)
|
|
||||||
form_tag({:controller => "courses", :action => "join_group", :object_id => "#{group.id}"}, :remote => true, :method => 'post') do
|
|
||||||
submit_tag text, class: "group_in", style: "width: 90px;height: 21px; background-color:#15bccf; color:#fff;"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -24,6 +24,11 @@
|
||||||
<div class="NewsBannerName">
|
<div class="NewsBannerName">
|
||||||
<%= @board.parent_id.nil? ? "班级讨论区" : "#{@board.name}" %>
|
<%= @board.parent_id.nil? ? "班级讨论区" : "#{@board.name}" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@board.course)) %>
|
||||||
|
<% if is_teacher %>
|
||||||
|
<%= link_to "添加子栏目", settings_course_path(@board.course.id,4), :class => "link-blue fr mt5" %>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div nhname="topic_form">
|
<div nhname="topic_form">
|
||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
|
|
|
@ -0,0 +1,78 @@
|
||||||
|
<div class="f14 fb fontGrey3 mb10">选择成员加入分班</div>
|
||||||
|
<div class="fl mr10">
|
||||||
|
<input type="text" name="search" value="<%=@search %>" placeholder="输入学生登录名/姓名/学号进行搜索" class="subjectSearch" />
|
||||||
|
<div class="cl"></div>
|
||||||
|
<%= form_tag(add_members_course_path(@course, :group_id => @group.id), method: 'post',:class => "f_l",:id => "add_group_members") do %>
|
||||||
|
<div id="search_member_list">
|
||||||
|
<%=render :partial => 'search_member_list', :locals => {:members => members} %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<span class="c_red none" id="add_members_notice"></span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="submit_add_members_form();">确定</a></div>
|
||||||
|
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText" onclick="hideModal();">取消</a></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var lastSearchCondition = '';
|
||||||
|
var count = 0;
|
||||||
|
function search_mems(e){
|
||||||
|
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
lastSearchCondition = $(e.target).val().trim();
|
||||||
|
$.ajax({
|
||||||
|
url: '<%= url_for(:controller => 'courses', :action => 'search_not_group_member', :id => @group.course.id) %>'+'?search='+ e.target.value+'&group_id=<%=@group.id %>&is_search=1',
|
||||||
|
type:'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function throttle(method,context,e){
|
||||||
|
clearTimeout(method.tId);
|
||||||
|
method.tId=setTimeout(function(){
|
||||||
|
method.call(context,e);
|
||||||
|
},500);
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询项目
|
||||||
|
$("input[name='search']").on('input', function (e) {
|
||||||
|
throttle(search_mems,window,e);
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
<% if members.empty? %>
|
||||||
|
$("#add_members_notice").show();
|
||||||
|
$("#add_members_notice").html("不存在未分班的成员");
|
||||||
|
<% end %>
|
||||||
|
$("input[name='chooseAll']").live('click',function(){
|
||||||
|
if($("input[name='chooseAll']").attr("checked")){
|
||||||
|
$("input[name='chooseStudent[]']").attr("checked",true);
|
||||||
|
};
|
||||||
|
if(!$("input[name='chooseAll']").attr("checked")){
|
||||||
|
$("input[name='chooseStudent[]']").attr("checked",false);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
$("input[name='chooseStudent[]']").live('click',function(){
|
||||||
|
if(!$(this).attr("checked")){
|
||||||
|
$("input[name='chooseAll']").attr("checked",false);
|
||||||
|
}
|
||||||
|
if($("input[name='chooseStudent[]']:checked").length == $("input[name='chooseStudent[]']").length){
|
||||||
|
$("input[name='chooseAll']").attr("checked",true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function submit_add_members_form(){
|
||||||
|
if($("input[name='chooseStudent[]']:checked").length == 0) {
|
||||||
|
$("#add_members_notice").show();
|
||||||
|
$("#add_members_notice").html("请先选择学生");
|
||||||
|
} else{
|
||||||
|
$("#add_group_members").submit();
|
||||||
|
hideModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -0,0 +1,6 @@
|
||||||
|
<% if @canShowCode %>
|
||||||
|
<%= link_to '添加成员', search_not_group_member_course_path(@course,:group_id => @group.id),:remote => true, :class => "sy_btn_green fl mr10" %>
|
||||||
|
<% else %>
|
||||||
|
<%= join_in_course_group(@course,@group, User.current) %>
|
||||||
|
<!--<span class="c_red none fl" id="join_group_notice"></span>-->
|
||||||
|
<% end %>
|
|
@ -67,7 +67,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% members.each_with_index do |member, i| %>
|
<% members.each_with_index do |member, i| %>
|
||||||
<tr class="clear">
|
<tr class="clear" id="member_li_<%=member.id %>">
|
||||||
<% user = member.user %>
|
<% user = member.user %>
|
||||||
<% hw_score = member.score.nil? ? 0 : member.score %>
|
<% hw_score = member.score.nil? ? 0 : member.score %>
|
||||||
<% ex_score = member.ex_score.nil? ? 0 : member.ex_score %>
|
<% ex_score = member.ex_score.nil? ? 0 : member.ex_score %>
|
||||||
|
@ -116,7 +116,7 @@
|
||||||
<% if @course.course_groups.empty? %>
|
<% if @course.course_groups.empty? %>
|
||||||
<%=member.course_group_id == 0 ? "暂无" : member.course_group.name %>
|
<%=member.course_group_id == 0 ? "暂无" : member.course_group.name %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= 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 %>
|
<%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id, :group_id => @group ? @group.id : -1},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %>
|
||||||
<div class="select-class-option">
|
<div class="select-class-option">
|
||||||
<span class="hidden" style="display:inline-block; vertical-align:middle; max-width:70px;"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
|
<span class="hidden" style="display:inline-block; vertical-align:middle; max-width:70px;"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
|
||||||
<a href="javascript:void(0)" class="sy_icons_edit pic_edit_icon" alt="编辑" style="background-position:0 5px;"></a>
|
<a href="javascript:void(0)" class="sy_icons_edit pic_edit_icon" alt="编辑" style="background-position:0 5px;"></a>
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
<div class="mt10" style="height:330px; min-height:330px; max-height:330px; overflow:auto;">
|
||||||
|
<ul class="fontGrey2" style="line-height:30px;">
|
||||||
|
<li class="fl w50"><input type="checkbox" name="chooseAll" class="mr5" style="vertical-align:middle;" /></li>
|
||||||
|
<li class="fl w125 hidden mr10">姓名</li>
|
||||||
|
<li class="fl w125 tac hidden">学号</li>
|
||||||
|
<li class="cl"></li>
|
||||||
|
</ul>
|
||||||
|
<% unless members.nil? || members.empty? %>
|
||||||
|
<% members.each do |mem| %>
|
||||||
|
<ul class="fontGrey3" style="line-height:30px;">
|
||||||
|
<li class="fl w50"><input type="checkbox" name="chooseStudent[]" value="<%=mem.id %>" class="mr5" style="vertical-align:middle;" /></li>
|
||||||
|
<li class="fl w125 hidden mr10"><%=mem.user.show_name %></li>
|
||||||
|
<% student_id = mem.user.user_extensions.student_id %>
|
||||||
|
<li class="fl w125 tac hidden"><%=student_id.nil? || student_id == "" ? '--' : mem.user.user_extensions.student_id %></li>
|
||||||
|
<li class="cl"></li>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="cl"></div>
|
|
@ -1,4 +1,5 @@
|
||||||
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
|
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
|
||||||
$("#member_content").html("<%= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @members})%>");
|
$("#member_content").html("<%= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @members})%>");
|
||||||
|
$("#group_children_list").html("<%= escape_javascript( render :partial => 'layouts/group_children_list', :locals => {:course => @course})%>");
|
||||||
$('#group_name').val('');
|
$('#group_name').val('');
|
||||||
$('#new_group_name').hide();
|
$('#new_group_name').hide();
|
|
@ -0,0 +1,53 @@
|
||||||
|
<div class="sy_class_r sy_class_nobg fr ml10">
|
||||||
|
<div class="sy_class_r_head mb10">
|
||||||
|
<h3>学生列表(<%=@group.name %>)</h3>
|
||||||
|
<div class="hw_more_box">
|
||||||
|
<ul>
|
||||||
|
<li class="hw_more_icons">
|
||||||
|
<ul class="hw_more_txt">
|
||||||
|
<li><%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:group_id => @group.id ,:format => 'xls'), :class => 'hw_more_li'%></li>
|
||||||
|
<% if @canShowCode %>
|
||||||
|
<li>
|
||||||
|
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'hw_more_li' %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sy_class_fenban clear">
|
||||||
|
<div id="search_members">
|
||||||
|
<div class="clear mb10">
|
||||||
|
<div class="fl" id="join_or_add">
|
||||||
|
<%= render :partial => 'join_or_add'%>
|
||||||
|
</div>
|
||||||
|
<div class="hw_search_box fr">
|
||||||
|
<%= form_tag(searchmembers_course_path(@course), method: 'get',:class => "f_l",:remote=>true,:id => "search_student") do %>
|
||||||
|
<input class="hw_search-input" name="name" id="search_member_input" placeholder="输入学生登录名/姓名/学号进行搜索" type="text">
|
||||||
|
<%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %>
|
||||||
|
<input type="hidden" name="ingroup">
|
||||||
|
<% end %>
|
||||||
|
<a href="javascript:void(0)" class="hw_btn_search" onclick="$('#search_student').submit();"></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<div id="member_content">
|
||||||
|
<%= render :partial => 'new_member_list', :locals => {:members => @results} %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(function(){
|
||||||
|
$("#search_member_input").keypress(function(e){
|
||||||
|
var name = $.trim($('#search_member_input').val());
|
||||||
|
if (e.keyCode == '13' && name != "" && name.length != 0) {
|
||||||
|
$(this).parent().submit();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -1,2 +0,0 @@
|
||||||
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
|
|
||||||
$("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @results})%>");
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
<% if @is_search == 0 %>
|
||||||
|
var htmlvalue = "<%= escape_javascript( render :partial => 'courses/add_members', :locals => {:members => @members} )%>";
|
||||||
|
pop_up_box(htmlvalue,400,30,50);
|
||||||
|
<% else %>
|
||||||
|
$("#search_member_list").html("<%= escape_javascript(render :partial => 'search_member_list', :locals => {:members => @members}) %>");
|
||||||
|
<% end %>
|
|
@ -4,6 +4,10 @@
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
|
var tab = <%= @tab %>;
|
||||||
|
if(tab != 0){
|
||||||
|
course_setting(tab);
|
||||||
|
}
|
||||||
<% if @select_tab == 'member'%>
|
<% if @select_tab == 'member'%>
|
||||||
$("#tb_2").click();
|
$("#tb_2").click();
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1 +1,8 @@
|
||||||
|
<% if @group %>
|
||||||
|
$("#member_li_<%=@member.id %>").html("");
|
||||||
|
//$("#member_content").html("<%#= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @results})%>");
|
||||||
|
$("#join_or_add").html("<%= escape_javascript( render :partial => 'join_or_add')%>");
|
||||||
|
<% else %>
|
||||||
$("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>");
|
$("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>");
|
||||||
|
<% end %>
|
||||||
|
$("#group_children_list").html("<%= escape_javascript( render :partial => 'layouts/group_children_list', :locals => {:course => @course})%>");
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<% unless course_board.children.empty? %>
|
<% unless course_board.children.empty? %>
|
||||||
<ul class="sub-menu">
|
<ul class="sub-menu">
|
||||||
<% course_board.children.reorder("position asc").each do |board| %>
|
<% course_board.children.reorder("position asc").each do |board| %>
|
||||||
<li>
|
<li id="board_children_<%=board.id %>">
|
||||||
<% count = board ? (board.topics.count + Message.where("board_id =? and parent_id is not ?", board.id, nil).count) : 0 %>
|
<% count = board ? (board.topics.count + Message.where("board_id =? and parent_id is not ?", board.id, nil).count) : 0 %>
|
||||||
<a href="<%=course_boards_path(@course, :board_id =>board.id) %>"><font class="hidden dis" style="max-width: 120px;"><%=board.name %></font><span style="vertical-align: top;"><%=count %></span></a>
|
<a href="<%=course_boards_path(@course, :board_id =>board.id) %>"><font class="hidden dis" style="max-width: 120px;"><%=board.name %></font><span style="vertical-align: top;"><%=count %></span></a>
|
||||||
<%= link_to( "",course_boards_path(@course, :board_id =>board.id, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
|
<%= link_to( "",course_boards_path(@course, :board_id =>board.id, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<% unless course.course_groups.empty? %>
|
||||||
|
<ul class="sub-menu">
|
||||||
|
<% course.course_groups.each do |group| %>
|
||||||
|
<li id="course_group_<%=group.id %>">
|
||||||
|
<% count = group.members.count %>
|
||||||
|
<a href="<%= group_member_course_path(course, :group_id => group.id) %>"><font class="hidden dis" style="max-width: 120px;"><%=group.name %></font><span style="vertical-align: top;"><%=count %></span></a>
|
||||||
|
<%#= link_to( "",course_boards_path(@course, :board_id =>board.id, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
|
@ -120,6 +120,9 @@
|
||||||
<a href="<%=course_member_path(@course, :role => 2) %>">分班<span><%=group_count %></span></a>
|
<a href="<%=course_member_path(@course, :role => 2) %>">分班<span><%=group_count %></span></a>
|
||||||
<!--<a href="javascript:void(0);" class="sy_class_add"></a>-->
|
<!--<a href="javascript:void(0);" class="sy_class_add"></a>-->
|
||||||
</li>
|
</li>
|
||||||
|
<div id="group_children_list">
|
||||||
|
<%= render :partial => 'layouts/group_children_list', :locals => {:course => @course} %>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% statistics_count = 0 %>
|
<% statistics_count = 0 %>
|
||||||
<% unless show_nav?(statistics_count) %>
|
<% unless show_nav?(statistics_count) %>
|
||||||
|
@ -181,6 +184,18 @@
|
||||||
$("#expand_tools_expand a").addClass('active');
|
$("#expand_tools_expand a").addClass('active');
|
||||||
$("#navContentCourse").toggle();
|
$("#navContentCourse").toggle();
|
||||||
}
|
}
|
||||||
|
<% unless @board.nil? %>
|
||||||
|
if($("#board_children_<%=@board.id %>").length > 0){
|
||||||
|
$("#board_children_<%=@board.id %> a").addClass('active');
|
||||||
|
$(".accordion>li>a").removeClass('active');
|
||||||
|
}
|
||||||
|
<% end %>
|
||||||
|
<% unless @group.nil? %>
|
||||||
|
if($("#course_group_<%=@group.id %>").length > 0){
|
||||||
|
$("#course_group_<%=@group.id %> a").addClass('active');
|
||||||
|
$(".accordion>li>a").removeClass('active');
|
||||||
|
}
|
||||||
|
<% end %>
|
||||||
$(document).on('input','input[name="course_outline_search"]',function(e){
|
$(document).on('input','input[name="course_outline_search"]',function(e){
|
||||||
throttle(course_outline_search,window,e);
|
throttle(course_outline_search,window,e);
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<div class="sy_popup_con02" >
|
<div class="sy_popup_con02" >
|
||||||
<ul class="sy_popup_tishi">
|
<ul class="sy_popup_tishi">
|
||||||
<li>
|
<li>
|
||||||
题目已发送到目标课程的作业列表,但需要您设置发布和截止时间,以激活相应作业,谢谢!
|
题目已发送到目标班级的作业列表,但需要您设置发布和截止时间,以激活相应作业,谢谢!
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="javascript:void(0);" class="sy_btn_blue mt10" onclick="hideModal()">知道了</a>
|
<a href="javascript:void(0);" class="sy_btn_blue mt10" onclick="hideModal()">知道了</a>
|
||||||
|
|
|
@ -1698,6 +1698,7 @@ zh:
|
||||||
label_exit_group: 退出当前分班
|
label_exit_group: 退出当前分班
|
||||||
label_new_join: 加入
|
label_new_join: 加入
|
||||||
label_new_join_group: 加入当前分班
|
label_new_join_group: 加入当前分班
|
||||||
|
label_join_group: 加入分班
|
||||||
label_new_course_password: 课程密码
|
label_new_course_password: 课程密码
|
||||||
label_new_course_school: 开课学校
|
label_new_course_school: 开课学校
|
||||||
label_new_course_description: 班级描述
|
label_new_course_description: 班级描述
|
||||||
|
|
|
@ -1198,6 +1198,7 @@ RedmineApp::Application.routes.draw do
|
||||||
get 'feedback', :action => 'feedback', :as => 'course_feedback'
|
get 'feedback', :action => 'feedback', :as => 'course_feedback'
|
||||||
get 'code_repeat', :action => 'code_repeat', :as => 'code_repeat'
|
get 'code_repeat', :action => 'code_repeat', :as => 'code_repeat'
|
||||||
get 'member', :controller => 'courses', :action => 'member', :as => 'member'
|
get 'member', :controller => 'courses', :action => 'member', :as => 'member'
|
||||||
|
get 'group_member', :controller => 'courses', :action => 'group_member', :as => 'group_member'
|
||||||
get 'export_course_member_excel',:controller => 'courses',:action => 'export_course_member_excel'
|
get 'export_course_member_excel',:controller => 'courses',:action => 'export_course_member_excel'
|
||||||
get 'member_score', :to => 'courses#member_score'
|
get 'member_score', :to => 'courses#member_score'
|
||||||
post 'finishcourse'
|
post 'finishcourse'
|
||||||
|
@ -1227,6 +1228,8 @@ RedmineApp::Application.routes.draw do
|
||||||
get "show_comparecode"
|
get "show_comparecode"
|
||||||
get "statistics_course"
|
get "statistics_course"
|
||||||
get "switch_role"
|
get "switch_role"
|
||||||
|
get 'search_not_group_member'
|
||||||
|
post 'add_members'
|
||||||
end
|
end
|
||||||
collection do
|
collection do
|
||||||
match 'join_private_courses', :via => [:get, :post]
|
match 'join_private_courses', :via => [:get, :post]
|
||||||
|
|
|
@ -1301,7 +1301,7 @@ function elocalStorage(editor,mdu){
|
||||||
editor2 = editor;
|
editor2 = editor;
|
||||||
var oc = window.sessionStorage.getItem('content'+mdu);
|
var oc = window.sessionStorage.getItem('content'+mdu);
|
||||||
if(oc !== null ){
|
if(oc !== null ){
|
||||||
var h = '您上次有已保存的数据,是否<a onclick="rec_data(\'content\',\''+ mdu + '\')">恢复</a> ? / <a onclick="clear_data(\'content\',\''+ mdu + '\')">不恢复</a>';
|
var h = '您上次有已保存的数据,是否<a style="cursor: pointer;" onclick="rec_data(\'content\',\''+ mdu + '\')">恢复</a> ? / <a style="cursor: pointer;" onclick="clear_data(\'content\',\''+ mdu + '\')">不恢复</a>';
|
||||||
$('#e_tips').html(h);
|
$('#e_tips').html(h);
|
||||||
}
|
}
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
|
@ -1316,7 +1316,7 @@ function elocalStorage(editor,mdu){
|
||||||
if(!editor.isEmpty()){
|
if(!editor.isEmpty()){
|
||||||
add_data("content",mdu,editor.html());
|
add_data("content",mdu,editor.html());
|
||||||
$('#e_tip').html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 ");
|
$('#e_tip').html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 ");
|
||||||
$('#e_tips').html("");
|
//$('#e_tips').html("");
|
||||||
}
|
}
|
||||||
},10000);
|
},10000);
|
||||||
|
|
||||||
|
|
|
@ -381,6 +381,13 @@ a:hover.sy_btn_orange{
|
||||||
color: #ee4a1f;
|
color: #ee4a1f;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
|
.sub-menu > li > a.active {
|
||||||
|
color: #ee4a1f;
|
||||||
|
background: #fff;
|
||||||
|
border:1px solid #e5e5e5;
|
||||||
|
border-left:3px solid #ee4a1f;
|
||||||
|
border-bottom:none;
|
||||||
|
}
|
||||||
.accordion > li:target > a,
|
.accordion > li:target > a,
|
||||||
.accordion > li > a.active {
|
.accordion > li > a.active {
|
||||||
color: #ee4a1f;
|
color: #ee4a1f;
|
||||||
|
|
Loading…
Reference in New Issue