|
| 1 | +- state = state || {} |
| 2 | +- note_count = note_count.to_i |
| 3 | +- participation = participation || {} |
| 4 | +- team_readers = team_readers || [] |
| 5 | + |
| 6 | +tr id=dom_id(topic) class="topic-row topic-#{state[:status] || 'new'}" data-topic-id=topic.id data-last-message-id=topic.messages.maximum(:id) |
| 7 | + = render partial: "topics/status_cell", locals: { topic: topic, state: state, note_count: note_count, team_readers: team_readers } |
| 8 | + td.topic-activity data-label="Activity" |
| 9 | + - last_message = topic.messages.order(:created_at).last |
| 10 | + - replies_count = [topic.messages.count - 1, 0].max |
| 11 | + .activity-info.compact |
| 12 | + .activity-replies = pluralize(replies_count, "reply") |
| 13 | + .activity-time title=absolute_time_display(last_message.created_at) = smart_time_display(last_message.created_at) |
| 14 | + td.topic-participants data-label="Participants" |
| 15 | + - participants = topic.participant_aliases(limit: 5) |
| 16 | + - participant_count = topic.participant_count |
| 17 | + = render partial: "avatar_list", locals: { participants: participants, total_participants: participant_count } |
| 18 | + - if topic.has_contributor_activity? |
| 19 | + - contributor_participants = topic.contributor_participants |
| 20 | + - contributor_count = contributor_participants.size |
| 21 | + div class ="topic-icon activity-#{ topic.highest_contributor_activity }" data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" |
| 22 | + i.fa-solid.fa-users-rays |
| 23 | + - if contributor_count.positive? |
| 24 | + span.topic-icon-badge = contributor_count |
| 25 | + - if contributor_participants.any? |
| 26 | + .topic-icon-hover data-hover-popover-target="popover" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" |
| 27 | + - contributor_participants.each do |participant| |
| 28 | + = render partial: "participant_row", locals: { participant: participant, avatar_size: 32 } |
| 29 | + = render partial: "topics/participation_icon", locals: { topic: topic, participation: participation } |
0 commit comments