Membership Fee 6 - UI Components & LiveViews closes #280 #304

Open
moritz wants to merge 65 commits from feature/280_membership_fee_ui into main
Showing only changes of commit 1bb03b52c9 - Show all commits

View file

@ -85,34 +85,37 @@ defmodule MvWeb.MembershipFeeTypeLive.Index do
</:action> </:action>
<:action :let={mft}> <:action :let={mft}>
<div
:if={get_member_count(mft, @member_counts) > 0}
class="tooltip tooltip-left"
data-tip={
gettext("Cannot delete - %{count} member(s) assigned",
count: get_member_count(mft, @member_counts)
)
}
>
<button <button
phx-click="delete" phx-click="delete"
phx-value-id={mft.id} phx-value-id={mft.id}
data-confirm={gettext("Are you sure?")} data-confirm={gettext("Are you sure?")}
class={[ class="btn btn-ghost btn-xs text-error opacity-50 cursor-not-allowed"
"btn btn-ghost btn-xs",
if(get_member_count(mft, @member_counts) > 0,
do: "text-error opacity-50 cursor-not-allowed",
else: "text-error"
)
]}
aria-label={ aria-label={
if get_member_count(mft, @member_counts) > 0,
do:
gettext("Cannot delete - %{count} member(s) assigned", gettext("Cannot delete - %{count} member(s) assigned",
count: get_member_count(mft, @member_counts) count: get_member_count(mft, @member_counts)
), )
else: gettext("Delete membership fee type")
} }
title={ disabled={true}
if get_member_count(mft, @member_counts) > 0, >
do: <.icon name="hero-trash" class="size-4" />
gettext("Cannot delete - %{count} member(s) assigned", </button>
count: get_member_count(mft, @member_counts) </div>
), <button
else: gettext("Delete") :if={get_member_count(mft, @member_counts) == 0}
} phx-click="delete"
disabled={get_member_count(mft, @member_counts) > 0} phx-value-id={mft.id}
data-confirm={gettext("Are you sure?")}
class="btn btn-ghost btn-xs text-error"
aria-label={gettext("Delete membership fee type")}
> >
<.icon name="hero-trash" class="size-4" /> <.icon name="hero-trash" class="size-4" />
</button> </button>