Skip to content

Commit 39ade84

Browse files
committed
fixup! Inline all plain text attachments
1 parent 8186b88 commit 39ade84

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

app/views/topics/_message.html.slim

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,31 +65,26 @@
6565
.message-attachments id="message-#{message.id}-attachments"
6666
h4 Attachments:
6767
- message.attachments.each do |attachment|
68-
- if attachment.patch?
68+
- if attachment.patch? || attachment.text?
6969
details.attachment
7070
summary.attachment-info
7171
span.attachment-summary-row
7272
span.filename = attachment.file_name
7373
span.content-type = attachment.content_type if attachment.content_type
7474
= link_to "Download", attachment_path(attachment), class: "attachment-download", download: attachment.file_name, data: { turbo: false }
75-
- stats = attachment.diff_line_stats
76-
- if stats[:added].positive? || stats[:removed].positive?
77-
span.patchset-stats aria-label="Patch line changes" title="Lines added and removed by this patch"
78-
span.patchset-added +#{stats[:added]}
79-
span.patchset-removed -#{stats[:removed]}
75+
- if attachment.patch?
76+
- stats = attachment.diff_line_stats
77+
- if stats[:added].positive? || stats[:removed].positive?
78+
span.patchset-stats aria-label="Patch line changes" title="Lines added and removed by this patch"
79+
span.patchset-added +#{stats[:added]}
80+
span.patchset-removed -#{stats[:removed]}
8081
pre.attachment-content
81-
code.language-diff data-controller="diff-highlight"
82-
= attachment.decoded_body_utf8
83-
- elsif attachment.text?
84-
details.attachment
85-
summary.attachment-info
86-
span.attachment-summary-row
87-
span.filename = attachment.file_name
88-
span.content-type = attachment.content_type if attachment.content_type
89-
= link_to "Download", attachment_path(attachment), class: "attachment-download", download: attachment.file_name, data: { turbo: false }
90-
pre.attachment-content
91-
code
92-
= attachment.decoded_body_utf8
82+
- if attachment.patch?
83+
code.language-diff data-controller="diff-highlight"
84+
= attachment.decoded_body_utf8
85+
- else
86+
code
87+
= attachment.decoded_body_utf8
9388
- else
9489
.attachment
9590
.attachment-info

0 commit comments

Comments
 (0)