Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_admin
cxt 6 years ago
commit 40154958de

@ -2,6 +2,9 @@ module TidingDecorator
def content def content
method_name = "#{container_type.underscore}_content" method_name = "#{container_type.underscore}_content"
respond_to?(method_name) ? send(method_name) : '' respond_to?(method_name) ? send(method_name) : ''
rescue => ex
Util.logger_error(ex)
''
end end
def how_long_time def how_long_time
@ -261,16 +264,16 @@ module TidingDecorator
def journal_content def journal_content
case tiding_type case tiding_type
when 'Mentioned' then when 'Mentioned' then
I18n.t(locale_format(tiding_type)) % message_content_helper(container.notes) I18n.t(locale_format(tiding_type)) % message_content_helper(container&.notes)
when 'Comment' then when 'Comment' then
I18n.t(locale_format(tiding_type, container.parent.present?)) % message_content_helper(container.notes) I18n.t(locale_format(tiding_type, container.parent.present?)) % message_content_helper(container&.notes)
else else
I18n.t(locale_format) % container.issue.subject I18n.t(locale_format) % container&.issue&.subject
end end
end end
def issue_content def issue_content
I18n.t(locale_format) % container.subject I18n.t(locale_format) % container&.subject
end end
def pull_request_content def pull_request_content
@ -291,15 +294,15 @@ module TidingDecorator
end end
def poll_content def poll_content
I18n.t(locale_format(parent_container_type)) % container.polls_name I18n.t(locale_format(parent_container_type)) % container&.polls_name
end end
def exercise_content def exercise_content
I18n.t(locale_format(parent_container_type)) % container.exercise_name I18n.t(locale_format(parent_container_type)) % container&.exercise_name
end end
def student_graduation_topic_content def student_graduation_topic_content
I18n.t(locale_format) % container.graduation_topic.try(:name) I18n.t(locale_format) % container&.graduation_topic.try(:name)
end end
def deal_student_topic_select_content def deal_student_topic_select_content
@ -307,27 +310,27 @@ module TidingDecorator
end end
def graduation_task_content def graduation_task_content
I18n.t(locale_format(parent_container_type)) % container.name I18n.t(locale_format(parent_container_type)) % container&.name
end end
def graduation_work_content def graduation_work_content
I18n.t(locale_format(extra.nil?)) % container.graduation_task.try(:name) I18n.t(locale_format(extra.nil?)) % container&.graduation_task.try(:name)
end end
def graduation_work_score_content def graduation_work_score_content
I18n.t(locale_format) % container.graduation_work.graduation_task.try(:name) I18n.t(locale_format) % container&.graduation_work&.graduation_task.try(:name)
end end
def homework_common_content def homework_common_content
I18n.t(locale_format(parent_container_type), name: container.name, reason: extra) I18n.t(locale_format(parent_container_type), name: container&.name, reason: extra)
end end
def student_work_content def student_work_content
I18n.t(locale_format(extra.nil?)) % container.homework_common.try(:name) I18n.t(locale_format(extra.nil?)) % container&.homework_common.try(:name)
end end
def student_works_score_content def student_works_score_content
I18n.t(locale_format(extra)) % container.student_work.homework_common.try(:name) I18n.t(locale_format(extra)) % container&.student_work&.homework_common.try(:name)
end end
def challenge_work_score_content def challenge_work_score_content

Loading…
Cancel
Save