socialforge/app/views/layouts/_unlogin_header.html.erb

65 lines
2.2 KiB
Plaintext

<div class="navHomepage">
<div class="navHomepageLogo fl">
<%=link_to image_tag("../images/logo.png",width:"51px", height: "45px",class: "mt3"), signin_path%>
</div>
<div class="fl">
<ul>
<li class="navHomepageMenu fl">
<a href="http://forge.trustie.net/forums/1/memos/1168" class="c_white f16">帮助中心</a>
</li>
</ul>
</div>
<script>
function search(doc){
//alert(1)
// val = $('input:radio[name="search_type"]:checked').val();
// alert(2)
// $("#search_type").val(val);
// alert(3)
$(doc).parent().submit();
}
</script>
<div class="fl" id="navHomepageSearch">
<!--<form class="navHomepageSearchBox">-->
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
<input type="text" name="q" class="navHomepageSearchInput"/>
<input type="hidden" name="search_type" id="type" value=""/>
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="$('#type').val($('input[type=radio]:checked').val());$(this).parent().submit();"></a>
<% end %>
<div class="navSearchTypeBox" id="navHomepageSearchType">
<div class="fl mr15 mt8">
<input type="radio" value="courses" name="search_type" checked/>
课程
</div>
<div class="fl mr15 mt8">
<input type="radio" value="projects" name="search_type" />
项目
</div>
<div class="fl mr15 mt8">
<input type="radio" value="users" name="search_type" />
用户
</div>
<div id="navSearchAlert" class="fr mr10">
<span class="c_red">请选择搜索类型</span>
</div>
</div>
</div>
<div id="loginInButton" class="fr ml20">
<a href="<%= signin_path(:login=>true) %>" class="c_white db">登录</a>
</div>
<div id="loginSignButton" class="fr">
<a href="<%= signin_path(:login=>false) %>" class="c_white db">注册</a>
</div>
</div>
<script type="text/javascript">
//搜索相关
$("#navHomepageSearch").mouseover(function(){
$("#navHomepageSearchType").show();
}).mouseout(function(){
$("#navHomepageSearchType").hide();
});
</script>