mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 11:48:26 -06:00
FIX: only show edit reason when the user action is an EDIT
This commit is contained in:
parent
2c19d8a136
commit
90eb6e6b8f
@ -25,7 +25,7 @@ class UserActionSerializer < ApplicationSerializer
|
|||||||
:edit_reason
|
:edit_reason
|
||||||
|
|
||||||
def excerpt
|
def excerpt
|
||||||
PrettyText.excerpt(object.cooked,300) if object.cooked
|
PrettyText.excerpt(object.cooked, 300) if object.cooked
|
||||||
end
|
end
|
||||||
|
|
||||||
def avatar_template
|
def avatar_template
|
||||||
@ -39,10 +39,10 @@ class UserActionSerializer < ApplicationSerializer
|
|||||||
|
|
||||||
def acting_avatar_template
|
def acting_avatar_template
|
||||||
avatar_for(
|
avatar_for(
|
||||||
object.acting_email,
|
object.acting_email,
|
||||||
object.acting_use_uploaded_avatar,
|
object.acting_use_uploaded_avatar,
|
||||||
object.acting_uploaded_avatar_template,
|
object.acting_uploaded_avatar_template,
|
||||||
object.acting_uploaded_avatar_id
|
object.acting_uploaded_avatar_id
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -66,7 +66,12 @@ class UserActionSerializer < ApplicationSerializer
|
|||||||
object.post_type == Post.types[:moderator_action]
|
object.post_type == Post.types[:moderator_action]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def edit_reason
|
||||||
|
object.edit_reason if object.action_type == UserAction::EDIT
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def avatar_for(email, use_uploaded_avatar, uploaded_avatar_template, uploaded_avatar_id)
|
def avatar_for(email, use_uploaded_avatar, uploaded_avatar_template, uploaded_avatar_id)
|
||||||
# NOTE: id is required for cases where the template is blank (during initial population)
|
# NOTE: id is required for cases where the template is blank (during initial population)
|
||||||
User.new(
|
User.new(
|
||||||
|
Loading…
Reference in New Issue
Block a user