5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 15:56:21 +00:00
panel/app/views/moderation_queue/_comment.haml

48 lines
1.6 KiB
Text
Raw Normal View History

2024-03-04 16:49:07 +00:00
-#
Componente Comentario
2024-03-18 14:55:38 +00:00
@param site [Site]
2024-03-08 16:08:24 +00:00
@param form [String]
2024-03-04 16:49:07 +00:00
@param profile [Hash]
@param comment [Hash]
@param activity_pub [ActivityPub]
2024-03-04 16:11:17 +00:00
- in_reply_to = text_plain comment['inReplyTo']
2024-03-18 14:55:38 +00:00
:ruby
begin
if in_reply_to && (remote_object = object.referenced(site)['inReplyTo'])
in_reply_to = ActivityPub.url_from_object(remote_object)
end
rescue Exception => e
ExceptionNotifier.notify_exception(e, data: { site: site.name, object: comment })
end
2024-03-04 16:49:07 +00:00
- summary = text_plain comment['summary']
-# @todo Generar un desplegable con todas las opciones
- url = text_plain ActivityPub.url_from_object(comment)
2024-03-04 16:11:17 +00:00
.row.no-gutters
.col-1
2024-03-08 16:08:24 +00:00
= render 'components/checkbox', id: activity_pub.id, name: 'activity_pub[]', value: activity_pub.id, data: { target: 'select-all.input' }, form: form
.col-11
2024-03-14 14:57:06 +00:00
- cache [activity_pub, comment] do
.d-flex.flex-row.align-items-center.justify-content-between
%h4.mb-0
%a{ href: text_plain(comment['attributedTo']) }= text_plain profile['preferredUsername']
%a{ href: url }
%small
= render 'layouts/time', time: text_plain(comment['published'])
2024-03-14 14:57:06 +00:00
- if in_reply_to.present?
%dl
%dt.d-inline
%small= t('.reply_to')
%dd.d-inline
%small
%a{ href: in_reply_to }= in_reply_to
.content.mb-3
2024-03-14 14:57:06 +00:00
- if summary.present?
= render 'layouts/details', summary: summary, summary_class: 'h5' do
= sanitize comment['content']
- else
2024-03-04 14:59:29 +00:00
= sanitize comment['content']
2024-03-04 16:49:07 +00:00
= render 'components/comments_btn_box', activity_pub: activity_pub