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/my_controller.rb b/app/controllers/my_controller.rb index 103030d51..1839dd1fd 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -157,7 +157,7 @@ class MyController < ApplicationController File.delete(diskfile1) if File.exist?(diskfile1) end - render :layout=>'base_users_new' + render :layout=>'new_base_user' end # Destroys user's account 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 919093556..505a3dd9a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -305,10 +305,11 @@ class UsersController < ApplicationController #用户作业列表 def user_homeworks + @page = params[:page] ? params[:page].to_i + 1 : 0 user_course_ids = "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")" - homework_commons = HomeworkCommon.where("course_id in #{user_course_ids}").order("created_at desc") - @homework_commons = paginateHelper homework_commons,10 + @homework_commons = HomeworkCommon.where("course_id in #{user_course_ids}").order("created_at desc").limit(10).offset(@page * 10) respond_to do |format| + format.js format.html {render :layout => 'new_base_user'} end end @@ -453,6 +454,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/account/login.html.erb b/app/views/account/login.html.erb index deec186c8..f2ac18084 100644 --- a/app/views/account/login.html.erb +++ b/app/views/account/login.html.erb @@ -16,7 +16,7 @@ $(document).ready(function(){ $(".homepageSearchIcon").click(function(){ - var val=$('input:radio[name="navSearchType"]:checked').val(); + var val=$('input:radio[name="search_type"]:checked').val(); if(val==null){ $("#navSearchAlert").css({display:"block"}); } diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 6013fc453..2c987cbdd 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -17,24 +17,40 @@ - +