Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/assets/stylesheets/components/messages.css
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,23 @@

.attachment-info {
display: flex;
gap: var(--spacing-3);
align-items: center;
font-size: var(--font-size-sm);
}

summary.attachment-info {
cursor: pointer;
display: list-item;
}

.filename {
font-weight: var(--font-weight-medium);
color: var(--color-text-primary);
}

.content-type {
color: var(--color-text-muted);
margin-left: var(--spacing-3);
}

.import-metadata {
Expand Down
17 changes: 13 additions & 4 deletions app/views/topics/_message.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,19 @@
.message-attachments
h4 Attachments:
- message.attachments.each do |attachment|
.attachment
.attachment-info
span.filename = attachment.file_name
span.content-type = attachment.content_type if attachment.content_type
- if attachment.patch?
details class="attachment"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these class="<x>" lines could all be like details.attachment

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I haven't used this template language before. Good to know! 🙂

summary class="attachment-info"
span.filename = attachment.file_name
span.content-type = attachment.content_type if attachment.content_type
pre class="attachment-content"
code class="language-diff"
= attachment.decoded_body
- else
.attachment
.attachment-info
span.filename = attachment.file_name
span.content-type = attachment.content_type if attachment.content_type

- if message.import_log.present?
.import-metadata
Expand Down