diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index db47319e..9076bb50 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -846,7 +846,8 @@ class ProjectsController < ApplicationController def select_project_layout project = Project.find_by_id(params[:id]) project ||= @project - (project.project_type == Project::ProjectType_project) ? 'base_projects' : 'base_courses' + project ||= @course + (project.try(:project_type) == Project::ProjectType_project) ? 'base_projects' : 'base_courses' end # Validates parent_id param according to user's permissions diff --git a/app/views/welcome/_search_project.html.erb b/app/views/welcome/_search_project.html.erb index ca7d151e..c139be6f 100644 --- a/app/views/welcome/_search_project.html.erb +++ b/app/views/welcome/_search_project.html.erb @@ -6,10 +6,48 @@ #select_option << ['教师', 'users_teacher'], #select_option << ['学生', 'users_student'] %> + <%= form_tag({controller: :welcome, action: :search }, method: :get) do %> diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index a4bdd622..be6b09d0 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -111,23 +111,32 @@
-
+