#1719 修改竞赛搜索之后标题栏错位的BUG

修改竞赛搜索之后,置空再搜索跳转到404
This commit is contained in:
sw 2014-12-18 15:39:32 +08:00
parent 3dfb0358c1
commit 1fbd2e95d4
1 changed files with 33 additions and 11 deletions

View File

@ -1,5 +1,5 @@
<div class="top-content">
<%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get) do %>
<%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get, :id => 'contests_serch') do %>
<table width="940px">
<tr>
<td class="info_font" style="width: 220px; color: #15bccf" rowspan="2">
@ -20,19 +20,41 @@
</td>
<td rowspan="2" >
<div class="project-search" style="float: right">
<%= text_field_tag 'name', params[:name], :size => 30 %>
<script type="text/javascript">
function regexName()
{
var name = $.trim($("#name").val());
if(name.length == 0)
{
$("#contest_name_span").text("<%= l(:label_search_conditions_not_null) %>");
$("#contest_name_span").css('color','#ff0000');
$("#contest_name_span").focus();
return false;
}
else
{
$("#contest_name_span").text("");
return true;
}
}
function submitSerch()
{
if(regexName()){$("#contests_serch").submit();}
}
</script>
<%= text_field_tag 'name', params[:name], :size => 30, :onblur => 'regexName();' %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10">
<%= l(:label_search)%>
</a>
<br />
<span id="contest_name_span"></span>
</div>
</td>
</tr>
<tr>
<td style="padding-left: 8px">
<a>
<%= link_to request.host()+"/contests", contests_path %>
<!-- end longjun -->
</a>
</td>
<td >
<%=link_to l(:field_homepage), home_path %> >
<a><%= l(:label_contest_innovate) %></a>
@ -43,14 +65,14 @@
<% end %>
</div>
<% if @contests.size > 0%>
<%= sort_contest(@s_state)%>
<%#= sort_contest(@s_state)%>
<div id="bid-show" class="projects-index">
<%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
</div>
<% elsif @is_search%>
<%= render :partial => "layouts/no_content"%>
<% else %>
<%= sort_contest(@s_state)%>
<%#= sort_contest(@s_state)%>
<div id="bid-show" class="projects-index">
<%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
</div>