152 lines
6.4 KiB
Plaintext
152 lines
6.4 KiB
Plaintext
<div class="navHomepage">
|
|
<div class="navHomepageLogo fl">
|
|
<%=link_to image_tag("../images/nav_logo.png",width:"51px", height: "45px",class: "mt3"), user_activities_path(User.current.id)%>
|
|
</div>
|
|
<div class="fl">
|
|
<ul>
|
|
<li class="navHomepageMenu fl">
|
|
<%= link_to "首页",user_activities_path(User.current), :class => "c_white f16 db p10", :title => "回到个人首页"%>
|
|
</li>
|
|
<li class="navHomepageMenu fl">
|
|
<%= link_to "资源库", user_resource_user_path(User.current, :type => 1), :class => "c_white f16 db p10" %>
|
|
</li>
|
|
<% if hidden_unproject_infos %>
|
|
<li class="navHomepageMenu fl">
|
|
<%= link_to "题库", user_homeworks_user_path(User.current), :class => "c_white f16 db p10"%>
|
|
</li>
|
|
<% memo = Memo.where(:id => 1168).first %>
|
|
<% unless memo.nil? %>
|
|
<li class="navHomepageMenu fl mr30">
|
|
<%= link_to "帮助中心", "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>
|
|
</li>
|
|
<% end %>
|
|
<% else %>
|
|
<li class="navHomepageMenu fl mr40">
|
|
<a href="<%= forums_path(:reorder_complex=>'desc')%>" target="_blank" class="c_white f16 db p10" >公共贴吧</a>
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
</div>
|
|
<script>
|
|
$(function(){
|
|
$("#navHomepageSearchInput").keypress(function(e){
|
|
var name = $.trim($('#navHomepageSearchInput').val());
|
|
if (e.keyCode == '13' && name != "" && name.length != 0) {
|
|
//$('#type').val($('input[type=radio]:checked').val());
|
|
$(this).parent().submit();
|
|
}
|
|
})
|
|
});
|
|
|
|
function search_in_header(obj){
|
|
var name = $.trim($('#navHomepageSearchInput').val());
|
|
if (name != "" && name.length != 0) {
|
|
//$('#type').val($('input[type=radio]:checked').val());
|
|
obj.parent().submit();
|
|
}
|
|
}
|
|
</script>
|
|
<div class="fl" id="navHomepageSearch">
|
|
<!--<form class="navHomepageSearchBox">-->
|
|
<% name = name%>
|
|
|
|
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
|
|
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、班级、项目、用户、资源以及帖子"/>
|
|
<input type="hidden" name="search_type" id="type" value="all"/>
|
|
<input type="text" style="display: none;"/>
|
|
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"></a>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="navHomepageProfile" id="navHomepageProfile">
|
|
<ul>
|
|
<li class="homepageProfileMenuIcon" id="homepageProfileMenuIcon">
|
|
<%= link_to "<div class='mt5 mb8' id='user_avatar'>#{image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:class => "portraitRadius",:alt=>"头像",:style=>"display:block;", :id => "nh_user_logo")}</div>".html_safe,user_activities_path(User.current.id)%>
|
|
<ul class="topnav_login_list none" id="topnav_login_list">
|
|
<li>
|
|
<%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
|
|
</li>
|
|
<% if hidden_unproject_infos %>
|
|
<li>
|
|
<%= link_to '我的课程',{:controller => "users", :action => "user_courselist", :id => User.current.id}, :class => "menuGrey" %>
|
|
</li>
|
|
<% end %>
|
|
<li>
|
|
<%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%>
|
|
</li>
|
|
<li>
|
|
<%= link_to "新建组织", new_organization_path, :class => "menuGrey"%>
|
|
</li>
|
|
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
|
<li>
|
|
<%= link_to "退出",logout_url_without_domain,:class => "menuGrey",:method => "post"%>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="navHomepageNews" id="user_messages">
|
|
<%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon", :target => "_Blank", :title => "您的所有消息" %>
|
|
<% if User.current.count_new_message.to_i > 0 %>
|
|
<div ><%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive", :target => "_Blank" %></div>
|
|
<% end %>
|
|
<%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
|
|
<div class="shadowbox_news undis" id="user_messages_list">
|
|
<%=render :partial => 'layouts/message_loading' %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
var onUserMessages = false;
|
|
var onNotice = false;
|
|
//搜索相关
|
|
$("#navHomepageSearch").mouseover(function(){
|
|
$("#navHomepageSearchType").show();
|
|
}).mouseout(function(){
|
|
$("#navHomepageSearchType").hide();
|
|
});
|
|
|
|
$("#user_messages").mouseenter(function(){
|
|
onNotice = true;
|
|
$("#user_messages_list").show();
|
|
if($("#message_list_detail").length == 0){
|
|
$.get('<%=user_messages_unviewed_users_path %>');
|
|
$("#ajax-indicator").hide();
|
|
}
|
|
var obj = $("#user_messages_list");
|
|
clearTimeout(obj.timer);
|
|
}).mouseleave(function(){
|
|
onNotice = false;
|
|
var obj = $("#user_messages_list");
|
|
setTimeout(function(){
|
|
if(!onNotice && !onUserMessages) {
|
|
obj.hide();
|
|
obj.html("<%=escape_javascript(render :partial => 'layouts/message_loading') %>");
|
|
} }, 500);
|
|
});
|
|
$("#message_list_detail").mouseenter(function(event){
|
|
event.stopPropagation();
|
|
onUserMessages = true;
|
|
}).mouseleave(function(){
|
|
onUserMessages = false;
|
|
});
|
|
|
|
$("#navHomepageProfile").mouseenter(function(){
|
|
$("#homepageProfileMenuIcon").addClass("homepageProfileMenuIconhover");
|
|
$("#topnav_login_list").show();
|
|
});
|
|
$("#navHomepageProfile").mouseleave(function(){
|
|
$("#homepageProfileMenuIcon").removeClass("homepageProfileMenuIconhover");
|
|
$("#topnav_login_list").hide();
|
|
});
|
|
|
|
function signout(){
|
|
$.post(
|
|
'<%= signout_path%>',
|
|
{}
|
|
);
|
|
}
|
|
</script>
|