Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/helpers/organization_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def organization_profile_button(organization, truncate_at: nil, subtitle: nil, l
hover_title = [ organization.name, subtitle ].compact_blank.join(" — ")

link_to organization_path(organization),
data: data,
data: { turbo_prefetch: false }.merge(data),
title: hover_title,
class: "group relative flex items-center gap-2
w-full px-4 py-2
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/person_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def person_profile_button(person, truncate_at: nil, subtitle: nil, display_name:
hover_title = [ full_name, subtitle ].compact_blank.join(" — ")

link_to person_path(person),
data: data,
data: { turbo_prefetch: false }.merge(data),
title: hover_title,
class: "group relative flex items-center gap-2
w-full px-4 py-2
Expand Down
19 changes: 10 additions & 9 deletions app/views/people/people_results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<tbody class="divide-y divide-gray-200">
<% @people.each do |person| %>
<% cache [person, current_user.super_user?] do %>
<tr class="hover:bg-gray-50 transition-colors duration-150">
<tr class="hover:bg-gray-50 transition-colors duration-150 <%= "admin-only bg-blue-100" unless person.published? %>">
<td class="px-4 py-2">
<% show_email = person.profile_show_email? || allowed_to?(:manage?, Person) %>
<%= person_profile_button(person, subtitle: (person.preferred_email if show_email), data: { turbo_frame: "_top" }) %>
Expand All @@ -44,18 +44,19 @@
<span>--</span>
<% end %>
</td>
<!-- Organizations -->
<!-- Affiliations -->
<td class="px-4 py-2 text-sm text-gray-800">
<% orgs = person.affiliations.select { |affiliation| !affiliation.inactive? && (affiliation.end_date.nil? || affiliation.end_date >= Date.current) }.map(&:organization).compact.uniq %>
<% if orgs.any? %>
<% affiliations = person.affiliations.select { |a| a.organization.present? && !a.inactive? && (a.end_date.nil? || a.end_date >= Date.current) } %>
<% if affiliations.any? %>
<div class="flex flex-wrap gap-2">
<% orgs.first(3).each do |org| %>
<%= link_to org.name, organization_path(org),
<% affiliations.first(3).each do |affiliation| %>
<%= link_to affiliation.organization.name, organization_path(affiliation.organization),
data: { turbo_frame: "_top" },
class: "inline-block px-3 py-1 rounded-md text-sm font-medium #{DomainTheme.bg_class_for(:organizations, intensity: 100)} #{DomainTheme.text_class_for(:organizations)} #{DomainTheme.bg_class_for(:organizations, intensity: 100, hover: true)}" %>
class: "inline-block px-3 py-1 rounded-md text-sm font-medium #{DomainTheme.bg_class_for(:organizations, intensity: 100)} #{DomainTheme.text_class_for(:organizations)} #{DomainTheme.bg_class_for(:organizations, intensity: 100, hover: true)}",
style: affiliation.facilitator? ? nil : "border-left: 4px solid #d1d5db" %>
<% end %>
<% if orgs.size > 3 %>
<%= link_to "+#{orgs.size - 3}", person_path(person),
<% if affiliations.size > 3 %>
<%= link_to "+#{affiliations.size - 3}", person_path(person),
data: { turbo_frame: "_top" },
class: "inline-block px-3 py-1 rounded-md text-sm font-medium text-gray-500 hover:text-gray-700" %>
<% end %>
Expand Down
1 change: 1 addition & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@
t.index ["organization_id"], name: "index_reports_on_organization_id"
t.index ["owner_type", "owner_id"], name: "index_reports_on_owner_type_and_owner_id"
t.index ["type", "date"], name: "index_reports_on_type_and_date"
t.index ["type", "organization_id"], name: "index_reports_on_type_and_organization_id"
t.index ["windows_type_id"], name: "index_reports_on_windows_type_id"
t.index ["workshop_id"], name: "index_reports_on_workshop_id"
end
Expand Down