Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

This commit is contained in:
Tim 2016-10-21 18:39:06 +08:00
commit 82dcd5db00
24 changed files with 340 additions and 63 deletions

View File

@ -292,30 +292,79 @@ class CoursesController < ApplicationController
end
def teacher_assign_group
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
@no_group_count = @course.student.count - @course.members.where("course_group_id != 0").count
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@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
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
@no_group_count = @course.student.count - @course.members.where("course_group_id != 0").count
end
@canShowCode = isCourseTeacher(User.current.id,@course)
respond_to do |format|
format.js
end
end
def join_group
@subPage_title = l :label_student_list
group = CourseGroup.find(params[:object_id])
member = Member.where(:course_id => @course.id, :user_id => User.current.id).first
member.course_group_id = group.id
member.save
@group = group
@course_groups = @course.course_groups
@no_group_count = @course.student.count - @course.members.where("course_group_id != 0").count
search_group_members group
#@course_groups = @course.course_groups
#@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
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
@subPage_title = l :label_student_list
group = CourseGroup.find(params[:object_id])
@ -353,6 +402,28 @@ class CoursesController < ApplicationController
@results = paginateHelper @results, @limit
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
## 有角色参数的才是课程,没有的就是项目
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
def export_course_member_excel
@all_members = student_homework_score(0,0,0,"desc")
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")
end
@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)}";
@ -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.update_all(:viewed => true)
@tab = params[:tab].to_i || 0
if User.current.allowed_to?(:as_teacher,@course)
@select_tab = params[:tab]
@issue_custom_fields = IssueCustomField.sorted.all
@ -1366,14 +1445,16 @@ class CoursesController < ApplicationController
#当加入,退出分班时查询分班的学生
def search_group_members group
@subPage_title = l :label_student_list
@render_file = 'new_member_list'
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@canShowCode = isCourseTeacher(User.current.id,@course)
@is_remote = true
@score_sort_by = "desc"
page_from = params[:page].nil? ? 0 : (params[:page].to_i - 1)
@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
def member_to_xls homeworks, course, members,groups

View File

@ -149,34 +149,14 @@ module WatchersHelper
link_to text, url, :remote => true, :method => method, :id => "#{course.id}", :class => []+options
end
end
def join_in_course_group(coursegroups,group, user, options=[])
return '' unless user && user.logged?
def join_in_course_group(course, group, user, options=[])
return '' unless user && user.logged? && user.member_of_course?(course)
joined = user.member_of_course_group?(group)
@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)
text = l(:label_exit_group)
if joined
link_to text, {:controller => "courses", :action => "join_group", :object_id => "#{group.id}"},
:remote => true, :method => 'delete',
:id => "#{group.id}", :style => "padding: 2px 8px 2px; background-color:#15bccf; color:#fff; ",
: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;"
unless joined
text = l(:label_join_group)
form_tag({:controller => "courses", :action => "join_group", :object_id => "#{group.id}"},:id => 'join_coursegroup_form', :method => 'post') do
link_to text, 'javascript:void(0)', :class => 'sy_btn_green fl mr10', :onclick => "$('#join_coursegroup_form').submit();"
end
end
end

View File

@ -4,7 +4,7 @@
<% end %>
<div>
<input type="text" name="article_homepage[title]" id="message_subject" class="InputBox" style="width: 99.5%;" maxlength="255" onkeyup="regexTopicSubject();" placeholder="请输入标题,该标题不会在个人主页中显示" value="<%=@article.title %>" />
<input type="text" name="article_homepage[title]" id="message_subject" class="InputBox" style="width: 99.5%;" maxlength="255" onkeyup="regexTopicSubject();" placeholder="请输入标题,例如:张小兰的个人主页" value="<%=@article.title %>" />
<p id="subjectmsg"></p>
</div>
<div>

View File

@ -2,7 +2,7 @@
<div class="homepageMainContent">
<div class="postRightContainer pr" style="padding: 25px 40px;">
<% if User.current == @user && @article == @user.base_homepage %>
<div class="homepagePostSetting" style="top: -25px;">
<div class="homepagePostSetting" style="top: 0px;">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">

View File

