From fcd168465861bf850cb2cdad91bdc2e785e9cbd0 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 13 Apr 2016 11:20:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8=E6=8C=89?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=E6=8E=92=E5=BA=8F=20=20?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8=E5=B7=A6=E4=B8=8A=E8=A7=92?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BD=9C=E4=B8=9A=E7=9A=84=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 6 ++++-- app/views/homework_common/index.html.erb | 16 +++++++++++++++- public/stylesheets/public.css | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 091e2b86b..e52b8434b 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -17,9 +17,11 @@ class HomeworkCommonController < ApplicationController @page = params[:page] ? params[:page].to_i + 1 : 0 @is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) if @is_teacher - @homeworks = @course.homework_commons.order("created_at desc").limit(10).offset(@page * 10) + @homeworks = @course.homework_commons.order("updated_at desc").limit(10).offset(@page * 10) + @homework_commons = @course.homework_commons.order("created_at desc").limit(10).offset(@page * 10) else - @homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc").limit(10).offset(@page * 10) + @homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("updated_at desc").limit(10).offset(@page * 10) + @homework_commons = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc").limit(10).offset(@page * 10) end @is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher)) @is_new = params[:is_new] diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index ac4ac9853..6a3528e51 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -39,7 +39,21 @@
-
作业
+ +
<%= render :partial => 'homework_search_form',:locals => {:course=>@course} %>
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 9d37dc1cb..e48e9fad2 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -225,7 +225,7 @@ a.c_green{ color:#28be6c;} .c_dblue{ color:#09658c;} .b_blue{background:#64bdd9;} .b_green{background:#28be6c;} -.b_w{ background:#fff;} +.b_w{ background:#fff !important;} /*add by Tim*/ .fontGrey {color:#cecece;}