添加老师对学生的分班操作

This commit is contained in:
Tim 2016-03-10 10:02:24 +08:00
parent db1f31724a
commit 61ce439e74
3 changed files with 130 additions and 81 deletions

View File

@ -1,81 +1,125 @@
<!-- 加入分班 -->
<div style="margin-left: 15px">
<% if User.current.logged? && User.current.member_of_course?(@course) && @group %>
<%= join_in_course_group(@course.course_groups,@group, User.current) unless @canShowCode %>
<span style="font-size: 12px; float: left; margin-right: 5px">
<%= l(:label_current_group)%>:&nbsp;
<%= @group.name %>
</span>
<% end %>
</div>
<div class="cl"></div>
<% if members.any? %>
<% if @result_count %>
<p style="font-size: 18px;">
<%= l(:label_search_member_count) %>
<%= @result_count %>
<%= l(:label_member_people) %>
</p>
<div class="cl"></div>
<% end %>
<div class="st_box">
<ul class="st_box_top">
<li class="ml50" style="padding-right: 5px;"><a href="">姓名</a></li>
<li class="ml10" style="padding-right: 15px;"><a href="">学号</a></li>
<li class="ml358">
<%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true%>
<% if @score_sort_by == 'desc' %>
<a id="pic" href="javascript:" class= "st_down"></a>
<% else %>
<a id="pic" href="javascript:" class= "st_up"></a>
<% end %>
</li>
<li class="ml50"><a href="javascript:void(0)" >加入时间</a></li>
</ul>
<div class="cl"></div><!--st_box_top end-->
<% members.each do |member| %>
<div class="st_boxlist">
<a href="javascript:" class="st_img">
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
</a>
<ul>
<% if @canShowCode %>
<li>
<% if member.user.show_name == ''%>
<%= link_to("#{l(:label_bidding_user_studentname)}<span >#{member.user.name}</span>".html_safe,user_path(member.user)) %>
<% else%>
<%= link_to("#{l(:label_bidding_user_studentname)}<span >#{member.user.show_name}</span>".html_safe,user_path(member.user)) %>
<%end%>
</li>
<% else %>
<li><%= link_to("#{l(:label_bidding_user_studentname)}<span >#{member.user.name}</span>".html_safe, user_path(member.user)) %></li>
<% end %>
<br/>
<% unless member.user.user_extensions.student_id == ''%>
<li><%= link_to("#{l(:label_bidding_user_studentcode)}<span >#{member.user.user_extensions.student_id}</span>".html_safe,user_path(member.user)) %></li>
<% end%>
</ul>
<%= link_to format("%0.2f",member.score.nil? ? 0 : member.score.to_s), {
:action => 'show_member_score',
:member_id => member.id,
:remote => true},
:class => 'ml258 c_red' %>
<span class="fr mr15 c_grey"><%= format_date(member.created_on)%></span>
<%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
</div>
<div class="cl"></div>
<% end; reset_cycle %>
</div>
<!--<ul class="wlist">
<% #= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul>-->
<% else%>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% end%>
<!-- 加入分班 -->
<div style="margin-left: 15px">
<% if User.current.logged? && User.current.member_of_course?(@course) && @group %>
<%= join_in_course_group(@course.course_groups,@group, User.current) unless @canShowCode %>
<span style="font-size: 12px; float: left; margin-right: 5px">
<%= l(:label_current_group)%>:&nbsp;
<%= @group.name %>
</span>
<% end %>
</div>
<div class="cl"></div>
<% if members.any? %>
<% if @result_count %>
<p style="font-size: 18px;">
<%= l(:label_search_member_count) %>
<%= @result_count %>
<%= l(:label_member_people) %>
</p>
<div class="cl"></div>
<% end %>
<div class="st_box">
<ul class="st_box_top">
<li class="ml50" style="padding-right: 5px;"><a href="">姓名</a></li>
<li class="ml10" style="padding-right: 15px;"><a href="">学号</a></li>
<li style="padding-right: 55px; margin-left: 260px;"><a href="">分班</a></li>
<li style="margin-left: 25px;">
<%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true%>
<% if @score_sort_by == 'desc' %>
<a id="pic" href="javascript:" class= "st_down"></a>
<% else %>
<a id="pic" href="javascript:" class= "st_up"></a>
<% end %>
</li>
<li class="ml50"><a href="javascript:void(0)" >加入时间</a></li>
</ul>
<div class="cl"></div><!--st_box_top end-->
<% members.each do |member| %>
<div class="st_boxlist">
<a href="javascript:" class="st_img">
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
</a>
<ul>
<% if @canShowCode %>
<li>
<% if member.user.show_name == ''%>
<%= link_to("#{l(:label_bidding_user_studentname)}<span >#{member.user.name}</span>".html_safe,user_path(member.user)) %>
<% else%>
<%= link_to("#{l(:label_bidding_user_studentname)}<span >#{member.user.show_name}</span>".html_safe,user_path(member.user)) %>
<%end%>
</li>
<% else %>
<li><%= link_to("#{l(:label_bidding_user_studentname)}<span >#{member.user.name}</span>".html_safe, user_path(member.user)) %></li>
<% end %>
<br/>
<% unless member.user.user_extensions.student_id == ''%>
<li><%= link_to("#{l(:label_bidding_user_studentcode)}<span >#{member.user.user_extensions.student_id}</span>".html_safe,user_path(member.user)) %></li>
<% end%>
</ul>
<div class="select-class-option fl" style="margin-left: 105px;"><span style="width: 100px; text-align: center; float: left;" class="hidden">向日葵班</span>
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2 ml5"></a></div>
<select class="w125 undis class-edit fl" style="margin-left: 105px;">
<option value="1" selected="selected">向日葵班</option>
<option value="2">学前班</option>
<option value="3">幼儿园</option>
<option value="4">小学</option>
<option value="5">初中</option>
</select>
<%= link_to format("%0.2f",member.score.nil? ? 0 : member.score.to_s), {
:action => 'show_member_score',
:member_id => member.id,
:remote => true},
:class => 'ml25 c_red' %>
<span class="fr mr15 c_grey"><%= format_date(member.created_on)%></span>
<%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
</div>
<div class="cl"></div>
<% end; reset_cycle %>
</div>
<!--<ul class="wlist">
<% #= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul>-->
<% else%>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% end%>
<script>
$(document).ready(function(){
/*$(".select-class-option").mouseover(function(){
$(this).children(".pic_edit2").css("display","inline-block");
});
$(".select-class-option").mouseout(function(){
$(this).children(".pic_edit2").css("display","none");
});*/
$(".pic_edit2").click(function(){
$(this).parent().hide();
$(this).parent().next().show();
});
$(".class-edit").blur(function(){
$(this).hide();
$(this).prev().show();
var editValue = $(this).children("option:selected").text();
$(this).prev().children(":first").text(editValue);
});
function stopPropagation(e) {
if (e.stopPropagation)
e.stopPropagation();
else
e.cancelBubble = true;
};
$(document).bind('click',function(){
$('.class-edit').css('display','none');
$('.select-class-option').show();
});
$('.class-edit,.pic_edit2').bind('click',function(e){
stopPropagation(e);
});
});
</script>

View File

@ -1289,3 +1289,6 @@ a.contributor_course{float: right; color: #888; font-size: 12px; font-weight: no
.active-degree-rule{font-size: 12px;color: #888; text-align: center; cursor: pointer;}
.hero-degree-rule{font-size: 12px;color: #888;text-align: center;}
.contributor-course-calculate{padding-left: 54px; font-size: 12px;color: #888}
/*20160310分班样式*/
.select-class-option {width:125px;}

View File

@ -66,6 +66,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.ml15{ margin-left:15px;}
.ml16{ margin-left: 16px;}
.ml20{ margin-left:20px;}
.ml25 {margin-left:25px;}
.ml30{margin-left:30px !important;}
.ml35{margin-left: 35px;}
.ml40{ margin-left:40px;}
@ -144,6 +145,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.w80{ width:80px;}
.w90{ width:90px;}
.w100{width: 100px;}
.w125{width:125px;}
.w210{ width:210px;}
.w150{ width:150px;}
.w170{width:170px;}