feat: rename OIDC strategy, fix sidebar, UI improvements closes #271 #444
1 changed files with 19 additions and 6 deletions
|
|
@ -218,39 +218,39 @@ defmodule MvWeb.MemberLive.Show.MembershipFeesComponent do
|
||||||
<%= if @can_update_cycle do %>
|
<%= if @can_update_cycle do %>
|
||||||
<div class="join">
|
<div class="join">
|
||||||
<button
|
<button
|
||||||
:if={cycle.status != :paid}
|
|
||||||
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="paid"
|
phx-value-status="paid"
|
||||||
phx-target={@myself}
|
phx-target={@myself}
|
||||||
class="join-item btn btn-sm btn-outline btn-success"
|
class={cycle_status_btn_class(cycle.status, :paid)}
|
||||||
|
disabled={cycle.status == :paid}
|
||||||
title={gettext("Mark as paid")}
|
title={gettext("Mark as paid")}
|
||||||
>
|
>
|
||||||
<.icon name="hero-check-circle" class="size-4" />
|
<.icon name="hero-check-circle" class="size-4" />
|
||||||
{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="join-item btn btn-sm btn-outline btn-warning"
|
class={cycle_status_btn_class(cycle.status, :suspended)}
|
||||||
|
disabled={cycle.status == :suspended}
|
||||||
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" />
|
||||||
{gettext("Suspended")}
|
{gettext("Suspended")}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
:if={cycle.status != :unpaid}
|
|
||||||
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="unpaid"
|
phx-value-status="unpaid"
|
||||||
phx-target={@myself}
|
phx-target={@myself}
|
||||||
class="join-item btn btn-sm btn-outline btn-error"
|
class={cycle_status_btn_class(cycle.status, :unpaid)}
|
||||||
|
disabled={cycle.status == :unpaid}
|
||||||
title={gettext("Mark as unpaid")}
|
title={gettext("Mark as unpaid")}
|
||||||
>
|
>
|
||||||
<.icon name="hero-x-circle" class="size-4" />
|
<.icon name="hero-x-circle" class="size-4" />
|
||||||
|
|
@ -1221,6 +1221,19 @@ defmodule MvWeb.MemberLive.Show.MembershipFeesComponent do
|
||||||
defp translate_receipt_type("income"), do: gettext("Income")
|
defp translate_receipt_type("income"), do: gettext("Income")
|
||||||
defp translate_receipt_type(other), do: other
|
defp translate_receipt_type(other), do: other
|
||||||
|
|
||||||
|
# Returns CSS classes for a cycle status button.
|
||||||
|
# Active (current) status is highlighted with color; others are neutral gray.
|
||||||
|
defp cycle_status_btn_class(current_status, btn_status) do
|
||||||
|
base = "join-item btn btn-sm"
|
||||||
|
|
||||||
|
case {current_status == btn_status, btn_status} do
|
||||||
|
{true, :paid} -> "#{base} btn-success btn-active"
|
||||||
|
{true, :suspended} -> "#{base} btn-warning btn-active"
|
||||||
|
{true, :unpaid} -> "#{base} btn-error btn-active"
|
||||||
|
_ -> base
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Helper component for section box
|
# Helper component for section box
|
||||||
attr :title, :string, required: true
|
attr :title, :string, required: true
|
||||||
slot :inner_block, required: true
|
slot :inner_block, required: true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue