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

79 lines
2.7 KiB
Plaintext
Raw Normal View History

2015-08-18 11:47:22 +08:00
<div class="navHomepage">
<div class="navHomepageLogo fl">
<%=link_to image_tag("../images/logo.png",width:"51px", height: "45px",class: "mt3"), signin_path%>
2015-08-18 11:47:22 +08:00
</div>
<div class="fl">
<ul>
<li class="navHomepageMenu fl">
2015-08-25 17:30:55 +08:00
<a href="http://forge.trustie.net/forums/1/memos/1168" class="c_white f16">帮助中心</a>
</li>
2015-08-18 11:47:22 +08:00
</ul>
</div>
2015-08-25 18:26:54 +08:00
<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();
}
2015-08-25 18:59:45 +08:00
<% type = type%>
$(document).ready(function (){
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-25 18:26:54 +08:00
</script>
2015-08-24 16:16:07 +08:00
<div class="fl" id="navHomepageSearch">
2015-08-25 18:26:54 +08:00
<!--<form class="navHomepageSearchBox">-->
2015-08-25 18:59:45 +08:00
<% name = name%>
2015-08-25 18:26:54 +08:00
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
2015-08-25 18:59:45 +08:00
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" class="navHomepageSearchInput"/>
2015-08-25 18:26:54 +08:00
<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 %>
2015-08-24 16:16:07 +08:00
<div class="navSearchTypeBox" id="navHomepageSearchType">
<div class="fl mr15 mt8">
2015-08-25 18:26:54 +08:00
<input type="radio" value="courses" name="search_type" checked/>
2015-08-24 16:16:07 +08:00
课程
</div>
<div class="fl mr15 mt8">
2015-08-25 18:26:54 +08:00
<input type="radio" value="projects" name="search_type" />
2015-08-24 16:16:07 +08:00
项目
</div>
<div class="fl mr15 mt8">
2015-08-25 18:26:54 +08:00
<input type="radio" value="users" name="search_type" />
用户
</div>
2015-08-24 16:16:07 +08:00
<div id="navSearchAlert" class="fr mr10">
<span class="c_red">请选择搜索类型</span>
</div>
</div>
2015-08-25 18:26:54 +08:00
2015-08-18 11:47:22 +08:00
</div>
<div id="loginInButton" class="fr ml20">
2015-08-25 16:08:52 +08:00
<a href="<%= signin_path(:login=>true) %>" class="c_white db">登录</a>
</div>
<div id="loginSignButton" class="fr">
2015-08-25 16:08:52 +08:00
<a href="<%= signin_path(:login=>false) %>" class="c_white db">注册</a>
2015-08-18 11:47:22 +08:00
</div>
</div>
<script type="text/javascript">
//搜索相关
$("#navHomepageSearch").mouseover(function(){
$("#navHomepageSearchType").show();
}).mouseout(function(){
$("#navHomepageSearchType").hide();
});
2015-08-25 18:26:54 +08:00
</script>