已结束课程显示正常

This commit is contained in:
Wen 2014-04-02 17:34:06 +08:00
parent 24d7234fec
commit a4557d4d19
1 changed files with 6 additions and 3 deletions

View File

@ -165,6 +165,8 @@ class UsersController < ApplicationController
end end
end end
include CoursesHelper
def user_courses def user_courses
unless User.current.admin? unless User.current.admin?
@ -186,10 +188,11 @@ class UsersController < ApplicationController
now_time = Time.now.year now_time = Time.now.year
@memberships.map { |e| @memberships.map { |e|
end_time = e.project.course_extra.get_time.year end_time = e.project.course_extra.get_time.year
if end_time >= now_time isDone = course_endTime_timeout?(e.project)
@memberships_doing.push e if isDone
else
@memberships_done.push e @memberships_done.push e
else
@memberships_doing.push e
end end
} }
# respond_to do |format| # respond_to do |format|