feat(web): add tooltips to icon-only action buttons
This commit is contained in:
parent
bec49f0771
commit
035edae522
10 changed files with 144 additions and 44 deletions
|
|
@ -586,15 +586,25 @@ defmodule MvWeb.GlobalSettingsLive do
|
|||
>
|
||||
{gettext("Test Integration")}
|
||||
</.button>
|
||||
<.button
|
||||
<.tooltip
|
||||
:if={Mv.Config.vereinfacht_configured?()}
|
||||
type="button"
|
||||
variant="secondary"
|
||||
phx-click="sync_vereinfacht_contacts"
|
||||
phx-disable-with={gettext("Syncing...")}
|
||||
content={
|
||||
gettext(
|
||||
"Creates a Vereinfacht finance contact for every member that does not have one yet."
|
||||
)
|
||||
}
|
||||
position="top"
|
||||
>
|
||||
{gettext("Sync all members without Vereinfacht contact")}
|
||||
</.button>
|
||||
<.button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
phx-click="sync_vereinfacht_contacts"
|
||||
phx-disable-with={gettext("Syncing...")}
|
||||
aria-label={gettext("Sync all members without Vereinfacht contact")}
|
||||
>
|
||||
{gettext("Sync all members without Vereinfacht contact")}
|
||||
</.button>
|
||||
</.tooltip>
|
||||
</div>
|
||||
<%= if @vereinfacht_test_result do %>
|
||||
<.vereinfacht_test_result result={@vereinfacht_test_result} />
|
||||
|
|
|
|||
|
|
@ -250,17 +250,19 @@ defmodule MvWeb.GroupLive.Show do
|
|||
<% end %>
|
||||
</div>
|
||||
</form>
|
||||
<.button
|
||||
type="button"
|
||||
variant="primary"
|
||||
phx-click="add_selected_members"
|
||||
data-testid="group-show-add-selected-members-btn"
|
||||
disabled={Enum.empty?(@selected_member_ids)}
|
||||
aria-label={gettext("Add members")}
|
||||
class="join-item"
|
||||
>
|
||||
<.icon name="hero-plus" class="size-5" />
|
||||
</.button>
|
||||
<.tooltip content={gettext("Add members")} position="top">
|
||||
<.button
|
||||
type="button"
|
||||
variant="primary"
|
||||
phx-click="add_selected_members"
|
||||
data-testid="group-show-add-selected-members-btn"
|
||||
disabled={Enum.empty?(@selected_member_ids)}
|
||||
aria-label={gettext("Add members")}
|
||||
class="join-item"
|
||||
>
|
||||
<.icon name="hero-plus" class="size-5" />
|
||||
</.button>
|
||||
</.tooltip>
|
||||
<.button
|
||||
type="button"
|
||||
variant="neutral"
|
||||
|
|
|
|||
|
|
@ -143,16 +143,21 @@ defmodule MvWeb.MemberLive.Show.MembershipFeesComponent do
|
|||
|
||||
<%!-- Action Buttons (only when user has permission) --%>
|
||||
<div class="flex gap-2 mb-4">
|
||||
<.button
|
||||
<.tooltip
|
||||
:if={@member.membership_fee_type != nil and @can_create_cycle}
|
||||
phx-click="regenerate_cycles"
|
||||
phx-target={@myself}
|
||||
class={["btn btn-sm btn-outline", if(@regenerating, do: "btn-disabled", else: "")]}
|
||||
title={gettext("Generate cycles from the last existing cycle to today")}
|
||||
content={gettext("Generate cycles from the last existing cycle to today")}
|
||||
position="top"
|
||||
>
|
||||
<.icon name="hero-arrow-path" class="size-4" />
|
||||
{if(@regenerating, do: gettext("Regenerating..."), else: gettext("Regenerate Cycles"))}
|
||||
</.button>
|
||||
<.button
|
||||
phx-click="regenerate_cycles"
|
||||
phx-target={@myself}
|
||||
class={["btn btn-sm btn-outline", if(@regenerating, do: "btn-disabled", else: "")]}
|
||||
aria-label={gettext("Regenerate membership fee cycles")}
|
||||
>
|
||||
<.icon name="hero-arrow-path" class="size-4" />
|
||||
{if(@regenerating, do: gettext("Regenerating..."), else: gettext("Regenerate Cycles"))}
|
||||
</.button>
|
||||
</.tooltip>
|
||||
<.button
|
||||
:if={Enum.any?(@cycles) and @can_destroy_cycle}
|
||||
variant="outline"
|
||||
|
|
|
|||
|
|
@ -298,17 +298,22 @@ defmodule MvWeb.MembershipFeeSettingsLive do
|
|||
<.icon name="hero-trash" class="size-4" />
|
||||
</button>
|
||||
</.tooltip>
|
||||
<.button
|
||||
<.tooltip
|
||||
:if={get_member_count(mft, @member_counts) == 0}
|
||||
variant="danger"
|
||||
size="sm"
|
||||
phx-click="delete"
|
||||
phx-value-id={mft.id}
|
||||
data-confirm={gettext("Are you sure?")}
|
||||
aria-label={gettext("Delete Membership Fee Type")}
|
||||
content={gettext("Delete Membership Fee Type")}
|
||||
position="left"
|
||||
>
|
||||
<.icon name="hero-trash" class="size-4" />
|
||||
</.button>
|
||||
<.button
|
||||
variant="danger"
|
||||
size="sm"
|
||||
phx-click="delete"
|
||||
phx-value-id={mft.id}
|
||||
data-confirm={gettext("Are you sure?")}
|
||||
aria-label={gettext("Delete Membership Fee Type")}
|
||||
>
|
||||
<.icon name="hero-trash" class="size-4" />
|
||||
</.button>
|
||||
</.tooltip>
|
||||
</:action>
|
||||
</.table>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -115,17 +115,22 @@ defmodule MvWeb.MembershipFeeTypeLive.Index do
|
|||
<.icon name="hero-trash" class="size-4" />
|
||||
</button>
|
||||
</.tooltip>
|
||||
<.button
|
||||
<.tooltip
|
||||
:if={get_member_count(mft, @member_counts) == 0}
|
||||
variant="danger"
|
||||
size="sm"
|
||||
phx-click="delete"
|
||||
phx-value-id={mft.id}
|
||||
data-confirm={gettext("Are you sure?")}
|
||||
aria-label={gettext("Delete Membership Fee Type")}
|
||||
content={gettext("Delete Membership Fee Type")}
|
||||
position="left"
|
||||
>
|
||||
<.icon name="hero-trash" class="size-4" />
|
||||
</.button>
|
||||
<.button
|
||||
variant="danger"
|
||||
size="sm"
|
||||
phx-click="delete"
|
||||
phx-value-id={mft.id}
|
||||
data-confirm={gettext("Are you sure?")}
|
||||
aria-label={gettext("Delete Membership Fee Type")}
|
||||
>
|
||||
<.icon name="hero-trash" class="size-4" />
|
||||
</.button>
|
||||
</.tooltip>
|
||||
</:action>
|
||||
</.table>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue