diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index a862753ef..411de1dcf 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -561,12 +561,13 @@ module CoursesHelper def course_in_current_or_next_term course is_current_term = false is_next_term = false - if course.time == Time.now.year && course.term == cur_course_term + year_now = Time.now.month < 3 ? Time.now.year - 1:Time.now.year + if course.time == year_now && course.term == cur_course_term is_current_term = true end - if cur_course_term == "秋季学期" && course.time == (Time.now.year + 1) && course.term == "春季学期" + if cur_course_term == "秋季学期" && course.time == (year_now + 1) && course.term == "春季学期" is_next_term = true - elsif cur_course_term == "春季学期" && course.time == Time.now.year && course.term == "秋季学期" + elsif cur_course_term == "春季学期" && course.time == year_now && course.term == "秋季学期" is_next_term = true end is_current_term || is_next_term diff --git a/app/models/contest.rb b/app/models/contest.rb index ad54e8fb4..650e363a8 100644 --- a/app/models/contest.rb +++ b/app/models/contest.rb @@ -15,7 +15,8 @@ class Contest < ActiveRecord::Base has_many :praise_tread, as: :praise_tread_object, dependent: :destroy has_many :contestnotifications, :dependent => :destroy, :include => :author - + + acts_as_attachable diff --git a/app/views/courses/_member_list.html.erb b/app/views/courses/_member_list.html.erb index 41b4f41e7..dd543ec2c 100644 --- a/app/views/courses/_member_list.html.erb +++ b/app/views/courses/_member_list.html.erb @@ -56,24 +56,36 @@