commit
b053f16f0f
@ -1,95 +1,95 @@
|
|||||||
<div class="navHomepage">
|
<div class="navHomepage">
|
||||||
<div class="navHomepageLogo fl">
|
<div class="navHomepageLogo fl">
|
||||||
<%=link_to image_tag("../images/nav_logo.png",width:"51px", height: "45px",class: "mt3"), signin_path%>
|
<%=link_to image_tag("../images/nav_logo.png",width:"51px", height: "45px",class: "mt3"), signin_path%>
|
||||||
</div>
|
</div>
|
||||||
<div class="fl">
|
<div class="fl">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="navHomepageMenu fl mr40">
|
<li class="navHomepageMenu fl mr40">
|
||||||
<a href="http://forge.trustie.net/forums/1/memos/1168" class="c_white f16">帮助中心</a>
|
<a href="http://forge.trustie.net/forums/1/memos/1168" class="c_white f16 p10">帮助中心</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
function search(doc){
|
function search(doc){
|
||||||
//alert(1)
|
//alert(1)
|
||||||
// val = $('input:radio[name="search_type"]:checked').val();
|
// val = $('input:radio[name="search_type"]:checked').val();
|
||||||
// alert(2)
|
// alert(2)
|
||||||
// $("#search_type").val(val);
|
// $("#search_type").val(val);
|
||||||
// alert(3)
|
// alert(3)
|
||||||
$(doc).parent().submit();
|
$(doc).parent().submit();
|
||||||
}
|
}
|
||||||
<% type = type%>
|
<% type = type%>
|
||||||
$(function (){
|
$(function (){
|
||||||
if('<%= type %>' != null && '<%= type %>' == 'courses' ){
|
if('<%= type %>' != null && '<%= type %>' == 'courses' ){
|
||||||
$('input:radio[value="courses"]').attr('checked','checked');
|
$('input:radio[value="courses"]').attr('checked','checked');
|
||||||
}
|
}
|
||||||
if('<%= type %>' != null && '<%= type %>' == 'projects' ){
|
if('<%= type %>' != null && '<%= type %>' == 'projects' ){
|
||||||
$('input:radio[value="projects"]').attr('checked','checked');
|
$('input:radio[value="projects"]').attr('checked','checked');
|
||||||
}
|
}
|
||||||
if('<%= type %>' != null && '<%= type %>' == 'users' ){
|
if('<%= type %>' != null && '<%= type %>' == 'users' ){
|
||||||
$('input:radio[value="users"]').attr('checked','checked');
|
$('input:radio[value="users"]').attr('checked','checked');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function search_in_header(obj){
|
function search_in_header(obj){
|
||||||
var name = $.trim($('#navHomepageSearchInput').val());
|
var name = $.trim($('#navHomepageSearchInput').val());
|
||||||
if (name != "" && name.length != 0) {
|
if (name != "" && name.length != 0) {
|
||||||
$('#type').val($('input[type=radio]:checked').val());
|
$('#type').val($('input[type=radio]:checked').val());
|
||||||
obj.parent().submit();
|
obj.parent().submit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function search_in_header_I(e,obj){
|
function search_in_header_I(e,obj){
|
||||||
var name = $.trim($('#navHomepageSearchInput').val());
|
var name = $.trim($('#navHomepageSearchInput').val());
|
||||||
if (e.keyCode == '13' && name != "" && name.length != 0) {
|
if (e.keyCode == '13' && name != "" && name.length != 0) {
|
||||||
$('#type').val($('input[type=radio]:checked').val());
|
$('#type').val($('input[type=radio]:checked').val());
|
||||||
obj.parent().submit();
|
obj.parent().submit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<div class="fl" id="navHomepageSearch">
|
<div class="fl" id="navHomepageSearch">
|
||||||
<!--<form class="navHomepageSearchBox">-->
|
<!--<form class="navHomepageSearchBox">-->
|
||||||
<% name = name%>
|
<% name = name%>
|
||||||
|
|
||||||
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
|
<%= 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="请输入关键词进行搜索" onkeypress="search_in_header_I(event,$(this));"/>
|
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词进行搜索" onkeypress="search_in_header_I(event,$(this));"/>
|
||||||
<input type="hidden" name="search_type" id="type" value=""/>
|
<input type="hidden" name="search_type" id="type" value=""/>
|
||||||
<input type="text" style="display: none;"/>
|
<input type="text" style="display: none;"/>
|
||||||
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"></a>
|
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="navSearchTypeBox" id="navHomepageSearchType">
|
<div class="navSearchTypeBox" id="navHomepageSearchType">
|
||||||
<div class="fl mr15 mt8">
|
<div class="fl mr15 mt8">
|
||||||
<input type="radio" value="courses" name="search_type" checked/>
|
<input type="radio" value="courses" name="search_type" checked/>
|
||||||
课程
|
课程
|
||||||
</div>
|
</div>
|
||||||
<div class="fl mr15 mt8">
|
<div class="fl mr15 mt8">
|
||||||
<input type="radio" value="projects" name="search_type" />
|
<input type="radio" value="projects" name="search_type" />
|
||||||
项目
|
项目
|
||||||
</div>
|
</div>
|
||||||
<div class="fl mr15 mt8">
|
<div class="fl mr15 mt8">
|
||||||
<input type="radio" value="users" name="search_type" />
|
<input type="radio" value="users" name="search_type" />
|
||||||
用户
|
用户
|
||||||
</div>
|
</div>
|
||||||
<div id="navSearchAlert" class="fr mr10">
|
<div id="navSearchAlert" class="fr mr10">
|
||||||
<span class="c_red">请选择搜索类型</span>
|
<span class="c_red">请选择搜索类型</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="loginInButton" class="fr ml20">
|
<div id="loginInButton" class="fr ml20">
|
||||||
<a href="<%= signin_path(:login=>true) %>" class="c_white db">登录</a>
|
<a href="<%= signin_path(:login=>true) %>" class="c_white db">登录</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="loginSignButton" class="fr">
|
<div id="loginSignButton" class="fr">
|
||||||
<a href="<%= signin_path(:login=>false) %>" class="c_white db">注册</a>
|
<a href="<%= signin_path(:login=>false) %>" class="c_white db">注册</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//搜索相关
|
//搜索相关
|
||||||
$("#navHomepageSearch").mouseover(function(){
|
$("#navHomepageSearch").mouseover(function(){
|
||||||
$("#navHomepageSearchType").show();
|
$("#navHomepageSearchType").show();
|
||||||
}).mouseout(function(){
|
}).mouseout(function(){
|
||||||
$("#navHomepageSearchType").hide();
|
$("#navHomepageSearchType").hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
<% if ma.class == SystemMessage %>
|
||||||
|
<%# @user_system_messages.each do |usm| %>
|
||||||
|
<ul class="homepageNewsList fl">
|
||||||
|
<li class="homepageNewsPortrait fl">
|
||||||
|
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/logo.png", width: "30px", height: "30px", class: "mt3") %></div></a>
|
||||||
|
</li>
|
||||||
|
<li class="homepageNewsPubType fl">
|
||||||
|
<span class="newsBlue homepageNewsPublisher">Trustie平台</span><span class="homepageNewsType fl">发布新消息:</span>
|
||||||
|
</li>
|
||||||
|
<span style="color: red;float: left">【系统消息】</span>
|
||||||
|
<li class="homepageSystenMessageContent fl">
|
||||||
|
|
||||||
|
<%= link_to ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject, user_system_messages_path(User.current),
|
||||||
|
:id => "content_link_#{ma.id}",
|
||||||
|
:onmouseover =>"message_titile_show($(this),event);",
|
||||||
|
:onmouseout => "message_titile_hide($(this));"
|
||||||
|
%>
|
||||||
|
</li>
|
||||||
|
<div style="display:none;" class="message_title_red system_message_style">
|
||||||
|
<% unless ma.subject.blank? %>
|
||||||
|
<p><strong>标题:</strong><%= ma.subject %></p>
|
||||||
|
<% end %>
|
||||||
|
<% if (!ma.description.blank?) || (!ma.content.blank?) %>
|
||||||
|
<div class="fl"><strong>内容:</strong></div><div class="ml36"><%= ma.description.nil? ? ma.content.html_safe : ma.description.html_safe %></div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||||
|
</ul>
|
||||||
|
<%# end %>
|
||||||
|
<% end %>
|
Loading…
Reference in new issue