docbrown/app/views/api/v0/comments/_comment.json.jbuilder
yheuhtozr e45536af37
app/models i18n (#16124)
* app/models etc i18n

* delete ja.yml

* fix for PR review

* fix for spec

* delete ja.yml

* fix for spec updated
2022-02-03 13:41:42 -05:00

14 lines
430 B
Ruby

json.type_of "comment"
json.id_code comment.id_code_generated
json.created_at utc_iso_timestamp(comment.created_at)
if comment.deleted?
json.body_html "<p>#{Comment.title_deleted}</p>"
json.set! :user, {}
elsif comment.hidden_by_commentable_user?
json.body_html "<p>#{Comment.title_hidden}</p>"
json.set! :user, {}
else
json.body_html comment.processed_html
json.partial! "api/v0/shared/user", user: comment.user
end