2015-08-18 11:47:22 +08:00
|
|
|
<div class="navHomepage">
|
|
|
|
<div class="navHomepageLogo fl">
|
2015-08-28 11:55:34 +08:00
|
|
|
<%=link_to image_tag("../images/nav_logo.png",width:"51px", height: "45px",class: "mt3"), user_activities_path(User.current.id)%>
|
2015-08-18 11:47:22 +08:00
|
|
|
</div>
|
|
|
|
<div class="fl">
|
|
|
|
<ul>
|
|
|
|
<li class="navHomepageMenu fl">
|
2015-08-28 12:09:31 +08:00
|
|
|
<%= link_to "首页",user_activities_path(User.current.id), :class => "c_white f16 db"%>
|
2015-08-18 11:47:22 +08:00
|
|
|
</li>
|
|
|
|
<li class="navHomepageMenu fl">
|
2015-08-28 12:09:31 +08:00
|
|
|
<a href="<%=url_for(:controller => 'users', :action => 'user_resource',:id=>User.current.id,:type=>1)%>" class="c_white f16 db">资源库</a></li>
|
2015-08-18 11:47:22 +08:00
|
|
|
<li class="navHomepageMenu fl">
|
2015-08-28 12:09:31 +08:00
|
|
|
<%= link_to "作业", user_homeworks_user_path(User.current.id), :class => "c_white f16 db"%>
|
2015-08-18 11:47:22 +08:00
|
|
|
</li>
|
2015-08-28 11:55:34 +08:00
|
|
|
<li class="navHomepageMenu fl mr30">
|
2015-08-28 12:09:31 +08:00
|
|
|
<a href="http://forge.trustie.net/forums/1/memos/1168" class="c_white f16 db">帮助中心</a>
|
2015-08-18 11:47:22 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2015-08-25 18:59:45 +08:00
|
|
|
<script>
|
|
|
|
<% type = type%>
|
2015-08-29 11:28:02 +08:00
|
|
|
$(function (){
|
2015-08-25 18:59:45 +08:00
|
|
|
if('<%= type %>' != null && '<%= type %>' == 'courses' ){
|
|
|
|
$('input:radio[value="courses"]').attr('checked','checked');
|
|
|
|
}
|
|
|
|
if('<%= type %>' != null && '<%= type %>' == 'projects' ){
|
|
|
|
$('input:radio[value="projects"]').attr('checked','checked');
|
|
|
|
}
|
|
|
|
if('<%= type %>' != null && '<%= type %>' == 'users' ){
|
|
|
|
$('input:radio[value="users"]').attr('checked','checked');
|
|
|
|
}
|
|
|
|
});
|
2015-08-29 11:28:02 +08:00
|
|
|
|
|
|
|
$(function(){
|
|
|
|
$("#navHomepageSearchInput").keypress(function(e){
|
2015-08-29 16:14:02 +08:00
|
|
|
var name = $.trim($('#navHomepageSearchInput').val());
|
|
|
|
if (e.keyCode == '13' && name != "" && name.length != 0) {
|
2015-08-29 11:28:02 +08:00
|
|
|
$('#type').val($('input[type=radio]:checked').val());
|
|
|
|
$(this).parent().submit();
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
2015-08-29 16:14:02 +08:00
|
|
|
|
2015-08-29 17:04:44 +08:00
|
|
|
function search_in_header(obj){
|
2015-08-29 16:14:02 +08:00
|
|
|
var name = $.trim($('#navHomepageSearchInput').val());
|
|
|
|
if (name != "" && name.length != 0) {
|
|
|
|
$('#type').val($('input[type=radio]:checked').val());
|
2015-08-29 17:04:44 +08:00
|
|
|
obj.parent().submit();
|
2015-08-29 16:14:02 +08:00
|
|
|
}
|
|
|
|
}
|
2015-08-25 18:59:45 +08:00
|
|
|
</script>
|
2015-08-24 16:16:07 +08:00
|
|
|
<div class="fl" id="navHomepageSearch">
|
2015-08-25 18:59:45 +08:00
|
|
|
<!--<form class="navHomepageSearchBox">-->
|
|
|
|
<% name = name%>
|
2015-08-18 11:47:22 +08:00
|
|
|
|
2015-08-25 18:59:45 +08:00
|
|
|
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
|
2015-08-29 11:28:02 +08:00
|
|
|
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词进行搜索"/>
|
2015-08-29 16:14:02 +08:00
|
|
|
<input type="hidden" name="search_type" id="type" value=""/>
|
2015-08-29 17:19:03 +08:00
|
|
|
<input type="text" style="display: none;"/>
|
2015-08-29 17:04:44 +08:00
|
|
|
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"></a>
|
2015-08-29 16:14:02 +08:00
|
|
|
<% end %>
|
2015-08-24 16:16:07 +08:00
|
|
|
<div class="navSearchTypeBox" id="navHomepageSearchType">
|
2015-08-25 18:17:31 +08:00
|
|
|
<div class="fl mr15 mt8">
|
2015-08-25 18:59:45 +08:00
|
|
|
<input type="radio" value="courses" name="search_type" checked/>
|
2015-08-24 16:16:07 +08:00
|
|
|
课程
|
|
|
|
</div>
|
2015-08-25 18:17:31 +08:00
|
|
|
<div class="fl mr15 mt8">
|
2015-08-25 18:59:45 +08:00
|
|
|
<input type="radio" value="projects" name="search_type" />
|
2015-08-24 16:16:07 +08:00
|
|
|
项目
|
|
|
|
</div>
|
2015-08-25 18:17:31 +08:00
|
|
|
<div class="fl mr15 mt8">
|
2015-08-25 18:59:45 +08:00
|
|
|
<input type="radio" value="users" name="search_type" />
|
2015-08-25 16:01:31 +08:00
|
|
|
用户
|
|
|
|
</div>
|
2015-08-24 16:16:07 +08:00
|
|
|
<div id="navSearchAlert" class="fr mr10">
|
|
|
|
<span class="c_red">请选择搜索类型</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-08-18 11:47:22 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="navHomepageProfile">
|
|
|
|
<ul>
|
|
|
|
<li class="homepageProfileMenuIcon">
|
2015-09-09 11:23:23 +08:00
|
|
|
<%= link_to "<div class='mt5 mb8' id='user_avatar'>#{image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:class => "portraitRadius",:alt=>"头像", :id => "nh_user_logo")}</div>".html_safe,user_activities_path(User.current.id)%>
|
|
|
|
<ul class="topnav_login_list" id="topnav_login_list">
|
2015-08-25 18:17:31 +08:00
|
|
|
<li>
|
|
|
|
<%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
|
|
|
|
</li>
|
2015-08-25 15:35:45 +08:00
|
|
|
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
|
2015-08-25 16:39:22 +08:00
|
|
|
<li>
|
|
|
|
<%= link_to "退出",signout_path,:class => "menuGrey",:method => "post"%>
|
|
|
|
</li>
|
2015-08-18 11:47:22 +08:00
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="navHomepageNews">
|
2015-08-24 14:52:23 +08:00
|
|
|
<%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon" %>
|
2015-08-24 11:37:50 +08:00
|
|
|
<% if User.current.count_new_message >0 %>
|
2015-08-24 14:52:23 +08:00
|
|
|
<div ><%= link_to "" , user_message_path(User.current), :class => "newsActive" %></div>
|
2015-08-24 11:37:50 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
2015-08-25 16:01:31 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
//搜索相关
|
|
|
|
$("#navHomepageSearch").mouseover(function(){
|
|
|
|
$("#navHomepageSearchType").show();
|
|
|
|
}).mouseout(function(){
|
|
|
|
$("#navHomepageSearchType").hide();
|
|
|
|
});
|
2015-08-25 16:39:22 +08:00
|
|
|
|
2015-09-09 11:23:23 +08:00
|
|
|
$("#user_avatar").mouseover(function(){
|
|
|
|
$("#topnav_login_list").show();
|
|
|
|
}).mouseout(function(){
|
|
|
|
$("#topnav_login_list").hide();
|
|
|
|
});
|
|
|
|
|
2015-08-25 16:39:22 +08:00
|
|
|
function signout(){
|
|
|
|
$.post(
|
|
|
|
'<%= signout_path%>',
|
|
|
|
{}
|
|
|
|
);
|
|
|
|
}
|
2015-08-25 16:08:57 +08:00
|
|
|
</script>
|