mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 16:16:21 +00:00
47 lines
1.6 KiB
Text
47 lines
1.6 KiB
Text
-#
|
|
Componente Comentario
|
|
|
|
@param site [Site]
|
|
@param form [String]
|
|
@param profile [Hash]
|
|
@param comment [Hash]
|
|
@param activity_pub [ActivityPub]
|
|
|
|
- in_reply_to = text_plain comment['inReplyTo']
|
|
: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
|
|
- summary = text_plain comment['summary']
|
|
-# @todo Generar un desplegable con todas las opciones
|
|
- url = text_plain ActivityPub.url_from_object(comment)
|
|
|
|
.row.no-gutters
|
|
.col-1
|
|
= render 'components/checkbox', id: activity_pub.id, name: 'activity_pub[]', value: activity_pub.id, data: { target: 'select-all.input' }, form: form
|
|
.col-11
|
|
- 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'])
|
|
- 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
|
|
- if summary.present?
|
|
= render 'layouts/details', summary: summary, summary_class: 'h5' do
|
|
= sanitize comment['content']
|
|
- else
|
|
= sanitize comment['content']
|
|
= render 'components/comments_btn_box', activity_pub: activity_pub
|