diff --git a/app/views/topics/_avatar_list.slim b/app/views/topics/_avatar_list.slim index 6dbef91..bd814ee 100644 --- a/app/views/topics/_avatar_list.slim +++ b/app/views/topics/_avatar_list.slim @@ -7,7 +7,8 @@ - css_classes << "is-major-contributor" if !participant.core_team? && !participant.committer? && participant.major_contributor? - css_classes << "is-significant-contributor" if !participant.core_team? && !participant.committer? && !participant.major_contributor? && participant.significant_contributor? - css_classes << "is-past-contributor" if participant.past_contributor? - - badge_text = participant.contributor_badge ? "#{participant.name} (#{participant.contributor_badge})" : participant.name + - role_label = participant.contributor_badge || "User" + - badge_text = "#{participant.name} (#{role_label})" = link_to person_path(participant.email), class: "participant-avatar-link" do = image_tag participant.display_gravatar_url(size: 32), class: css_classes.join(" "), alt: participant.name, title: badge_text - if total_participants > participants.count diff --git a/app/views/topics/_note_icon.html.slim b/app/views/topics/_note_icon.html.slim index fa45fb3..f9edcb6 100644 --- a/app/views/topics/_note_icon.html.slim +++ b/app/views/topics/_note_icon.html.slim @@ -1,7 +1,8 @@ - count = count.to_i - classes = ["topic-icon", "activity-note"] - classes << "is-hidden" unless count.positive? -div class=classes.join(" ") id=dom_id(topic, "notes") data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" +- tooltip_label = count.positive? ? "Notes: #{count}" : "Notes" +div class=classes.join(" ") id=dom_id(topic, "notes") title=tooltip_label data-controller="hover-popover" data-hover-popover-delay-value="200" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" i.fa-solid.fa-note-sticky - if count.positive? span.topic-icon-badge = count diff --git a/app/views/topics/_participant_row.html.slim b/app/views/topics/_participant_row.html.slim index c56c7bf..cb49d59 100644 --- a/app/views/topics/_participant_row.html.slim +++ b/app/views/topics/_participant_row.html.slim @@ -6,7 +6,9 @@ - tooltip_parts = [] - tooltip_parts << "#{message_count} messages" if message_count - tooltip_parts << "last #{smart_time_display(last_at)}" if last_at -- tooltip = local_assigns[:tooltip] || (tooltip_parts.any? ? tooltip_parts.join(", ") : alias_record.name) +- role_label = alias_record.contributor_badge || "User" +- tooltip_parts << role_label +- tooltip = local_assigns[:tooltip] || (tooltip_parts.any? ? tooltip_parts.join(", ") : "#{alias_record.name} (#{role_label})") - avatar_classes = ["participant-avatar"] - membership_icons = [] - membership_types = alias_record.contributor_membership_types diff --git a/app/views/topics/_participation_icon.html.slim b/app/views/topics/_participation_icon.html.slim index f291516..86237e9 100644 --- a/app/views/topics/_participation_icon.html.slim +++ b/app/views/topics/_participation_icon.html.slim @@ -11,4 +11,5 @@ div class=classes.join(" ") id=dom_id(topic, "participation") data-controller="h .topic-icon-hover data-hover-popover-target="popover" data-action="mouseenter->hover-popover#show mouseleave->hover-popover#scheduleHide" - aliases.each do |alias_record| - participant_stub = { alias: alias_record } - = render partial: "participant_row", locals: { participant: participant_stub, avatar_size: 32, tooltip: alias_record.name } + - role_label = alias_record.contributor_badge || "User" + = render partial: "participant_row", locals: { participant: participant_stub, avatar_size: 32, tooltip: "#{alias_record.name} (#{role_label})" } diff --git a/app/views/topics/_status_cell.html.slim b/app/views/topics/_status_cell.html.slim index c46e633..db4c936 100644 --- a/app/views/topics/_status_cell.html.slim +++ b/app/views/topics/_status_cell.html.slim @@ -5,7 +5,7 @@ td.topic-title.status-border class=status_class id=dom_id(topic, "status_cell") - read_count = state[:read_count].to_i - total_count = topic.messages.count - unread_count = [total_count - read_count, 0].max - .topic-icon.topic-icon-reading + .topic-icon.topic-icon-reading title="Unread messages: #{unread_count}" i.fa-solid.fa-envelope - if unread_count.positive? span.topic-icon-badge.topic-icon-badge-sup = unread_count @@ -15,6 +15,6 @@ td.topic-title.status-border class=status_class id=dom_id(topic, "status_cell") - if commitfest_summary = render partial: "topics/commitfest_icon", locals: { summary: commitfest_summary } - elsif topic.attachments.exists? - .topic-icon + .topic-icon title="Attachments" i.fa-solid.fa-paperclip = link_to topic.title, topic_path(topic), class: "topic-link" diff --git a/app/views/topics/_team_readers_icon.html.slim b/app/views/topics/_team_readers_icon.html.slim index 7f34ec5..fce4f06 100644 --- a/app/views/topics/_team_readers_icon.html.slim +++ b/app/views/topics/_team_readers_icon.html.slim @@ -10,4 +10,5 @@ div class=classes.join(" ") id=dom_id(topic, "team_readers") data-controller="ho - alias_record = reader[:user]&.person&.default_alias || reader[:user]&.aliases&.first - next unless alias_record - participant_stub = { alias: alias_record } - = render partial: "participant_row", locals: { participant: participant_stub, avatar_size: 32, tooltip: "#{alias_record.name} (#{reader[:status]})" } + - role_label = alias_record.contributor_badge || "User" + = render partial: "participant_row", locals: { participant: participant_stub, avatar_size: 32, tooltip: "#{alias_record.name} (#{reader[:status]}, #{role_label})" } diff --git a/app/views/topics/_topics_page.html.slim b/app/views/topics/_topics_page.html.slim index 99c3979..ccf8252 100644 --- a/app/views/topics/_topics_page.html.slim +++ b/app/views/topics/_topics_page.html.slim @@ -22,7 +22,8 @@ - css_classes << "is-major-contributor" if !participant.core_team? && !participant.committer? && participant.major_contributor? - css_classes << "is-significant-contributor" if !participant.core_team? && !participant.committer? && !participant.major_contributor? && participant.significant_contributor? - css_classes << "is-past-contributor" if participant.past_contributor? - - badge_text = participant.contributor_badge ? "#{participant.name} (#{participant.contributor_badge})" : participant.name + - role_label = participant.contributor_badge || "User" + - badge_text = "#{participant.name} (#{role_label})" = link_to person_path(participant.email), class: "participant-avatar-link" do = image_tag participant.display_gravatar_url(size: 32), class: css_classes.join(" "), alt: participant.name, title: badge_text - total_participants = topic.messages.select(:sender_id).distinct.count