Merge branch 'sw_new_course' of http://repository.trustie.net/xianbo/trustie2 into sw_new_course

Conflicts:
	app/views/layouts/_unlogin_header.html.erb
This commit is contained in:
sw 2015-08-25 18:26:25 +08:00
commit bedc364275
3 changed files with 39 additions and 12 deletions

View File

@ -16,7 +16,7 @@
$(document).ready(function(){
$(".homepageSearchIcon").click(function(){
var val=$('input:radio[name="navSearchType"]:checked').val();
var val=$('input:radio[name="search_type"]:checked').val();
if(val==null){
$("#navSearchAlert").css({display:"block"});
}

View File

@ -9,29 +9,41 @@
</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">
<input type="text" name="navHomepageSearch" class="navHomepageSearchInput"/>
<a href="javascript:void(0);" class="homepageSearchIcon"></a>
</form>
<!--<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="课程" name="navSearchType" checked/>
<input type="radio" value="courses" name="search_type" checked/>
课程
</div>
<div class="fl mr15 mt8">
<input type="radio" value="项目" name="navSearchType" />
<input type="radio" value="projects" name="search_type" />
项目
</div>
<div class="fl mr15 mt8">
<input type="radio" value="用户" name="navSearchType" />
<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>
@ -48,4 +60,5 @@
}).mouseout(function(){
$("#navHomepageSearchType").hide();
});
</script>

View File

@ -21,19 +21,29 @@
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<%= stylesheet_link_tag 'base','header', :media => 'all'%>
</head>
<body class="<%=h body_css_classes %>">
<div class="cl"></div>
<div class="navContainer mb10">
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %>
<% else%>
<%= render :partial => 'layouts/unlogin_header' %>
<% end%>
</div>
<div class="cl"></div>
<div id="wrapper">
<div id="wrapper2">
<div id="wrapper3">
<%=render :partial => 'layouts/base_header'%>
<%#=render :partial => 'layouts/base_header'%>
<div id="main" class="nosidebar">
<div id="content_">
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>
<%=render :partial => 'layouts/base_footer'%>
<!--<div style="clear:both;"></div>-->
<!--<%#=render :partial => 'layouts/base_footer'%>-->
</div>
</div>
@ -45,6 +55,10 @@
</div>
</div>
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
<%= call_hook :view_layouts_base_body_bottom %>
</body>
</html>