mirror of
https://github.com/plausible/analytics.git
synced 2024-12-21 00:21:43 +03:00
aa7ae87811
* WIP * Actually activate the user * Send email verification codes * Send activation code with email * Only show onboarding steps during first site creation * Add worker to config * Consistent form styles * Send welcome email when user activates account * Add changelog entry * Use https in new site form * Correct spelling in email
18 lines
456 B
Elixir
18 lines
456 B
Elixir
defmodule PlausibleWeb.ErrorHelpers do
|
|
use Phoenix.HTML
|
|
|
|
def error_tag(%Phoenix.HTML.Form{} = form, field) do
|
|
Enum.map(Keyword.get_values(form.errors, field), fn error ->
|
|
content_tag(:div, elem(error, 0), class: "mt-2 text-sm text-red-600")
|
|
end)
|
|
end
|
|
|
|
def error_tag(assigns, field) when is_map(assigns) do
|
|
error = assigns[field]
|
|
|
|
if error do
|
|
content_tag(:div, error, class: "mt-2 text-sm text-red-600")
|
|
end
|
|
end
|
|
end
|