chromesetting
daiao 5 years ago
parent 71c0b7266b
commit b5ef40118e

@ -23,6 +23,7 @@ class CommentsController < ApplicationController
@discuss.hidden = false
@discuss.user_id = current_user.id
@discuss.root_id = params[:comments][:parent_id]
@discusses.parent_container_id =
@discuss.save!
rescue Exception => e
uid_logger_error("reply discuss failed : #{e.message}")

@ -100,6 +100,7 @@ class HacksController < ApplicationController
@hack.update_attribute(:status, 1)
base_attrs = {
trigger_user_id: current_user.id, viewed: 0, tiding_type: 'System', user_id: @hack.user_id,
parent_container_type: "HackPublish"
}
@hack.tidings.create!(base_attrs)
render_ok
@ -109,7 +110,8 @@ class HacksController < ApplicationController
def cancel_publish
@hack.update_attribute(:status, 0)
base_attrs = {
trigger_user_id: current_user.id, viewed: 0, tiding_type: 'System', user_id: @hack.user_id
trigger_user_id: current_user.id, viewed: 0, tiding_type: 'System', user_id: @hack.user_id,
parent_container_type: "HackUnPublish"
}
@hack.tidings.create!(base_attrs)
render_ok

@ -220,11 +220,13 @@ module TidingDecorator
when 'Journal' then
message = parent_container&.notes.present? ? '' + message_content_helper(parent_container.notes) : ''
I18n.t(locale_format(parent_container_type)) % message
when 'Hack' then
I18n.t(locale_format(parent_container_type)) % parent_container.name
end
end
def discuss_content
I18n.t(locale_format(container.parent_id.present?)) % message_content_helper(container.content)
I18n.t(locale_format(container_type, container.parent_id.present?)) % message_content_helper(container.content)
end
def grade_content
@ -408,4 +410,8 @@ module TidingDecorator
def subject_start_course_content
I18n.t(locale_format) % belong_container&.name
end
def hack_content
I18n.t(locale_format(parent_container_type)) % container&.name
end
end

@ -59,7 +59,7 @@ class Discuss < ApplicationRecord
elsif dis_type == 'Hack'
user_id = has_parent? ? parent.user_id : Hack.find(dis_id).user_id
parent_container_type = 'Hack'
challenge_id = nil
challenge_id = dis_id
end
base_attrs = {
trigger_user_id: user_id, parent_container_id: challenge_id, parent_container_type: parent_container_type,

@ -56,7 +56,8 @@ class Hack < ApplicationRecord
private
def send_delete_tiding
base_attrs = {
user_id: user_id, viewed: 0, tiding_type: 'Delete', trigger_user_id: current_user.id, content: "你删除了题目:#{name}"
user_id: user_id, viewed: 0, tiding_type: 'System', trigger_user_id: current_user.id,
parent_container_type: "HackDelete"
}
tidings.create!(base_attrs)
end

@ -93,6 +93,7 @@
Challenge:
"1_end": "赞了你发布的实训任务:%s第%s关"
"2_end": "踩了你发布的实训任务:%s第%s关"
Hack_end: "赞了你发布的题目:%s"
Memo:
true_end: "赞了你的评论:%s"
false_end: "赞了发布的帖子:%s"
@ -107,8 +108,16 @@
Issue_end: "赞了你发布的项目Issue%s"
Journal_end: "赞了你的回复%s"
Discuss:
true_end: "评论了你的回复:%s"
false_end: "评论了你发布的实训:%s"
Shixun:
true_end: "评论了你的回复:%s"
false_end: "评论了你发布的实训:%s"
Hack:
true_end: "评论了你的回复:%s"
false_end: "评论了你发布的题目:%s"
Hack:
HackPublish_end: "你发布了题目:%s"
HackUnPublish_end: "你撤销发布了题目:%s"
HackDelete_end: "你删除了题目:%s"
Grade:
Avatar_end: "首次上传头像获得金币奖励:%s金币"
Phone_end: "首次绑定手机号码获得金币奖励:%s金币"

Loading…
Cancel
Save