fix: translation of login page
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
086ecdcb1b
commit
99a8d64344
18 changed files with 487 additions and 200 deletions
|
|
@ -33,91 +33,97 @@ defmodule MvWeb.JoinLive do
|
|||
@impl true
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<Layouts.app flash={@flash} current_user={@current_user}>
|
||||
<div class="max-w-xl mx-auto mt-8 space-y-6">
|
||||
<.header>
|
||||
{gettext("Become a member")}
|
||||
</.header>
|
||||
<Layouts.public_page flash={@flash}>
|
||||
<div class="max-w-4xl mx-auto">
|
||||
<div class="hero min-h-[60vh] bg-base-200 rounded-lg">
|
||||
<div class="hero-content flex-col items-start text-left">
|
||||
<div class="max-w-xl w-full space-y-6">
|
||||
<.header>
|
||||
{gettext("Become a member")}
|
||||
</.header>
|
||||
|
||||
<p class="text-base-content/80">
|
||||
{gettext("Please enter your details for the membership application here.")}
|
||||
</p>
|
||||
<p class="text-base-content/80">
|
||||
{gettext("Please enter your details for the membership application here.")}
|
||||
</p>
|
||||
|
||||
<%= if @submitted do %>
|
||||
<div data-testid="join-success-message" class="alert alert-success">
|
||||
<p class="font-medium">
|
||||
{gettext(
|
||||
"We have saved your details. To complete your request, please click the link we sent to your email."
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<% else %>
|
||||
<.form
|
||||
for={@form}
|
||||
id="join-form"
|
||||
phx-submit="submit"
|
||||
class="space-y-4"
|
||||
>
|
||||
<%= if @rate_limit_error do %>
|
||||
<div class="alert alert-error">
|
||||
{@rate_limit_error}
|
||||
</div>
|
||||
<% end %>
|
||||
<%= if @submitted do %>
|
||||
<div data-testid="join-success-message" class="alert alert-success">
|
||||
<p class="font-medium">
|
||||
{gettext(
|
||||
"We have saved your details. To complete your request, please click the link we sent to your email."
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<% else %>
|
||||
<.form
|
||||
for={@form}
|
||||
id="join-form"
|
||||
phx-submit="submit"
|
||||
class="space-y-4"
|
||||
>
|
||||
<%= if @rate_limit_error do %>
|
||||
<div class="alert alert-error">
|
||||
{@rate_limit_error}
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= for field <- @join_fields do %>
|
||||
<div>
|
||||
<label for={"join-field-#{field.id}"} class="label">
|
||||
<span class="label-text">{field.label}{if field.required, do: " *"}</span>
|
||||
</label>
|
||||
<input
|
||||
type={input_type(field.id)}
|
||||
name={field.id}
|
||||
id={"join-field-#{field.id}"}
|
||||
value={@form.params[field.id]}
|
||||
required={field.required}
|
||||
class="input input-bordered w-full"
|
||||
/>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= for field <- @join_fields do %>
|
||||
<div>
|
||||
<label for={"join-field-#{field.id}"} class="label">
|
||||
<span class="label-text">{field.label}{if field.required, do: " *"}</span>
|
||||
</label>
|
||||
<input
|
||||
type={input_type(field.id)}
|
||||
name={field.id}
|
||||
id={"join-field-#{field.id}"}
|
||||
value={@form.params[field.id]}
|
||||
required={field.required}
|
||||
class="input input-bordered w-full"
|
||||
/>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%!--
|
||||
<%!--
|
||||
Honeypot (best practice): legit field name "website", type="text", no inline CSS,
|
||||
hidden via class in app.css (off-screen + 1px). tabindex=-1, autocomplete=off,
|
||||
aria-hidden so screen readers skip. If filled → silent failure (same success UI).
|
||||
--%>
|
||||
<div class="join-form-helper" aria-hidden="true">
|
||||
<label for="join-website" class="sr-only">{gettext("Website")}</label>
|
||||
<input
|
||||
type="text"
|
||||
name={@honeypot_field}
|
||||
id="join-website"
|
||||
tabindex="-1"
|
||||
autocomplete="off"
|
||||
class="join-form-helper-input"
|
||||
/>
|
||||
<div class="join-form-helper" aria-hidden="true">
|
||||
<label for="join-website" class="sr-only">{gettext("Website")}</label>
|
||||
<input
|
||||
type="text"
|
||||
name={@honeypot_field}
|
||||
id="join-website"
|
||||
tabindex="-1"
|
||||
autocomplete="off"
|
||||
class="join-form-helper-input"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<p class="text-sm text-base-content/70">
|
||||
{gettext(
|
||||
"By submitting your application you will receive an email with a confirmation link. Once you have confirmed your email address, your application will be reviewed."
|
||||
)}
|
||||
</p>
|
||||
|
||||
<p class="text-xs text-base-content/60">
|
||||
{gettext(
|
||||
"Your details are only used to process your membership application and to contact you. To prevent abuse we also process technical data (e.g. IP address) only as necessary."
|
||||
)}
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{gettext("Submit request")}
|
||||
</button>
|
||||
</div>
|
||||
</.form>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<p class="text-sm text-base-content/70">
|
||||
{gettext(
|
||||
"By submitting your application you will receive an email with a confirmation link. Once you have confirmed your email address, your application will be reviewed."
|
||||
)}
|
||||
</p>
|
||||
|
||||
<p class="text-xs text-base-content/60">
|
||||
{gettext(
|
||||
"Your details are only used to process your membership application and to contact you. To prevent abuse we also process technical data (e.g. IP address) only as necessary."
|
||||
)}
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{gettext("Submit request")}
|
||||
</button>
|
||||
</div>
|
||||
</.form>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Layouts.app>
|
||||
</Layouts.public_page>
|
||||
"""
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue