<%= if @has_email_code? do %>
<%= form_for @conn, "/activate", [class: "w-full max-w-lg mx-auto bg-white dark:bg-gray-800 shadow-md rounded px-8 py-6 mb-4 mt-8"], fn f -> %>
<%= if @has_any_memberships? do %>
Verify your email address
<% else %>
Activate your account
<% end %>
Please enter the 4-digit code we sent to <%= @conn.assigns[:current_user].email %>
<%= text_input(f, :code,
class:
"tracking-widest font-medium shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-36 px-8 border-gray-300 dark:border-gray-500 rounded-l-md dark:text-gray-200 dark:bg-gray-900",
oninput:
"this.value=this.value.replace(/[^0-9]/g, ''); if (this.value.length >= 4) document.getElementById('submit').focus()",
onclick: "this.select();",
maxlength: "4",
placeholder: "••••",
style: "letter-spacing: 10px;",
required: "required"
) %>
Activate →
<%= error_tag(assigns, :error) %>
Didn't receive an email?
- Check your spam folder
-
<%= link("Send a new code",
class: "underline text-indigo-600",
to: "/activate/request-code",
method: :post
) %> to <%= @conn.assigns[:current_user].email %>
<%= if full_build?() do %>
-
Contact us
if the problem persists
<% else %>
-
Ask on our <%= link("community-supported forum",
to: "https://github.com/plausible/analytics/discussions",
class: "text-indigo-600 underline"
) %>
<% end %>
Entered the wrong email address?
<%= if @has_any_memberships? do %>
-
<%= link("Change email back to",
class: "underline text-indigo-600",
to: "/settings/email/cancel",
method: "post"
) %> to <%= @conn.assigns[:current_user].previous_email %>
<% else %>
-
<%= link("Delete this account",
class: "underline text-indigo-600",
to: "/me?redirect=/register",
method: "delete",
data: [confirm: "Deleting your account cannot be reversed. Are you sure?"]
) %> and start over
<% end %>
<% end %>
<% else %>
Activate your account
A 4-digit activation code will be sent to <%= @conn.assigns[:current_user].email %>
<%= error_tag(assigns, :error) %>
<%= button("Request activation code",
to: "/activate/request-code",
method: :post,
class: "button mt-12"
) %>
<% end %>
<%= if !@has_any_invitations? and !@has_any_memberships? do %>
<%= render(PlausibleWeb.AuthView, "_onboarding_steps.html", current_step: 1) %>
<% end %>