|
|
|
@ -2,10 +2,17 @@
|
|
|
|
|
<li>
|
|
|
|
|
<span class="user_icons_class"></span>
|
|
|
|
|
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
|
|
|
|
|
<p href="javascript:void(0);" id="show_course_<%= course.id %>" class="course_list_menu" title="<%= course.syllabus.title+' · '+(course.is_public? ? '公开班级:' : '私有班级:')+course.name+'('+current_time_and_term(course)+')' %>">
|
|
|
|
|
<%= link_to course.syllabus.title, syllabus_path(course.syllabus_id), :target => '_blank', :class => 'hidden', :style => "max-width:85px; display:inline-block;"%>
|
|
|
|
|
<p href="javascript:void(0);" id="show_course_<%= course.id %>" class="course_list_menu pr" >
|
|
|
|
|
<% title = "<span class='course-name'>#{course.syllabus.title}</span>".html_safe %>
|
|
|
|
|
<%= link_to title, syllabus_path(course.syllabus_id), :target => '_blank', :class => 'hidden', :style => "max-width:91px; display:inline-block;"%>
|
|
|
|
|
<font class="fb c_grey" style="height:39px; line-height:39px; vertical-align:top;">·</font>
|
|
|
|
|
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => "max-width:85px; display:inline-block;"%>
|
|
|
|
|
<% classes = "<span class='course-name'>#{course.name}</span>".html_safe %>
|
|
|
|
|
<%= link_to classes, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => "max-width:91px; display:inline-block;"%>
|
|
|
|
|
<span class="sub-menu-title c_dark">
|
|
|
|
|
课程名称:<%= course.syllabus.title %><br />
|
|
|
|
|
班级名称:<%= course.name+'('+current_time_and_term(course)+')' %><br />
|
|
|
|
|
班级属性:<%= course.is_public? ? '公开' : '私有' %>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
|
<%#= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course),
|
|
|
|
|
:id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+"("+current_time_and_term(course)+")"%>
|
|
|
|
@ -106,16 +113,25 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$(".course_list_menu").each(function(){
|
|
|
|
|
var courseWidth = $(this).children().eq(0).width();
|
|
|
|
|
var classWidth = $(this).children().eq(2).width();
|
|
|
|
|
var newClassWidth = 170 - courseWidth;
|
|
|
|
|
var newCourseWidth = 170 - classWidth;
|
|
|
|
|
var courseWidth = $(this).children().eq(0).children().width();
|
|
|
|
|
var classWidth = $(this).children().eq(2).children().width();
|
|
|
|
|
var newClassWidth = 182 - courseWidth;
|
|
|
|
|
var newCourseWidth = 182 - classWidth;
|
|
|
|
|
console.log(courseWidth, classWidth);
|
|
|
|
|
if(courseWidth < 80 && classWidth > 80){
|
|
|
|
|
if(courseWidth < 91 && classWidth > 91){
|
|
|
|
|
$(this).children().eq(2).css("max-width",newClassWidth + "px");
|
|
|
|
|
}
|
|
|
|
|
if(classWidth < 80 && courseWidth > 80){
|
|
|
|
|
if(classWidth < 91 && courseWidth > 91){
|
|
|
|
|
$(this).children().eq(0).css("max-width",newCourseWidth + "px");
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
$(".course-name").each(function(){
|
|
|
|
|
$(this).mouseenter(function(){
|
|
|
|
|
$(this).parent().parent().children().eq(3).show();
|
|
|
|
|
});
|
|
|
|
|
$(this).mouseleave(function(){
|
|
|
|
|
$(this).parent().parent().children().eq(3).hide();
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|