From 70e9d75cc6651229c3f1d9721b50167d131b08e0 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 25 Aug 2015 18:59:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=99=BB=E9=99=86=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 3 +- app/controllers/projects_controller.rb | 3 +- app/controllers/users_controller.rb | 2 ++ app/views/layouts/_logined_header.html.erb | 32 ++++++++++++++++------ app/views/layouts/_unlogin_header.html.erb | 16 ++++++++++- app/views/layouts/base.html.erb | 4 +-- app/views/layouts/course_base.html.erb | 4 +-- app/views/layouts/users_base.html.erb | 4 +-- 8 files changed, 51 insertions(+), 17 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 29f2e00f4..db972941e 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -113,7 +113,8 @@ class CoursesController < ApplicationController courses = Course.visible.where("LOWER(name) like '%#{params[:name].to_s.downcase}%'") @courses = paginateHelper courses,10 end - + @name = params[:name] + @type = 'courses' respond_to do |format| format.html { render :layout => 'course_base' diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index f042bba50..77933666f 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -93,7 +93,8 @@ class ProjectsController < ApplicationController @project_count = Project.project_entities.visible.like(params[:name]).page(params[:page]).count @project_pages = Paginator.new @project_count, @limit, params['page'] - + @name = params[:name] + @type = 'projects' respond_to do |format| format.html { render :layout => 'base' diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 22d8deb0c..5933a83a9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -453,6 +453,8 @@ class UsersController < ApplicationController end @users = scope.offset(@offset).limit(limit).all.reverse end + @name = params[:name] + @type = 'users' respond_to do |format| format.html { @groups = Group.all.sort diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 859f5a691..2c987cbdd 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -17,24 +17,40 @@ - +