From 35d1c33a298d0cae507a5a974209bbca7606738c Mon Sep 17 00:00:00 2001 From: yanxd Date: Thu, 27 Mar 2014 10:53:45 +0800 Subject: [PATCH] ... --- app/controllers/projects_controller.rb | 3 +- app/views/welcome/_search_project.html.erb | 38 ++++++++++++++++++++++ app/views/welcome/course.html.erb | 35 ++++++++++++-------- app/views/welcome/index.html.erb | 14 ++++---- public/stylesheets/application.css | 2 +- public/stylesheets/nyan.css | 15 +++++++++ public/stylesheets/welcome.css | 8 +++++ 7 files changed, 94 insertions(+), 21 deletions(-) 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 @@
-
+