|
2 | 2 | - status_class = "status-#{status}" |
3 | 3 | - star_data = star_data || {} |
4 | 4 | td.topic-title.status-border class=status_class id=dom_id(topic, "status_cell") data-label="Topic" |
5 | | - .topic-title-stack |
| 5 | + - creator = topic.creator_display_alias |
| 6 | + - last_sender = topic.last_sender_person&.default_alias |
| 7 | + .topic-title-main |
| 8 | + - if status.to_s == "reading" |
| 9 | + - read_count = state[:read_count].to_i |
| 10 | + - total_count = topic.message_count |
| 11 | + - unread_count = [total_count - read_count, 0].max |
| 12 | + - if unread_count.positive? |
| 13 | + = link_to topic_path(topic, anchor: "first-unread"), class: "topic-icon topic-icon-reading", title: "Jump to first unread message (#{unread_count} unread)" do |
| 14 | + i.fa-solid.fa-envelope |
| 15 | + span.topic-icon-badge.topic-icon-badge-sup = unread_count |
| 16 | + - else |
| 17 | + .topic-icon.topic-icon-reading title="All messages read" |
| 18 | + i.fa-solid.fa-envelope |
| 19 | + = render partial: "topics/star_icon", locals: { topic: topic, star_data: star_data } |
| 20 | + = render partial: "topics/note_icon", locals: { topic: topic, count: note_count.to_i } |
| 21 | + = render partial: "topics/team_readers_icon", locals: { topic: topic, readers: team_readers } |
| 22 | + - commitfest_summary = @commitfest_summaries&.dig(topic.id) |
| 23 | + - if commitfest_summary |
| 24 | + = render partial: "topics/commitfest_icon", locals: { summary: commitfest_summary } |
| 25 | + - elsif topic.has_attachments? |
| 26 | + .topic-icon title="Attachments" |
| 27 | + i.fa-solid.fa-paperclip |
| 28 | + = link_to topic.title, topic_path(topic), class: "topic-link" |
| 29 | + .topic-title-mobile |
6 | 30 | = link_to topic.title, topic_path(topic), class: "topic-link" |
7 | | - - creator = topic.creator_display_alias |
8 | | - - last_sender = topic.last_sender_person&.default_alias |
9 | 31 | - if creator || last_sender |
10 | 32 | .topic-byline |
11 | 33 | - if creator |
|
0 commit comments