Skip to content

Commit 405dc60

Browse files
committed
Invert colors for the read vs unread partially read threads overview
Signed-off-by: Kai Wagner <kai.wagner@percona.com>
1 parent 866c1b9 commit 405dc60

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

app/assets/stylesheets/components/topics.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,14 @@ a.topic-icon {
303303
}
304304
}
305305

306+
.topic-row.topic-reading.has-new-replies {
307+
background: var(--color-bg-unread);
308+
309+
&:hover {
310+
background: var(--color-bg-unread-hover);
311+
}
312+
}
313+
306314
.topic-row.topic-read {
307315
color: var(--color-text-muted);
308316
background: var(--color-bg-read);
@@ -329,7 +337,7 @@ a.topic-icon {
329337
top: 0;
330338
bottom: 0;
331339
width: var(--topic-new-replies-strip-width, 260px);
332-
background: var(--color-bg-unread);
340+
background: var(--color-bg-read);
333341
clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 0 100%);
334342
z-index: 0;
335343
}

app/views/topics/_topic_row_user.html.slim

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,20 @@
33
- participation = participation || {}
44
- team_readers = team_readers || []
55
- star_data = star_data || {}
6+
- status = state[:status] || "new"
7+
- reading_unread_count = nil
8+
- if status.to_s == "reading"
9+
- read_count = state[:read_count].to_i
10+
- total_count = topic.message_count
11+
- reading_unread_count = [total_count - read_count, 0].max
12+
- row_class = ["topic-row", "topic-#{status}"]
13+
- row_class << "has-new-replies" if status.to_s == "reading" && reading_unread_count.to_i.positive?
614
- topic_participants_map ||= @topic_participants_map || {}
715
- tp_data = topic_participants_map[topic.id] || {}
816
- top_participants = tp_data[:top] || []
917
- contributor_participants = tp_data[:contributors] || []
1018

11-
tr id=dom_id(topic) class="topic-row topic-#{state[:status] || 'new'}" data-topic-id=topic.id data-last-message-id=topic.last_message_id
19+
tr id=dom_id(topic) class=row_class.join(" ") data-topic-id=topic.id data-last-message-id=topic.last_message_id
1220
= render partial: "topics/status_cell", locals: { topic: topic, state: state, note_count: note_count, team_readers: team_readers, star_data: star_data }
1321
td.topic-activity data-label="Activity"
1422
- replies_count = [topic.message_count - 1, 0].max

0 commit comments

Comments
 (0)