Merge branch 'cxt_course' into develop

This commit is contained in:
huang 2016-10-28 18:06:12 +08:00
commit 72f75b41d0
8 changed files with 64 additions and 11 deletions

View File

@ -227,7 +227,15 @@ class CoursesController < ApplicationController
end
def deletegroup
CourseGroup.delete(params[:group_id])
group = CourseGroup.find params[:group_id]
if group
if group.members.count == 0
CourseGroup.delete(params[:group_id])
else
group.members.update_all(:course_group_id => 0)
CourseGroup.delete(params[:group_id])
end
end
@subPage_title = l :label_student_list
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
@is_remote = true
@ -395,6 +403,7 @@ class CoursesController < ApplicationController
page_from = params[:page].nil? ? 0 : (params[:page].to_i - 1)
@results = student_homework_score(0,page_from, 10,"desc")
end
@no_group_count = @course.student.count - @course.members.where("course_group_id != 0").count
@course_groups = @course.course_groups
@limit = 50
@page = params[:page].nil? ? 1 : params['page'].to_i

View File

@ -0,0 +1,14 @@
<br>
<div style='width:360px;text-align:center;font-family: "微软雅黑","宋体"' class="f14">
<% if count == 0 %>
确定删除分班吗?
<% else %>
已有学生加入本分班,删除之后,这些学生将处于未分班状态
您是否确定删除该分班
<% end %>
</div>
</br>
<div style='width:164px; margin:0 auto; text-align:center; font-family: "微软雅黑","宋体"'>
<%=link_to '确定', deletegroup_course_path(:group_id => group_id), :method => 'delete', :remote => true, :class => 'Blue-btn fl', :method => 'delete'%>
<a href='javascript:void(0);' class='Blue-btn fl' onclick='hideModal()'>取消</a>
</div>

View File

@ -10,20 +10,27 @@
<% unless course_groups.nil? %>
<% course_groups.each do |group| %>
<script>
function delete_group_<%= group.id%>(){
var htmlvalue = '<%=escape_javascript(render :partial => 'delete_member_group', :locals => {:group_id => group.id, :count => group.members.count}) %>';
pop_up_box(htmlvalue, 400);
}
</script>
<%# group_name = " #{ group.name}( <span class='c_red'>#{group.members.count.to_s}人</span>)".html_safe %>
<li class="fl sy_fenban_list clear mr10 mb10">
<%= link_to group.name, searchgroupmembers_course_path(@course,:group_id => group.id), class: 'fl mr5', method: 'get', remote: true,:onclick => "checkclass('group_name_#{group.id}')"%>
<span class="fl sy_cgrey mr5">(<%=group.members.count.to_s %>人)</span>
<% if @canShowCode%>
<a href="javascript:void(0)" class="sy_icons_edit fl" onclick="$('#edit_group_name').val('<%= group.name%>');$('#edit_group_id').val('<%= group.id%>');$('#edit_group_form').slideToggle();"></a>
<% if group.members.empty?%>
<%= link_to '', deletegroup_course_path(:group_id => group.id), :method => 'delete', :remote => true,
<%# if group.members.empty?%>
<%#= link_to '', deletegroup_course_path(:group_id => group.id), :method => 'delete', :remote => true,
:data => {confirm: l(:label_delete_group)},
:class => 'sy_icons_del fl'
%>
<% else%>
<a href="javascript:void(0)" onClick="alert('温馨提示:已有学生加入该班级,不能删除该班级,仅可编辑班级名称。');" class="sy_icons_del fl"></a>
<% end%>
<!--<a href="javascript:void(0)" onClick="pop_up_box('<%#=escape_javascript(render :partial => 'delete_no_member_group', :locals => {:group_id => group.id}) %>');" class="sy_icons_del fl"></a>-->
<%# else%>
<a href="javascript:void(0)" onClick="delete_group_<%= group.id%>();" class="sy_icons_del fl"></a>
<%#end%>
<% end %>
</li>
<% end %>

View File

@ -4,7 +4,7 @@
<% if show_nav?(course_board ? course_board.topics.count : 0) %>
<li>
<a href="<%=course_boards_path(@course) %>">讨论区</a>
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") if User.current.logged? %>
</li>
<% unless course_board.children.empty? %>
<ul class="sub-menu">
@ -12,7 +12,7 @@
<li>
<% 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) %>"><%=board.name %><span><%=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)}") if User.current.logged? %>
</li>
<% end %>
</ul>

View File

@ -1,2 +1,3 @@
hideModal();
$("#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})%>");

View File

@ -69,7 +69,7 @@
<li id="sy_02" class="sy_icons_boards">
<% count = course_board ? (course_board.topics.count + Message.where("board_id =? and parent_id is not ?", course_board.id, nil).count) : 0 %>
<a href="<%=course_boards_path(@course) %>">讨论区<span><%=count %></span></a>
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") if is_teacher %>
<%= link_to( "",course_boards_path(@course, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") if User.current.logged? %>
</li>
<div id="board_children_list">
<%= render :partial => 'layouts/board_children_list', :locals => {:course_board => course_board} %>

View File

@ -1,4 +1,4 @@
<div class="fl" style="padding-bottom:10px; width:720px;">
<div class="fl pr" style="padding-bottom:10px; width:720px;">
<span class="c_dark f14 fb fl mr15">
作品
<font class="f12 c_red">
@ -31,7 +31,20 @@
<%= link_to "代码查重", work_canrepeat_student_work_index_path(homework:@homework.id, course_id:@course.id), class: 'BlueCirBtn fl',:remote => true %>
<% end %>
<% end%>
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" onclick="show_or_hide_info();" style="display: none">[ 显示作业信息 ]</a> </span>
<%# if @homework.homework_type == 3 && my_work && my_work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") %>
<!--<div class="mt5 fr">-->
<!--<a href="javascript:void(0);" class="memberBtn fl mt3 mr15" title="添加小组成员" onclick="add_or_delete_group_member();">合作成员</a>-->
<!--</div>-->
<%# end %>
<% if @is_teacher && @homework.homework_type == 3 %>
<div class="group_work_tip_box fontGrey2">
<em></em>
<span></span>
<p class="mt5 mb5 break_word">大作品评分即组长的评分<br/>
请先完成大作品评分,系统将把大作品<br/>评分做为每个组员的初始分值,您需<br/>要在此基础上对组员评分进行手动调整
</p>
</div>
<% end %>
</div>
<div class="cl"></div>
@ -96,4 +109,8 @@
<% end %>
});
function add_or_delete_group_member() {
var html_value = "<%#= escape_javascript(render :partial => 'student_work/add_or_delete_member',:locals => {:homework=>@homework,:edit_mode => true}) %>";
pop_up_box(html_value, 528);
}
</script>

View File

@ -581,3 +581,8 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
.ye_tips_box_inner{ position: absolute;line-height: 1.5;padding: 5px 10px; white-space: nowrap; background-color: #FFFEF4; left:30px; top: -5px; border: solid 1px #F3DDB3;}
.ye_tips_box_inner span { display: block; border-width: 10px;position: absolute;top: 15px; left: -18px; border-style: dashed solid dashed dashed;border-color: transparent #FFFEF4 transparent transparent;font-size: 0;line-height: 0;}
.ye_tips_box_inner em { display: block; border-width: 10px;position: absolute;top: 42px; left: -20px; border-style: dashed solid dashed dashed;border-color: transparent #F3DDB3 transparent transparent;font-size: 0;line-height: 0;}
/*分组作业评分提示框*/
.group_work_tip_box {width:200px; position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-255px; top:-10px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
.group_work_tip_box em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;}
.group_work_tip_box span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;}