Skip to content
Merged
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
12 changes: 4 additions & 8 deletions app/assets/stylesheets/components/messages.css
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,10 @@

.thread-actions {
margin-bottom: var(--spacing-4);

& .button-secondary {
padding: var(--spacing-2) var(--spacing-4);
border: var(--border-width) solid var(--color-border);
background: var(--color-bg-card);
border-radius: var(--border-radius-sm);
cursor: pointer;
}
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--spacing-2);
}

.message-subject {
Expand Down
7 changes: 5 additions & 2 deletions app/views/topics/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,12 @@
= render "notes/note_stack", topic: @topic, message: nil, notes: thread_notes

.messages-container.flat.asc
- if user_signed_in?
- last_message = @messages.last
- if last_message.present?
.thread-actions data-controller="thread-actions" data-thread-actions-topic-id-value=@topic.id data-thread-actions-read-all-url-value=read_all_topic_path(@topic, format: :json)
button.button-secondary data-action="click->thread-actions#markAllRead" Mark all messages read
- if user_signed_in?
button.button.button-secondary.button-small data-action="click->thread-actions#markAllRead" Mark all messages read
= link_to "Jump to latest", "#message-#{last_message.id}", class: "button button-secondary button-small", title: "Jump to latest message", "aria-label": "Jump to latest message"

- first_unread_found = false
- @messages.each do |message|
Expand Down