diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 36093f33b..fd43977ee 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -229,7 +229,11 @@ class AttachmentsController < ApplicationController @attachment.container.init_journal(User.current) end if @attachment.container - @attachment.container.attachments.delete(@attachment) + if @attachment.container_type == "Issue" + @attachment.destroy + else + @attachment.container.attachments.delete(@attachment) + end else @attachment.destroy end @@ -281,7 +285,7 @@ class AttachmentsController < ApplicationController format.js end end - + def delete_homework @bid = @attachment.container.bid # Make sure association callbacks are called @@ -344,13 +348,13 @@ class AttachmentsController < ApplicationController end respond_to do |format| - format.js + format.js end rescue NoMethodError @save_flag = false @save_message = [] << l(:error_attachment_empty) respond_to do |format| - format.js + format.js end end diff --git a/app/helpers/api_helper.rb b/app/helpers/api_helper.rb index f73cc87e6..8324951f9 100644 --- a/app/helpers/api_helper.rb +++ b/app/helpers/api_helper.rb @@ -180,7 +180,7 @@ module ApiHelper if timePassed < 0 updateAtValue = "时间有问题" elsif timePassed < ONE_MINUTE - updateAtValue = "一分钟前" + updateAtValue = "1分钟前" elsif timePassed < ONE_HOUR timeIntoFormat = timePassed / ONE_MINUTE updateAtValue = timeIntoFormat.to_s + "分钟前" diff --git a/app/views/courses/_tool_expand.html.erb b/app/views/courses/_tool_expand.html.erb index e032496ea..50854cf23 100644 --- a/app/views/courses/_tool_expand.html.erb +++ b/app/views/courses/_tool_expand.html.erb @@ -2,19 +2,19 @@ <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %> <% if show_nav?(@course.homework_commons.count) %> <% end %> <% if show_nav?(@course.news.count) %> <% end %> <% if show_nav?(course_file_num) %>