Display quotes in email notifications (#36379)
This commit is contained in:
17
app/views/notification_mailer/_nested_quote.html.haml
Normal file
17
app/views/notification_mailer/_nested_quote.html.haml
Normal file
@@ -0,0 +1,17 @@
|
||||
%table.email-w-full{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' }
|
||||
%tr
|
||||
%td.email-quote-header-img
|
||||
= image_tag full_asset_url(status.account.avatar.url), alt: '', width: 34, height: 34
|
||||
%td.email-quote-header-text
|
||||
%h2.email-quote-header-name
|
||||
= display_name(status.account)
|
||||
%p.email-quote-header-handle
|
||||
@#{status.account.pretty_acct}
|
||||
|
||||
%table.email-w-full{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' }
|
||||
%tr
|
||||
%td.email-status-content
|
||||
= render 'status_content', status: status
|
||||
|
||||
%p.email-status-footer
|
||||
= link_to l(status.created_at.in_time_zone(time_zone.presence), format: :with_time_zone), web_url("@#{status.account.pretty_acct}/#{status.id}")
|
||||
@@ -11,21 +11,12 @@
|
||||
%table.email-w-full{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' }
|
||||
%tr
|
||||
%td.email-status-content
|
||||
.auto-dir
|
||||
- if status.spoiler_text?
|
||||
%p.email-status-spoiler
|
||||
= status.spoiler_text
|
||||
|
||||
.email-status-prose
|
||||
= status_content_format(status)
|
||||
|
||||
- if status.ordered_media_attachments.size.positive?
|
||||
%p.email-status-media
|
||||
- status.ordered_media_attachments.each do |a|
|
||||
- if status.local?
|
||||
= link_to full_asset_url(a.file.url(:original)), full_asset_url(a.file.url(:original))
|
||||
- else
|
||||
= link_to a.remote_url, a.remote_url
|
||||
= render 'status_content', status: status
|
||||
|
||||
- if status.local? && status.quote
|
||||
%table.email-inner-card-table{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' }
|
||||
%tr
|
||||
%td.email-inner-nested-card-td
|
||||
= render 'nested_quote', status: status.quote.quoted_status, time_zone: time_zone
|
||||
%p.email-status-footer
|
||||
= link_to l(status.created_at.in_time_zone(time_zone.presence), format: :with_time_zone), web_url("@#{status.account.pretty_acct}/#{status.id}")
|
||||
|
||||
@@ -4,5 +4,9 @@
|
||||
>
|
||||
<% end %>
|
||||
> <%= raw word_wrap(extract_status_plain_text(status), break_sequence: "\n> ") %>
|
||||
<% if status.local? && status.quote %>
|
||||
>
|
||||
>> <%= raw word_wrap(extract_status_plain_text(status.quote.quoted_status), break_sequence: "\n>> ") %>
|
||||
<% end %>
|
||||
|
||||
<%= raw t('application_mailer.view')%> <%= web_url("@#{status.account.pretty_acct}/#{status.id}") %>
|
||||
|
||||
15
app/views/notification_mailer/_status_content.html.haml
Normal file
15
app/views/notification_mailer/_status_content.html.haml
Normal file
@@ -0,0 +1,15 @@
|
||||
.auto-dir
|
||||
- if status.spoiler_text?
|
||||
%p.email-status-spoiler
|
||||
= status.spoiler_text
|
||||
|
||||
.email-status-prose
|
||||
= status_content_format(status)
|
||||
|
||||
- if status.ordered_media_attachments.size.positive?
|
||||
%p.email-status-media
|
||||
- status.ordered_media_attachments.each do |a|
|
||||
- if status.local?
|
||||
= link_to full_asset_url(a.file.url(:original)), full_asset_url(a.file.url(:original))
|
||||
- else
|
||||
= link_to a.remote_url, a.remote_url
|
||||
Reference in New Issue
Block a user