课程后增加课程作业的快捷栏

This commit is contained in:
sw 2014-11-14 15:04:35 +08:00
parent fae3de8e04
commit 61c8feac8f
5 changed files with 55 additions and 8 deletions

View File

@ -114,6 +114,18 @@
});
}
function homeworkSlipMenuOver(id)
{
$('.project_sub_menu').hide();
$('#course_loggedas_li').show();
$("#homework_loggedas_ul_" + id).show();
}
function homeworkSlipMenuOut(id)
{
$("#homework_loggedas_ul_" + id).hide();
}
$(document).ready(function () {
addSlipMenu();
addProjectSlipMenu ();
@ -121,7 +133,7 @@
});
jQuery(document).ready(function($) {
$('.sub_menu').find("a").attr('target', '_blank');
$('.sub_menu').find("a").attr('target', '_blank');
$('.project_sub_menu').find("a").attr('target', '_blank');
$('.course_sub_menu').find("a").attr('target', '_blank');
});

View File

@ -67,11 +67,18 @@ end
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><%=User.current%> <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.user_domain }, {:class => 'my-message'} if User.current.logged? -%></li>
<li><%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.course_domain} %></li>
<li><%=link_to l(:label_my_projects),{:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %></li>
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.user_domain }, {:class => 'my-message'} if User.current.logged? -%>
</li>
<li>
<%=link_to l(:label_my_course), {:controller => 'users', :action => 'user_courses', id: User.current.id, host: Setting.course_domain} %>
</li>
<li>
<%=link_to l(:label_my_projects),{:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
</li>
<li class="divider"></li>
<li><%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%></li>
<li>
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.user_domain}%>
</li>
</ul>
</li>
<%= bootstrap_render_menu :account_menu -%>

View File

@ -4,9 +4,7 @@
<ul class="course_sub_menu">
<% User.current.courses.each do |course| %>
<% if !course_endTime_timeout?(course) %>
<li style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="<%=course.name%>">
<%= link_to course.name, {:controller => 'courses',:action => 'show',id:course.id} %>
</li>
<%= render :partial => 'layouts/user_homework_list', :locals => {:course => course} %>
<% end %>
<% end %>
</ul>

View File

@ -0,0 +1,12 @@
<% if course %>
<li id="homework_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="<%=course.name%>" onmouseover="homeworkSlipMenuOver(<%= course.id%>);" onmouseout="homeworkSlipMenuOut(<%= course.id%>);">
<%= link_to course.name, {:controller => 'courses',:action => 'show',id:course.id} %>
<ul class="homework_sub_menu" id="homework_loggedas_ul_<%= course.id%>" onmouseover="homeworkSlipMenuOver(<%= course.id%>);" onmouseout="homeworkSlipMenuOut(<%= course.id%>);">
<% course.homework_for_courses.map(&:bid).each do |bid| %>
<li style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="<%=bid.name%>">
<%= link_to bid.name, course_for_bid_path(bid), :target => "_blank" %>
</li>
<% end %>
</ul>
</li>
<% end %>

View File

@ -2219,6 +2219,24 @@ ul.messages-for-user-reply li {
margin: 0px;
}
#homework_loggedas_li .homework_sub_menu {
box-shadow: 2px 2px 6px #b0b0b0 ;
display: none;
background: #13AEBF 0 0 no-repeat;
left: 115px;
padding-bottom: 5px;
position: absolute;
top: 0px;
font-size: 1.1em;
margin: 0px auto;
padding: 0px 0px;
text-align: left;
z-index: 1;
}
#homework_loggedas_li .homework_sub_menu a{
margin: 0px;
}
#course_loggedas_li li {
border-bottom: 1px solid #129DAD;
color: white;