Fix cycle action buttons layout and visibility

Arrange Paid/Suspended/Unpaid/Delete buttons side by side without wrapping.
Hide Suspend button when cycle is already suspended, matching behavior
of Paid and Unpaid buttons.
This commit is contained in:
Moritz 2025-12-18 14:17:03 +01:00
parent 39de5c9237
commit 50a8657718
Signed by: moritz
GPG key ID: 1020A035E5DD0824

View file

@ -122,7 +122,7 @@ defmodule MvWeb.MemberLive.Show.MembershipFeesComponent do
</:col> </:col>
<:action :let={cycle}> <:action :let={cycle}>
<div class="flex gap-1 flex-wrap"> <div class="flex gap-1">
<button <button
:if={cycle.status != :paid} :if={cycle.status != :paid}
type="button" type="button"
@ -137,15 +137,13 @@ defmodule MvWeb.MemberLive.Show.MembershipFeesComponent do
{gettext("Paid")} {gettext("Paid")}
</button> </button>
<button <button
:if={cycle.status != :suspended}
type="button" type="button"
phx-click="mark_cycle_status" phx-click="mark_cycle_status"
phx-value-cycle_id={cycle.id} phx-value-cycle_id={cycle.id}
phx-value-status="suspended" phx-value-status="suspended"
phx-target={@myself} phx-target={@myself}
class={[ class="btn btn-sm btn-outline btn-warning"
"btn btn-sm",
if(cycle.status == :suspended, do: "btn-warning", else: "btn-outline btn-warning")
]}
title={gettext("Mark as suspended")} title={gettext("Mark as suspended")}
> >
<.icon name="hero-pause-circle" class="size-4" /> <.icon name="hero-pause-circle" class="size-4" />