修改竞赛首页搜索功能

This commit is contained in:
nwb 2014-07-21 15:45:00 +08:00
parent 5adac1a32a
commit aea41ba997
2 changed files with 5 additions and 3 deletions

View File

@ -126,6 +126,8 @@ class WelcomeController < ApplicationController
:project_type => Project::ProjectType_project)
when :courses
redirect_to courses_search_path(:name => search_condition)
when :contests
redirect_to contests_search_path(:name => search_condition)
when :users
redirect_to users_search_path(:name => search_condition)
when :users_teacher

View File

@ -131,12 +131,12 @@
</div>
<!--搜索框-->
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<%= form_tag({controller: 'contests', action: 'index'}, method: :get) do %>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<%= form_tag({controller: :welcome, action: :search }, method: :get) do %>
<%= text_field_tag 'name', params[:name], :placeholder => l(:label_search_intimation), name: "name", :class => 'blueinputbar', :style => 'width:240px; padding-right:50px;'%>
&nbsp;
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise" , :name => nil%>
<%= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
<% end %>
<!-- <div class='font_lighter' style="display: inline-block; margin-top:3px;">竞赛相关内容搜索,如竞赛题目,参赛题目,参赛人名等。</div> -->
</div>