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