feat(member): show join_description as a tooltip on custom-field labels

This commit is contained in:
Simon 2026-06-03 12:22:58 +02:00
parent ee5ccbf7e9
commit df271055a8
5 changed files with 85 additions and 9 deletions

View file

@ -235,6 +235,19 @@ defmodule MvWeb.MemberLive.Show do
<%= for custom_field <- @custom_fields do %>
<% cfv = find_custom_field_value(@member.custom_field_values, custom_field.id) %>
<.data_field label={custom_field.name}>
<:label_suffix :if={custom_field.join_description}>
<.tooltip
content={"#{gettext("Join form:")} #{custom_field.join_description}"}
wrap_class="ml-1 inline-flex items-center"
>
<span data-testid="join-description-tooltip">
<.icon
name="hero-information-circle"
class="size-3.5 text-base-content/50"
/>
</span>
</.tooltip>
</:label_suffix>
{format_custom_field_value(cfv, custom_field.value_type)}
</.data_field>
<% end %>
@ -605,11 +618,14 @@ defmodule MvWeb.MemberLive.Show do
attr :value, :string, default: nil
attr :class, :string, default: ""
slot :inner_block
slot :label_suffix
defp data_field(assigns) do
~H"""
<dl class={@class}>
<dt class="text-sm font-medium text-base-content/70">{@label}</dt>
<dt class="text-sm font-medium text-base-content/70 flex items-center">
{@label}{render_slot(@label_suffix)}
</dt>
<dd class="mt-1 text-base-content">
<%= if @inner_block != [] do %>
{render_slot(@inner_block)}