Rename cycle button to Show Last/Current Cycle Payment Status

Update button text and styling to match PaymentFilterComponent.
Button now shows active state when filter is applied.
This commit is contained in:
Moritz 2025-12-18 13:10:49 +01:00
parent c65b3808bf
commit adb107e6a4
Signed by: moritz
GPG key ID: 1020A035E5DD0824
2 changed files with 8 additions and 10 deletions

View file

@ -47,18 +47,16 @@
type="button" type="button"
phx-click="toggle_cycle_view" phx-click="toggle_cycle_view"
class={[ class={[
"btn btn-sm", "btn btn-sm btn-outline gap-2",
if(@show_current_cycle, do: "btn-primary", else: "btn-outline") @cycle_status_filter && "btn-active"
]} ]}
aria-label={ aria-label={gettext("Show Last/Current Cycle Payment Status")}
if(@show_current_cycle, title={gettext("Show Last/Current Cycle Payment Status")}
do: gettext("Show last completed cycle"),
else: gettext("Show current cycle")
)
}
> >
<.icon name="hero-arrow-path" class="size-4" /> <.icon name="hero-arrow-path" class="size-4" />
{if(@show_current_cycle, do: gettext("Current Cycle"), else: gettext("Last Cycle"))} <span class="hidden sm:inline">
{gettext("Show Last/Current Cycle Payment Status")}
</span>
</button> </button>
</div> </div>
<.live_component <.live_component

View file

@ -362,7 +362,7 @@ defmodule MvWeb.MemberLive.Index.MembershipFeeStatusTest do
filtered = MembershipFeeStatus.filter_unpaid_members(members, false) filtered = MembershipFeeStatus.filter_unpaid_members(members, false)
# Both members have no cycles, so both should be filtered out # Both members have no cycles, so both should be filtered out
assert length(filtered) == 0 assert Enum.empty?(filtered)
end end
end end
end end