2013-09-30 11:02:04 +08:00
|
|
|
<div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;">
|
2013-08-12 10:25:23 +08:00
|
|
|
<div class="welcome_logo">
|
|
|
|
<%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px"), home_path %>
|
2013-08-11 15:27:34 +08:00
|
|
|
</div>
|
2013-08-01 10:33:49 +08:00
|
|
|
<div id="account">
|
|
|
|
<%= render_menu :account_menu -%>
|
|
|
|
</div>
|
2014-01-20 20:25:27 +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)%>
|
|
|
|
<ul class="sub_menu">
|
2014-01-20 20:56:37 +08:00
|
|
|
<% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%>
|
2014-01-20 20:25:27 +08:00
|
|
|
<li><%=link_to l(:label_my_course), user_courses_user_path(User.current), target:'my_path' %></li>
|
|
|
|
<% end -%>
|
|
|
|
<li><%=link_to l(:label_my_projects), user_projects_user_path(User.current), target:'my_path' %></li>
|
|
|
|
<li><%=link_to l(:label_user_edit), my_account_path, target:'my_path' %></li>
|
|
|
|
</ul>
|
2014-01-23 21:55:39 +08:00
|
|
|
</li>
|
|
|
|
<li style="padding:0 0; margin:0 0;display:inline;border-bottom: 0;">
|
2014-01-24 08:00:50 +08:00
|
|
|
<%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', { :controller => 'users', :action => 'user_newfeedback', id: User.current.id }, {:class => 'my-message'} if User.current.logged?%>
|
2014-01-20 20:25:27 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<% end -%>
|
2014-01-23 10:08:46 +08:00
|
|
|
<%#= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>
|
|
|
|
<%= render_dynamic_nav if User.current.logged? || !Setting.login_required? -%>
|
|
|
|
<%# 自建导航条在base页面中以 (@nav_dispaly......) 开头变量设定, 全局搜索即可发现 %>
|
2013-08-05 11:19:53 +08:00
|
|
|
</div>
|
2014-01-03 21:41:54 +08:00
|
|
|
<div style="border-top:solid 1px #C6E9F1;width:940px;margin-left:auto;margin-right:auto;margin-bottom: 0px;margin-top: -10px;"></div>
|
|
|
|
<div style="clear:left;"></div>
|
|
|
|
|
2014-01-20 20:25:27 +08:00
|
|
|
<script type="text/javascript">
|
|
|
|
function setMessageCount () {
|
2014-01-23 21:55:39 +08:00
|
|
|
var mes = $('#loggedas .my-message')
|
2014-01-20 20:25:27 +08:00
|
|
|
mes.html(mes.html()+'('+<%=User.current.count_new_jour.to_s%>+")")
|
|
|
|
}
|
|
|
|
|
|
|
|
function addSlipMenu () {
|
2014-01-23 21:55:39 +08:00
|
|
|
var loggedas = $('#loggedas ul li:first')
|
2014-01-20 20:25:27 +08:00
|
|
|
var sub_menu = $('.sub_menu')
|
|
|
|
loggedas.mouseenter(function(event) {
|
|
|
|
sub_menu.show();
|
|
|
|
});
|
|
|
|
sub_menu.mouseleave(function(event) {
|
|
|
|
sub_menu.hide();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
addSlipMenu();
|
|
|
|
});
|
|
|
|
</script>
|