2015-01-10 15:39:02 +08:00
|
|
|
<%= render :partial => "layouts/base_feedback" %>
|
2014-10-23 11:30:34 +08:00
|
|
|
<div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;">
|
2015-05-28 15:14:38 +08:00
|
|
|
|
2014-10-23 11:30:34 +08:00
|
|
|
<div class="welcome_logo">
|
|
|
|
<%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px")%>
|
|
|
|
</div>
|
|
|
|
<div id="account">
|
|
|
|
<%= render_menu :account_menu -%>
|
|
|
|
</div>
|
2015-05-28 15:14:38 +08:00
|
|
|
|
2014-10-23 11:30:34 +08:00
|
|
|
<% if User.current.logged? -%>
|
|
|
|
<div id="loggedas">
|
|
|
|
<ul style="padding:0 0; margin:0 0;display:inline;">
|
|
|
|
<li style="padding:0 0; margin:0 0;display:inline;border-bottom: 0;" class="loggedas_li">
|
|
|
|
<%=link_to_user(User.current)%>
|
2015-04-09 11:00:39 +08:00
|
|
|
<% hidden_non_project = Setting.find_by_name("hidden_non_project")
|
|
|
|
visiable = hidden_non_project && hidden_non_project.value == "0"%>
|
2014-10-23 11:30:34 +08:00
|
|
|
<ul class="sub_menu">
|
2015-04-09 11:00:39 +08:00
|
|
|
<% if @show_course == 1 && !visiable %>
|
2014-10-23 11:30:34 +08:00
|
|
|
<% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%>
|
|
|
|
<% hasCourse=false %>
|
|
|
|
<% User.current.courses.each do |course| %>
|
|
|
|
<% if !course_endTime_timeout?(course) %>
|
|
|
|
<% hasCourse=true %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<%= render :partial => 'layouts/user_courses_list', :locals => {:hasCourse => hasCourse} %>
|
|
|
|
<% end -%>
|
|
|
|
<% end %>
|
|
|
|
<%= render :partial => 'layouts/user_project_list', :locals => {:hasCourse => hasCourse} %>
|
|
|
|
<li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
2015-05-14 21:40:34 +08:00
|
|
|
<%=link_to l(:label_user_edit), {:controller => 'my', :action=> 'account', host: Setting.host_user}%>
|
2014-10-23 11:30:34 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<li style="padding:0 0; margin:0 0;display:inline;border-bottom: 0;">
|
|
|
|
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')',
|
2015-05-14 21:40:34 +08:00
|
|
|
{ :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.host_user },
|
2014-10-23 11:30:34 +08:00
|
|
|
{:class => 'my-message'} if User.current.logged?%>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<% end -%>
|
|
|
|
<%= render_dynamic_nav if User.current.logged? || !Setting.login_required? -%>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
function setMessageCount () {
|
2014-11-17 10:32:33 +08:00
|
|
|
var mes = $('#loggedas .my-message');
|
|
|
|
mes.html(mes.html()+ '(' + <%=User.current.count_new_jour.to_s%> + ")");
|
2014-10-23 11:30:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
function addSlipMenu () {
|
2014-11-17 10:32:33 +08:00
|
|
|
var loggedas = $('#loggedas ul li:first');
|
|
|
|
var sub_menu = $('.sub_menu');
|
2014-10-23 11:30:34 +08:00
|
|
|
loggedas.mouseenter(function(event) {
|
|
|
|
sub_menu.show();
|
|
|
|
});
|
|
|
|
sub_menu.mouseleave(function(event) {
|
|
|
|
sub_menu.hide();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function addProjectSlipMenu () {
|
2014-11-17 10:32:33 +08:00
|
|
|
var loggedas = $('#project_loggedas_li');
|
|
|
|
var project_sub_menu = $('.project_sub_menu');
|
|
|
|
var course_sub_menu = $('.course_sub_menu');
|
2014-10-23 11:30:34 +08:00
|
|
|
loggedas.mouseenter(function(event) {
|
|
|
|
course_sub_menu.hide();
|
|
|
|
project_sub_menu.show();
|
|
|
|
});
|
|
|
|
project_sub_menu.mouseleave(function(event) {
|
|
|
|
project_sub_menu.hide();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
function addCourseSlipMenu () {
|
2014-11-17 10:32:33 +08:00
|
|
|
var loggedas = $('#course_loggedas_li');
|
|
|
|
var project_sub_menu = $('.project_sub_menu');
|
|
|
|
var course_sub_menu = $('.course_sub_menu');
|
2014-10-23 11:30:34 +08:00
|
|
|
loggedas.mouseenter(function(event) {
|
|
|
|
project_sub_menu.hide();
|
|
|
|
course_sub_menu.show();
|
|
|
|
});
|
|
|
|
course_sub_menu.mouseleave(function(event) {
|
|
|
|
course_sub_menu.hide();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2014-11-14 15:04:35 +08:00
|
|
|
function homeworkSlipMenuOver(id)
|
|
|
|
{
|
|
|
|
$('.project_sub_menu').hide();
|
|
|
|
$('#course_loggedas_li').show();
|
|
|
|
$("#homework_loggedas_ul_" + id).show();
|
|
|
|
}
|
|
|
|
|
|
|
|
function homeworkSlipMenuOut(id)
|
|
|
|
{
|
|
|
|
$("#homework_loggedas_ul_" + id).hide();
|
|
|
|
}
|
|
|
|
|
2014-10-23 11:30:34 +08:00
|
|
|
$(document).ready(function () {
|
|
|
|
addSlipMenu();
|
|
|
|
addProjectSlipMenu ();
|
|
|
|
addCourseSlipMenu();
|
|
|
|
});
|
|
|
|
|
|
|
|
jQuery(document).ready(function($) {
|
2014-11-17 10:32:33 +08:00
|
|
|
$('.sub_menu').find("a").attr('target', '_blank');
|
2014-10-23 11:30:34 +08:00
|
|
|
$('.project_sub_menu').find("a").attr('target', '_blank');
|
|
|
|
$('.course_sub_menu').find("a").attr('target', '_blank');
|
|
|
|
});
|
|
|
|
</script>
|