From a67a91cffa336ef98b9cfcbdc492b6a962b769de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Eppl=C3=A9e?= Date: Tue, 2 Dec 2025 09:56:54 +0100 Subject: [PATCH] Mark required fields in UI --- lib/mv_web/components/core_components.ex | 72 ++++++++++++++++-------- lib/mv_web/live/member_live/form.ex | 2 +- priv/gettext/de/LC_MESSAGES/default.po | 54 ++++++++++-------- priv/gettext/default.pot | 54 ++++++++++-------- priv/gettext/en/LC_MESSAGES/default.po | 54 ++++++++++-------- 5 files changed, 142 insertions(+), 94 deletions(-) diff --git a/lib/mv_web/components/core_components.ex b/lib/mv_web/components/core_components.ex index ae50ecb..54a5a64 100644 --- a/lib/mv_web/components/core_components.ex +++ b/lib/mv_web/components/core_components.ex @@ -60,27 +60,29 @@ defmodule MvWeb.CoreComponents do id={@id} phx-click={JS.push("lv:clear-flash", value: %{key: @kind}) |> hide("##{@id}")} role="alert" - class={[ + class="z-50 toast toast-top toast-end" + {@rest} + > +
- <.icon :if={@kind == :info} name="hero-information-circle" class="size-5 shrink-0" /> - <.icon :if={@kind == :error} name="hero-exclamation-circle" class="size-5 shrink-0" /> - <.icon :if={@kind == :success} name="hero-check-circle" class="size-5 shrink-0" /> - <.icon :if={@kind == :warning} name="hero-information-circle" class="size-5 shrink-0" /> -
-

{@title}

-

{msg}

+ ]}> + <.icon :if={@kind == :info} name="hero-information-circle" class="size-5 shrink-0" /> + <.icon :if={@kind == :error} name="hero-exclamation-circle" class="size-5 shrink-0" /> + <.icon :if={@kind == :success} name="hero-check-circle" class="size-5 shrink-0" /> + <.icon :if={@kind == :warning} name="hero-information-circle" class="size-5 shrink-0" /> +
+

{@title}

+

{msg}

+
+
+
-
-
""" end @@ -186,7 +188,7 @@ defmodule MvWeb.CoreComponents do end) ~H""" -
+
<.error :for={msg <- @errors}>{msg} @@ -208,9 +214,15 @@ defmodule MvWeb.CoreComponents do def input(%{type: "select"} = assigns) do ~H""" -
+