@ -24,6 +24,11 @@
<div class="NewsBannerName">
<%= @board.parent_id.nil? ? "班级讨论区" : "#{@board.name}" %>
</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 nhname="topic_form">
<% if User.current.logged? %>

View File

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

View File

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

View File

@ -7,17 +7,17 @@
<th class="sy_th15">
<%= link_to '学号', member_score_sort_course_path(:sort_type => 'student_id', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0), :search_name => (@search_name ? @search_name : nil)), :result => members, method: 'get', remote: true, :style => 'color:#000000;'%>
<% if @sort_type == "student_id" && @score_sort_by == 'desc' %>
<a href="javascript:void(0)" class="sy_sortdownbtn"></a>
<% elsif @sort_type == "student_id" && @score_sort_by == 'asc' %>
<a href="javascript:void(0)" class="sy_sortupbtn"></a>
<% elsif @sort_type == "student_id" && @score_sort_by == 'asc' %>
<a href="javascript:void(0)" class="sy_sortdownbtn"></a>
<% end %>
</th>
<th class="sy_th0 sy_fenban_tap">
<%= link_to '作业得分', member_score_sort_course_path(:sort_type => 'score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0), :search_name => (@search_name ? @search_name : nil)), :result => members, method: 'get', remote: true, :style => 'color:#000000;'%>
<% if @sort_type == "score" && @score_sort_by == 'desc' %>
<a href="javascript:void(0)" class="sy_sortdownbtn"></a>
<% elsif @sort_type == "score" && @score_sort_by == 'asc' %>
<a href="javascript:void(0)" class="sy_sortupbtn"></a>
<% elsif @sort_type == "score" && @score_sort_by == 'asc' %>
<a href="javascript:void(0)" class="sy_sortdownbtn"></a>
<% end %>
<div class="sy_fenban_show undis" >
<p>积分规则<br/>
@ -27,9 +27,9 @@
<th class="sy_th0 sy_fenban_tap">
<%= link_to '测评得分', member_score_sort_course_path(:sort_type => 'ex_score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0), :search_name => (@search_name ? @search_name : nil)), :result => members, method: 'get', remote: true, :style => 'color:#000000;'%>
<% if @sort_type == "ex_score" && @score_sort_by == 'desc' %>
<a href="javascript:void(0)" class="sy_sortdownbtn"></a>
<% elsif @sort_type == "ex_score" && @score_sort_by == 'asc' %>
<a href="javascript:void(0)" class="sy_sortupbtn"></a>
<% elsif @sort_type == "ex_score" && @score_sort_by == 'asc' %>
<a href="javascript:void(0)" class="sy_sortdownbtn"></a>
<% end %>
<div class="sy_fenban_show undis" >
<p>积分规则<br/>
@ -39,9 +39,9 @@
<th class="sy_th0 sy_fenban_tap">
<%= link_to '社区得分', member_score_sort_course_path(:sort_type => 'act_score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true, :style => 'color:#000000;'%>
<% if @sort_type == "act_score" && @score_sort_by == 'desc' %>
<a href="javascript:" class= "sy_sortdownbtn"></a>
<% elsif @sort_type == "act_score" && @score_sort_by == 'asc' %>
<a href="javascript:" class= "sy_sortupbtn"></a>
<% elsif @sort_type == "act_score" && @score_sort_by == 'asc' %>
<a href="javascript:" class= "sy_sortdownbtn"></a>
<% end %>
<div class="sy_fenban_show undis" >
<p>积分规则<br/>
@ -67,7 +67,7 @@
</thead>
<tbody>
<% members.each_with_index do |member, i| %>
<tr class="clear">
<tr class="clear" id="member_li_<%=member.id %>">
<% user = member.user %>
<% hw_score = member.score.nil? ? 0 : member.score %>
<% ex_score = member.ex_score.nil? ? 0 : member.ex_score %>
@ -116,7 +116,7 @@
<% if @course.course_groups.empty? %>
<%=member.course_group_id == 0 ? "暂无" : member.course_group.name %>
<% 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">
<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>

View File

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

View File

@ -1,4 +1,5 @@
$("#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})%>");
$("#group_children_list").html("<%= escape_javascript( render :partial => 'layouts/group_children_list', :locals => {:course => @course})%>");
$('#group_name').val('');
$('#new_group_name').hide();

View File

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

View File

@ -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})%>");

View File

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

View File

@ -4,6 +4,10 @@
</div>
<script>
$(function(){
var tab = <%= @tab %>;
if(tab != 0){
course_setting(tab);
}
<% if @select_tab == 'member'%>
$("#tb_2").click();
<% end %>

View File

@ -1 +1,8 @@
$("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>");
<% 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}) %>");
<% end %>
$("#group_children_list").html("<%= escape_javascript( render :partial => 'layouts/group_children_list', :locals => {:course => @course})%>");

View File

@ -1,7 +1,7 @@
<% unless course_board.children.empty? %>
<ul class="sub-menu">
<% 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 %>
<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)}") %>

