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 @@ <% if @subPage_title == l(:label_student_list) %> <%= link_to format("%0.2f",member.score.nil? ? 0 : member.score.to_s), { diff --git a/app/views/courses/_member_list_detail.html.erb b/app/views/courses/_member_list_detail.html.erb index f37067cb5..bc6cbd242 100644 --- a/app/views/courses/_member_list_detail.html.erb +++ b/app/views/courses/_member_list_detail.html.erb @@ -7,24 +7,36 @@ <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 40, :height => 40)) %> <% if @subPage_title == l(:label_student_list) %> <%= link_to format("%0.2f",member.score.to_s), { diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 387a0e4cf..f0204f7ee 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -47,12 +47,36 @@ diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb index 8cae51063..0d234a69c 100644 --- a/app/views/layouts/base_newcontest.html.erb +++ b/app/views/layouts/base_newcontest.html.erb @@ -70,7 +70,7 @@ <%= l(:label_search)%>
- + <% end %> diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 3937c1822..67e4da0f4 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -71,7 +71,7 @@ <%= l(:label_search)%>
- + <% end %> diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index aa43b9194..b80206728 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -39,7 +39,7 @@ a:hover.mail_reply{ background:#06a9bc; text-decoration:none;} <%= yield %>
-
<%= link_to("退订该邮件?", @user_url) %>
+ <%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_footer).html_safe %> diff --git a/app/views/mailer/issue_add.html.erb b/app/views/mailer/issue_add.html.erb index f51dad121..4db0113b9 100644 --- a/app/views/mailer/issue_add.html.erb +++ b/app/views/mailer/issue_add.html.erb @@ -5,4 +5,5 @@ +
<%= link_to("退订该邮件?", @user_url) %>
diff --git a/app/views/mailer/issue_add.text.erb b/app/views/mailer/issue_add.text.erb index b50a39260..31d9632db 100644 --- a/app/views/mailer/issue_add.text.erb +++ b/app/views/mailer/issue_add.text.erb @@ -1,2 +1,3 @@ <%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %> +<%= link_to("退订该邮件?", @user_url) %> \ No newline at end of file diff --git a/app/views/mailer/issue_edit.html.erb b/app/views/mailer/issue_edit.html.erb index 3cbd1b02a..0c46b5e60 100644 --- a/app/views/mailer/issue_edit.html.erb +++ b/app/views/mailer/issue_edit.html.erb @@ -11,3 +11,5 @@ <%= l(:field_content)%>:<%= @journal.notes %>
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %> +
<%= link_to("退订该邮件?", @user_url) %>
+ diff --git a/app/views/mailer/issue_edit.text.erb b/app/views/mailer/issue_edit.text.erb index 5b93b6fe0..70e4186c4 100644 --- a/app/views/mailer/issue_edit.text.erb +++ b/app/views/mailer/issue_edit.text.erb @@ -12,3 +12,5 @@ <% end -%> ---------------------------------------- <%= render :partial => 'issue', :formats => [:text], :locals => { :issue => @issue, :issue_url => @issue_url } %> + +<%= link_to("退订该邮件?", @user_url) %> \ No newline at end of file diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 597229369..2621d4fa3 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -242,7 +242,7 @@
-

<%= l(:lable_school_list)%>

+

<%= l(:lable_school_list)%>