竞赛首页修改
This commit is contained in:
parent
aea41ba997
commit
27fda1f938
|
@ -77,6 +77,10 @@ class ContestsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def search
|
||||
redirect_to action: 'index',name:params[:name]
|
||||
end
|
||||
|
||||
def homework
|
||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||
@bids = @course.homeworks.order('deadline DESC')
|
||||
|
|
|
@ -118,6 +118,11 @@ class WelcomeController < ApplicationController
|
|||
search_condition = params[:q]
|
||||
search_type = params[:search_type].to_sym unless search_condition.blank?
|
||||
|
||||
if search_type.nil? && params[:contests_search] && params[:name] != ""
|
||||
search_type = :contests
|
||||
search_condition = params[:name]
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html{
|
||||
case search_type
|
||||
|
@ -127,7 +132,7 @@ class WelcomeController < ApplicationController
|
|||
when :courses
|
||||
redirect_to courses_search_path(:name => search_condition)
|
||||
when :contests
|
||||
redirect_to contests_search_path(:name => search_condition)
|
||||
redirect_to contests_path(:name => search_condition)
|
||||
when :users
|
||||
redirect_to users_search_path(:name => search_condition)
|
||||
when :users_teacher
|
||||
|
|
|
@ -578,6 +578,7 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
|
||||
match 'courses/search', :to => 'courses#search'
|
||||
match '/contests/search', :controller => 'contests', :action => 'search', :via => [:get, :post]
|
||||
# add by nwb
|
||||
# 课程路由设置
|
||||
resources :courses do
|
||||
|
|
Loading…
Reference in New Issue