View File

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

View File

@ -1,7 +1,7 @@
<ul>
<% if User.current.logged?%>
<% if User.current == target%>
<li style="width: 119px; float: left; border-right: 1px solid #ddd;"><%= link_to("编辑基本资料", my_account_path, :class => "user_editinfo") %></li>
<li style="width: 119px; float: left; border-right: 1px solid #ddd;"><%= link_to("个人资料", my_account_path, :class => "user_editinfo") %></li>
<li style="width: 118px; float: left;"><%= link_to '个人主页', homepage_user_path(@user.login), :class => "user_editinfo", :target => '_blank' %></li>
<li class="cl"></li>
<% else%>

View File

@ -120,6 +120,9 @@
<a href="<%=course_member_path(@course, :role => 2) %>">分班<span><%=group_count %></span></a>
<!--<a href="javascript:void(0);" class="sy_class_add"></a>-->
</li>
<div id="group_children_list">
<%= render :partial => 'layouts/group_children_list', :locals => {:course => @course} %>
</div>
<% end %>
<% statistics_count = 0 %>
<% unless show_nav?(statistics_count) %>
@ -181,6 +184,18 @@
$("#expand_tools_expand a").addClass('active');
$("#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){
throttle(course_outline_search,window,e);
});

View File

@ -7,7 +7,7 @@
<div class="sy_popup_con02" >
<ul class="sy_popup_tishi">
<li>
题目已发送到目标课程的作业列表,但需要您设置发布和截止时间,以激活相应作业,谢谢!
题目已发送到目标班级的作业列表,但需要您设置发布和截止时间,以激活相应作业,谢谢!
</li>
<li>
<a href="javascript:void(0);" class="sy_btn_blue mt10" onclick="hideModal()">知道了</a>

View File

@ -1698,6 +1698,7 @@ zh:
label_exit_group: 退出当前分班
label_new_join: 加入
label_new_join_group: 加入当前分班
label_join_group: 加入分班
label_new_course_password: 课程密码
label_new_course_school: 开课学校
label_new_course_description: 班级描述

View File

@ -1198,6 +1198,7 @@ RedmineApp::Application.routes.draw do
get 'feedback', :action => 'feedback', :as => 'course_feedback'
get 'code_repeat', :action => 'code_repeat', :as => 'code_repeat'
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 'member_score', :to => 'courses#member_score'
post 'finishcourse'
@ -1227,6 +1228,8 @@ RedmineApp::Application.routes.draw do
get "show_comparecode"
get "statistics_course"
get "switch_role"
get 'search_not_group_member'
post 'add_members'
end
collection do
match 'join_private_courses', :via => [:get, :post]

View File

@ -1301,7 +1301,7 @@ function elocalStorage(editor,mdu){
editor2 = editor;
var oc = window.sessionStorage.getItem('content'+mdu);
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);
}
setInterval(function() {
@ -1316,7 +1316,7 @@ function elocalStorage(editor,mdu){
if(!editor.isEmpty()){
add_data("content",mdu,editor.html());
$('#e_tip').html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 ");
$('#e_tips').html("");
//$('#e_tips').html("");
}
},10000);

View File

@ -381,6 +381,13 @@ a:hover.sy_btn_orange{
color: #ee4a1f;
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 > a.active {
color: #ee4a1f;