-
Notifications
You must be signed in to change notification settings - Fork 5
Multiple fixes #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple fixes #47
Changes from 4 commits
405dc60
e2a02a5
3524149
6a2d2c5
3b3d7be
0170887
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,12 +3,20 @@ | |
| - participation = participation || {} | ||
| - team_readers = team_readers || [] | ||
| - star_data = star_data || {} | ||
| - status = state[:status] || "new" | ||
| - reading_unread_count = nil | ||
| - if status.to_s == "reading" | ||
| - read_count = state[:read_count].to_i | ||
| - total_count = topic.message_count | ||
| - reading_unread_count = [total_count - read_count, 0].max | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need the exact count? If the status is reading, we have at least one unread messages, and that's all we need here
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because without we can show "has-new-replies" even when there are no unread messages? The envelope icon also only appears when reading_unread_count is positive, which is why we used the count to gate the has-new-replies or what am I missing? |
||
| - row_class = ["topic-row", "topic-#{status}"] | ||
| - row_class << "has-new-replies" if status.to_s == "reading" && reading_unread_count.to_i.positive? | ||
| - topic_participants_map ||= @topic_participants_map || {} | ||
| - tp_data = topic_participants_map[topic.id] || {} | ||
| - top_participants = tp_data[:top] || [] | ||
| - contributor_participants = tp_data[:contributors] || [] | ||
|
|
||
| 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 | ||
| tr id=dom_id(topic) class=row_class.join(" ") data-topic-id=topic.id data-last-message-id=topic.last_message_id | ||
| = render partial: "topics/status_cell", locals: { topic: topic, state: state, note_count: note_count, team_readers: team_readers, star_data: star_data } | ||
| td.topic-activity data-label="Activity" | ||
| - replies_count = [topic.message_count - 1, 0].max | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this won't look strange?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would this look strange? Did you pull and look at it?