- <%= get_flash(@conn, :info) %> -
- <% end %> - <%= if get_flash(@conn, :error) do %> -- <%= get_flash(@conn, :error) %> -
- <% end %> + <.topbar current_user={assigns[:current_user]}> + ++ <%= get_flash(@conn, :info) %> +
+ <% end %> + <%= if get_flash(@conn, :error) do %> ++ <%= get_flash(@conn, :error) %> +
+ <% end %> +- <%= live_flash(@flash, :info) %> -
- <% end %> - <%= if @flash && @flash |> Map.has_key?(:error) do %> -- <%= live_flash(@flash, :error) %> -
- <% end %> + <.topbar current_user={assigns[:current_user]}> + ++ <%= live_flash(@flash, "info") %> +
+ <% end %> + + <%= if @flash && @flash |> Map.has_key?("error") do %> ++ <%= live_flash(@flash, "error") %> +
+ <% end %> ++ <%= gettext("Loading...") %> +
+ + ++ <%= gettext("Reconnecting...") %> +
+ + +
- Resend confirmation instructions
+
+
+ <%= dgettext("actions", "Resend confirmation instructions") %>
+
<%= form_for :user,
Routes.user_confirmation_path(@conn, :create),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= submit("Resend confirmation instructions", class: "btn btn-primary") %>
-
-
- <%= link("Register",
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link("Log in",
- to: Routes.user_session_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
+
+ <%= submit(dgettext("actions", "Resend confirmation instructions"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
+ <% end %>
+
+
+
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
<% end %>
+ <%= link(dgettext("actions", "Log in"),
+ to: Routes.user_session_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/lokal_web/templates/user_registration/new.html.heex b/lib/lokal_web/templates/user_registration/new.html.heex
index 71f4aaf..ddc9cb8 100644
--- a/lib/lokal_web/templates/user_registration/new.html.heex
+++ b/lib/lokal_web/templates/user_registration/new.html.heex
@@ -1,37 +1,48 @@
-
-
- Register
+
+
+ <%= dgettext("actions", "Register") %>
+
<%= form_for @changeset,
Routes.user_registration_path(@conn, :create),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
<%= if @changeset.action && not @changeset.valid? do %>
-
- Oops, something went wrong! Please check the errors below.
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :email) %>
-
- <%= label(f, :password, class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :password) %>
- <%= submit("Register", class: "btn btn-primary") %>
-
-
- <%= link("Log in",
- to: Routes.user_session_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link("Forgot your password?",
- to: Routes.user_reset_password_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+
+ <%= if @invite do %>
+ <%= hidden_input(f, :invite_token, value: @invite.token) %>
<% end %>
+
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
+ <%= error_tag(f, :email, "col-span-3") %>
+
+ <%= label(f, :password, class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
+ <%= error_tag(f, :password, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Register"), class: "mx-auto btn btn-primary col-span-3") %>
+ <% end %>
+
+
+
+
+ <%= link(dgettext("actions", "Log in"),
+ to: Routes.user_session_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+ <%= link(dgettext("actions", "Forgot your password?"),
+ to: Routes.user_reset_password_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/lokal_web/templates/user_reset_password/edit.html.heex b/lib/lokal_web/templates/user_reset_password/edit.html.heex
index cbe8d91..8e56648 100644
--- a/lib/lokal_web/templates/user_reset_password/edit.html.heex
+++ b/lib/lokal_web/templates/user_reset_password/edit.html.heex
@@ -1,37 +1,53 @@
-
-
- Reset password
+
+
+ <%= dgettext("actions", "Reset password") %>
+
<%= form_for @changeset,
Routes.user_reset_password_path(@conn, :update, @token),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
<%= if @changeset.action && not @changeset.valid? do %>
-
- Oops, something went wrong! Please check the errors below.
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
-
- <%= label(f, :password, "New password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :password) %>
-
- <%= label(f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password_confirmation, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :password_confirmation) %>
- <%= submit("Reset password", class: "btn btn-primary") %>
-
-
- <%= link("Register",
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link("Log in",
- to: Routes.user_session_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+
+ <%= label(f, :password, "New password", class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
+ <%= error_tag(f, :password, "col-span-3") %>
+
+ <%= label(f, :password_confirmation, "Confirm new password",
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :password_confirmation,
+ required: true,
+ class: "input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password_confirmation, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Reset password"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
+ <% end %>
+
+
+
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
<% end %>
+ <%= link(dgettext("actions", "Log in"),
+ to: Routes.user_session_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/lokal_web/templates/user_reset_password/new.html.heex b/lib/lokal_web/templates/user_reset_password/new.html.heex
index a82c7d5..aae2fa4 100644
--- a/lib/lokal_web/templates/user_reset_password/new.html.heex
+++ b/lib/lokal_web/templates/user_reset_password/new.html.heex
@@ -1,26 +1,35 @@
-
-
- Forgot your password?
+
+
+ <%= dgettext("actions", "Forgot your password?") %>
+
<%= form_for :user,
Routes.user_reset_password_path(@conn, :create),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= submit("Send instructions to reset password", class: "btn btn-primary") %>
-
-
- <%= link("Register",
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link("Log in",
- to: Routes.user_session_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
+
+ <%= submit(dgettext("actions", "Send instructions to reset password"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
+ <% end %>
+
+
+
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
<% end %>
+ <%= link(dgettext("actions", "Log in"),
+ to: Routes.user_session_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/lokal_web/templates/user_session/new.html.heex b/lib/lokal_web/templates/user_session/new.html.heex
index 6edc948..15c77cd 100644
--- a/lib/lokal_web/templates/user_session/new.html.heex
+++ b/lib/lokal_web/templates/user_session/new.html.heex
@@ -1,41 +1,50 @@
-
-
- Log in
+
+
+ <%= dgettext("actions", "Log in") %>
+
<%= form_for @conn,
Routes.user_session_path(@conn, :create),
- [as: :user, class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ as: :user,
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
<%= if @error_message do %>
-
+
<%= @error_message %>
<% end %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
-
- <%= label(f, :password, class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
-
-
- <%= label(f, :remember_me, "Keep me logged in for 60 days", class: "title text-lg text-primary-500") %>
- <%= checkbox(f, :remember_me, class: "checkbox") %>
-
- <%= submit("Log in", class: "btn btn-primary") %>
-
-
- <%= link("Register",
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link("Forgot your password?",
- to: Routes.user_reset_password_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
+
+ <%= label(f, :password, class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
+
+ <%= label(f, :remember_me, gettext("Keep me logged in for 60 days"),
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= checkbox(f, :remember_me, class: "checkbox col-span-2") %>
+
+ <%= submit(dgettext("actions", "Log in"), class: "mx-auto btn btn-primary col-span-3") %>
+ <% end %>
+
+
+
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
<% end %>
+ <%= link(dgettext("actions", "Forgot your password?"),
+ to: Routes.user_reset_password_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/lokal_web/templates/user_settings/edit.html.heex b/lib/lokal_web/templates/user_settings/edit.html.heex
index 6bd12cb..c0f500d 100644
--- a/lib/lokal_web/templates/user_settings/edit.html.heex
+++ b/lib/lokal_web/templates/user_settings/edit.html.heex
@@ -1,82 +1,114 @@
-
-
- Settings
+
+
+ <%= gettext("Settings") %>
-
- Change email
-
+
+
+
<%= form_for @email_changeset,
Routes.user_settings_path(@conn, :update),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
- <%= if @email_changeset.action do %>
-
- Oops, something went wrong! Please check the errors below.
+
+ <%= dgettext("actions", "Change email") %>
+
+
+ <%= if @email_changeset.action && not @email_changeset.valid? do %>
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
+
<%= hidden_input(f, :action, name: "action", value: "update_email") %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :email) %>
-
- <%= label(f, :current_password,
- for: "current_password_for_email",
- class: "title text-lg text-primary-500"
- ) %>
- <%= password_input(f, :current_password,
- required: true,
- name: "current_password",
- id: "current_password_for_email",
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :current_password) %>
- <%= submit("Change email", class: "btn btn-primary") %>
+
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "mx-2 my-1 input input-primary col-span-2") %>
+ <%= error_tag(f, :email, "col-span-3") %>
+
+ <%= label(f, :current_password, gettext("Current password"),
+ for: "current_password_for_email",
+ class: "mx-2 my-1 title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :current_password,
+ required: true,
+ name: "current_password",
+ id: "current_password_for_email",
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :current_password, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Change email"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
<% end %>
-
- Change password
-
+
+
+
<%= form_for @password_changeset,
Routes.user_settings_path(@conn, :update),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
- <%= if @password_changeset.action do %>
-
- Oops, something went wrong! Please check the errors below.
+
+ <%= dgettext("actions", "Change password") %>
+
+
+ <%= if @password_changeset.action && not @password_changeset.valid? do %>
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
+
<%= hidden_input(f, :action, name: "action", value: "update_password") %>
-
- <%= label(f, :password, "New password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password,
- required: true,
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :password) %>
-
- <%= label(f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password_confirmation,
- required: true,
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :password_confirmation) %>
-
- <%= label(f, :current_password,
- for: "current_password_for_password",
- class: "title text-lg text-primary-500"
- ) %>
- <%= password_input(f, :current_password,
- required: true,
- name: "current_password",
- id: "current_password_for_password",
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :current_password) %>
- <%= submit("Change password", class: "btn btn-primary") %>
+
+ <%= label(f, :password, gettext("New password"), class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password,
+ required: true,
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password, "col-span-3") %>
+
+ <%= label(f, :password_confirmation, gettext("Confirm new password"),
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :password_confirmation,
+ required: true,
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password_confirmation, "col-span-3") %>
+
+ <%= label(f, :current_password, gettext("Current password"),
+ for: "current_password_for_password",
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :current_password,
+ required: true,
+ name: "current_password",
+ id: "current_password_for_password",
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :current_password, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Change password"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
<% end %>
+
+
+
+ <%= link(dgettext("actions", "Delete User"),
+ to: Routes.user_settings_path(@conn, :delete, @current_user),
+ method: :delete,
+ class: "btn btn-alert",
+ data: [confirm: dgettext("prompts", "Are you sure you want to delete your account?")]
+ ) %>
diff --git a/lib/lokal_web/views/layout_view.ex b/lib/lokal_web/views/layout_view.ex
index 820c730..3f82f70 100644
--- a/lib/lokal_web/views/layout_view.ex
+++ b/lib/lokal_web/views/layout_view.ex
@@ -1,6 +1,7 @@
defmodule LokalWeb.LayoutView do
use LokalWeb, :view
import LokalWeb.Components.Topbar
+ alias LokalWeb.{Endpoint, PageLive}
# Phoenix LiveDashboard is available only in development by default,
# so we instruct Elixir to not warn if the dashboard route is missing.
+ <%= dgettext("actions", "Resend confirmation instructions") %>
+ <%= form_for :user, Routes.user_confirmation_path(@conn, :create), - [class: "flex flex-col justify-center items-center space-y-4"], + [ + class: + "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" + ], fn f -> %> --
+ +
- Register
+
+
+ <%= dgettext("actions", "Register") %>
+
<%= form_for @changeset,
Routes.user_registration_path(@conn, :create),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
<%= if @changeset.action && not @changeset.valid? do %>
-
- Oops, something went wrong! Please check the errors below.
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :email) %>
-
- <%= label(f, :password, class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :password) %>
- <%= submit("Register", class: "btn btn-primary") %>
-
-
- <%= link("Log in",
- to: Routes.user_session_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link("Forgot your password?",
- to: Routes.user_reset_password_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+
+ <%= if @invite do %>
+ <%= hidden_input(f, :invite_token, value: @invite.token) %>
<% end %>
+
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
+ <%= error_tag(f, :email, "col-span-3") %>
+
+ <%= label(f, :password, class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
+ <%= error_tag(f, :password, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Register"), class: "mx-auto btn btn-primary col-span-3") %>
+ <% end %>
+
+
+
+
+ <%= link(dgettext("actions", "Log in"),
+ to: Routes.user_session_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+ <%= link(dgettext("actions", "Forgot your password?"),
+ to: Routes.user_reset_password_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/lokal_web/templates/user_reset_password/edit.html.heex b/lib/lokal_web/templates/user_reset_password/edit.html.heex
index cbe8d91..8e56648 100644
--- a/lib/lokal_web/templates/user_reset_password/edit.html.heex
+++ b/lib/lokal_web/templates/user_reset_password/edit.html.heex
@@ -1,37 +1,53 @@
-
-
- Reset password
+
+
+ <%= dgettext("actions", "Reset password") %>
+
<%= form_for @changeset,
Routes.user_reset_password_path(@conn, :update, @token),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
<%= if @changeset.action && not @changeset.valid? do %>
-
- Oops, something went wrong! Please check the errors below.
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
-
- <%= label(f, :password, "New password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :password) %>
-
- <%= label(f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password_confirmation, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :password_confirmation) %>
- <%= submit("Reset password", class: "btn btn-primary") %>
-
-
- <%= link("Register",
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link("Log in",
- to: Routes.user_session_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+
+ <%= label(f, :password, "New password", class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
+ <%= error_tag(f, :password, "col-span-3") %>
+
+ <%= label(f, :password_confirmation, "Confirm new password",
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :password_confirmation,
+ required: true,
+ class: "input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password_confirmation, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Reset password"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
+ <% end %>
+
+
+
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
<% end %>
+ <%= link(dgettext("actions", "Log in"),
+ to: Routes.user_session_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/lokal_web/templates/user_reset_password/new.html.heex b/lib/lokal_web/templates/user_reset_password/new.html.heex
index a82c7d5..aae2fa4 100644
--- a/lib/lokal_web/templates/user_reset_password/new.html.heex
+++ b/lib/lokal_web/templates/user_reset_password/new.html.heex
@@ -1,26 +1,35 @@
-
-
- Forgot your password?
+
+
+ <%= dgettext("actions", "Forgot your password?") %>
+
<%= form_for :user,
Routes.user_reset_password_path(@conn, :create),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= submit("Send instructions to reset password", class: "btn btn-primary") %>
-
-
- <%= link("Register",
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link("Log in",
- to: Routes.user_session_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
+
+ <%= submit(dgettext("actions", "Send instructions to reset password"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
+ <% end %>
+
+
+
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
<% end %>
+ <%= link(dgettext("actions", "Log in"),
+ to: Routes.user_session_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/lokal_web/templates/user_session/new.html.heex b/lib/lokal_web/templates/user_session/new.html.heex
index 6edc948..15c77cd 100644
--- a/lib/lokal_web/templates/user_session/new.html.heex
+++ b/lib/lokal_web/templates/user_session/new.html.heex
@@ -1,41 +1,50 @@
-
-
- Log in
+
+
+ <%= dgettext("actions", "Log in") %>
+
<%= form_for @conn,
Routes.user_session_path(@conn, :create),
- [as: :user, class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ as: :user,
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
<%= if @error_message do %>
-
+
<%= @error_message %>
<% end %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
-
- <%= label(f, :password, class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
-
-
- <%= label(f, :remember_me, "Keep me logged in for 60 days", class: "title text-lg text-primary-500") %>
- <%= checkbox(f, :remember_me, class: "checkbox") %>
-
- <%= submit("Log in", class: "btn btn-primary") %>
-
-
- <%= link("Register",
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link("Forgot your password?",
- to: Routes.user_reset_password_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
+
+ <%= label(f, :password, class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
+
+ <%= label(f, :remember_me, gettext("Keep me logged in for 60 days"),
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= checkbox(f, :remember_me, class: "checkbox col-span-2") %>
+
+ <%= submit(dgettext("actions", "Log in"), class: "mx-auto btn btn-primary col-span-3") %>
+ <% end %>
+
+
+
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
<% end %>
+ <%= link(dgettext("actions", "Forgot your password?"),
+ to: Routes.user_reset_password_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/lokal_web/templates/user_settings/edit.html.heex b/lib/lokal_web/templates/user_settings/edit.html.heex
index 6bd12cb..c0f500d 100644
--- a/lib/lokal_web/templates/user_settings/edit.html.heex
+++ b/lib/lokal_web/templates/user_settings/edit.html.heex
@@ -1,82 +1,114 @@
-
-
- Settings
+
+
+ <%= gettext("Settings") %>
-
- Change email
-
+
+
+
<%= form_for @email_changeset,
Routes.user_settings_path(@conn, :update),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
- <%= if @email_changeset.action do %>
-
- Oops, something went wrong! Please check the errors below.
+
+ <%= dgettext("actions", "Change email") %>
+
+
+ <%= if @email_changeset.action && not @email_changeset.valid? do %>
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
+
<%= hidden_input(f, :action, name: "action", value: "update_email") %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :email) %>
-
- <%= label(f, :current_password,
- for: "current_password_for_email",
- class: "title text-lg text-primary-500"
- ) %>
- <%= password_input(f, :current_password,
- required: true,
- name: "current_password",
- id: "current_password_for_email",
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :current_password) %>
- <%= submit("Change email", class: "btn btn-primary") %>
+
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "mx-2 my-1 input input-primary col-span-2") %>
+ <%= error_tag(f, :email, "col-span-3") %>
+
+ <%= label(f, :current_password, gettext("Current password"),
+ for: "current_password_for_email",
+ class: "mx-2 my-1 title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :current_password,
+ required: true,
+ name: "current_password",
+ id: "current_password_for_email",
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :current_password, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Change email"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
<% end %>
-
- Change password
-
+
+
+
<%= form_for @password_changeset,
Routes.user_settings_path(@conn, :update),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
- <%= if @password_changeset.action do %>
-
- Oops, something went wrong! Please check the errors below.
+
+ <%= dgettext("actions", "Change password") %>
+
+
+ <%= if @password_changeset.action && not @password_changeset.valid? do %>
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
+
<%= hidden_input(f, :action, name: "action", value: "update_password") %>
-
- <%= label(f, :password, "New password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password,
- required: true,
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :password) %>
-
- <%= label(f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password_confirmation,
- required: true,
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :password_confirmation) %>
-
- <%= label(f, :current_password,
- for: "current_password_for_password",
- class: "title text-lg text-primary-500"
- ) %>
- <%= password_input(f, :current_password,
- required: true,
- name: "current_password",
- id: "current_password_for_password",
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :current_password) %>
- <%= submit("Change password", class: "btn btn-primary") %>
+
+ <%= label(f, :password, gettext("New password"), class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password,
+ required: true,
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password, "col-span-3") %>
+
+ <%= label(f, :password_confirmation, gettext("Confirm new password"),
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :password_confirmation,
+ required: true,
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password_confirmation, "col-span-3") %>
+
+ <%= label(f, :current_password, gettext("Current password"),
+ for: "current_password_for_password",
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :current_password,
+ required: true,
+ name: "current_password",
+ id: "current_password_for_password",
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :current_password, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Change password"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
<% end %>
+
+
+
+ <%= link(dgettext("actions", "Delete User"),
+ to: Routes.user_settings_path(@conn, :delete, @current_user),
+ method: :delete,
+ class: "btn btn-alert",
+ data: [confirm: dgettext("prompts", "Are you sure you want to delete your account?")]
+ ) %>
diff --git a/lib/lokal_web/views/layout_view.ex b/lib/lokal_web/views/layout_view.ex
index 820c730..3f82f70 100644
--- a/lib/lokal_web/views/layout_view.ex
+++ b/lib/lokal_web/views/layout_view.ex
@@ -1,6 +1,7 @@
defmodule LokalWeb.LayoutView do
use LokalWeb, :view
import LokalWeb.Components.Topbar
+ alias LokalWeb.{Endpoint, PageLive}
# Phoenix LiveDashboard is available only in development by default,
# so we instruct Elixir to not warn if the dashboard route is missing.
+ <%= dgettext("actions", "Register") %>
+ <%= form_for @changeset, Routes.user_registration_path(@conn, :create), - [class: "flex flex-col justify-center items-center space-y-4"], + [ + class: + "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" + ], fn f -> %> <%= if @changeset.action && not @changeset.valid? do %> -Oops, something went wrong! Please check the errors below.
++ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %> +
-
+ +
- Reset password
+
+
+ <%= dgettext("actions", "Reset password") %>
+
<%= form_for @changeset,
Routes.user_reset_password_path(@conn, :update, @token),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
<%= if @changeset.action && not @changeset.valid? do %>
-
- Oops, something went wrong! Please check the errors below.
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
-
- <%= label(f, :password, "New password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :password) %>
-
- <%= label(f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password_confirmation, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :password_confirmation) %>
- <%= submit("Reset password", class: "btn btn-primary") %>
-
-
- <%= link("Register",
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link("Log in",
- to: Routes.user_session_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+
+ <%= label(f, :password, "New password", class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
+ <%= error_tag(f, :password, "col-span-3") %>
+
+ <%= label(f, :password_confirmation, "Confirm new password",
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :password_confirmation,
+ required: true,
+ class: "input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password_confirmation, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Reset password"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
+ <% end %>
+
+
+
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
<% end %>
+ <%= link(dgettext("actions", "Log in"),
+ to: Routes.user_session_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/lokal_web/templates/user_reset_password/new.html.heex b/lib/lokal_web/templates/user_reset_password/new.html.heex
index a82c7d5..aae2fa4 100644
--- a/lib/lokal_web/templates/user_reset_password/new.html.heex
+++ b/lib/lokal_web/templates/user_reset_password/new.html.heex
@@ -1,26 +1,35 @@
-
-
- Forgot your password?
+
+
+ <%= dgettext("actions", "Forgot your password?") %>
+
<%= form_for :user,
Routes.user_reset_password_path(@conn, :create),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= submit("Send instructions to reset password", class: "btn btn-primary") %>
-
-
- <%= link("Register",
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link("Log in",
- to: Routes.user_session_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
+
+ <%= submit(dgettext("actions", "Send instructions to reset password"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
+ <% end %>
+
+
+
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
<% end %>
+ <%= link(dgettext("actions", "Log in"),
+ to: Routes.user_session_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/lokal_web/templates/user_session/new.html.heex b/lib/lokal_web/templates/user_session/new.html.heex
index 6edc948..15c77cd 100644
--- a/lib/lokal_web/templates/user_session/new.html.heex
+++ b/lib/lokal_web/templates/user_session/new.html.heex
@@ -1,41 +1,50 @@
-
-
- Log in
+
+
+ <%= dgettext("actions", "Log in") %>
+
<%= form_for @conn,
Routes.user_session_path(@conn, :create),
- [as: :user, class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ as: :user,
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
<%= if @error_message do %>
-
+
<%= @error_message %>
<% end %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
-
- <%= label(f, :password, class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
-
-
- <%= label(f, :remember_me, "Keep me logged in for 60 days", class: "title text-lg text-primary-500") %>
- <%= checkbox(f, :remember_me, class: "checkbox") %>
-
- <%= submit("Log in", class: "btn btn-primary") %>
-
-
- <%= link("Register",
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link("Forgot your password?",
- to: Routes.user_reset_password_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
+
+ <%= label(f, :password, class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
+
+ <%= label(f, :remember_me, gettext("Keep me logged in for 60 days"),
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= checkbox(f, :remember_me, class: "checkbox col-span-2") %>
+
+ <%= submit(dgettext("actions", "Log in"), class: "mx-auto btn btn-primary col-span-3") %>
+ <% end %>
+
+
+
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
<% end %>
+ <%= link(dgettext("actions", "Forgot your password?"),
+ to: Routes.user_reset_password_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/lokal_web/templates/user_settings/edit.html.heex b/lib/lokal_web/templates/user_settings/edit.html.heex
index 6bd12cb..c0f500d 100644
--- a/lib/lokal_web/templates/user_settings/edit.html.heex
+++ b/lib/lokal_web/templates/user_settings/edit.html.heex
@@ -1,82 +1,114 @@
-
-
- Settings
+
+
+ <%= gettext("Settings") %>
-
- Change email
-
+
+
+
<%= form_for @email_changeset,
Routes.user_settings_path(@conn, :update),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
- <%= if @email_changeset.action do %>
-
- Oops, something went wrong! Please check the errors below.
+
+ <%= dgettext("actions", "Change email") %>
+
+
+ <%= if @email_changeset.action && not @email_changeset.valid? do %>
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
+
<%= hidden_input(f, :action, name: "action", value: "update_email") %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :email) %>
-
- <%= label(f, :current_password,
- for: "current_password_for_email",
- class: "title text-lg text-primary-500"
- ) %>
- <%= password_input(f, :current_password,
- required: true,
- name: "current_password",
- id: "current_password_for_email",
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :current_password) %>
- <%= submit("Change email", class: "btn btn-primary") %>
+
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "mx-2 my-1 input input-primary col-span-2") %>
+ <%= error_tag(f, :email, "col-span-3") %>
+
+ <%= label(f, :current_password, gettext("Current password"),
+ for: "current_password_for_email",
+ class: "mx-2 my-1 title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :current_password,
+ required: true,
+ name: "current_password",
+ id: "current_password_for_email",
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :current_password, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Change email"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
<% end %>
-
- Change password
-
+
+
+
<%= form_for @password_changeset,
Routes.user_settings_path(@conn, :update),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
- <%= if @password_changeset.action do %>
-
- Oops, something went wrong! Please check the errors below.
+
+ <%= dgettext("actions", "Change password") %>
+
+
+ <%= if @password_changeset.action && not @password_changeset.valid? do %>
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
+
<%= hidden_input(f, :action, name: "action", value: "update_password") %>
-
- <%= label(f, :password, "New password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password,
- required: true,
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :password) %>
-
- <%= label(f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password_confirmation,
- required: true,
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :password_confirmation) %>
-
- <%= label(f, :current_password,
- for: "current_password_for_password",
- class: "title text-lg text-primary-500"
- ) %>
- <%= password_input(f, :current_password,
- required: true,
- name: "current_password",
- id: "current_password_for_password",
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :current_password) %>
- <%= submit("Change password", class: "btn btn-primary") %>
+
+ <%= label(f, :password, gettext("New password"), class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password,
+ required: true,
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password, "col-span-3") %>
+
+ <%= label(f, :password_confirmation, gettext("Confirm new password"),
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :password_confirmation,
+ required: true,
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password_confirmation, "col-span-3") %>
+
+ <%= label(f, :current_password, gettext("Current password"),
+ for: "current_password_for_password",
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :current_password,
+ required: true,
+ name: "current_password",
+ id: "current_password_for_password",
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :current_password, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Change password"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
<% end %>
+
+
+
+ <%= link(dgettext("actions", "Delete User"),
+ to: Routes.user_settings_path(@conn, :delete, @current_user),
+ method: :delete,
+ class: "btn btn-alert",
+ data: [confirm: dgettext("prompts", "Are you sure you want to delete your account?")]
+ ) %>
diff --git a/lib/lokal_web/views/layout_view.ex b/lib/lokal_web/views/layout_view.ex
index 820c730..3f82f70 100644
--- a/lib/lokal_web/views/layout_view.ex
+++ b/lib/lokal_web/views/layout_view.ex
@@ -1,6 +1,7 @@
defmodule LokalWeb.LayoutView do
use LokalWeb, :view
import LokalWeb.Components.Topbar
+ alias LokalWeb.{Endpoint, PageLive}
# Phoenix LiveDashboard is available only in development by default,
# so we instruct Elixir to not warn if the dashboard route is missing.
+ <%= dgettext("actions", "Reset password") %>
+ <%= form_for @changeset, Routes.user_reset_password_path(@conn, :update, @token), - [class: "flex flex-col justify-center items-center space-y-4"], + [ + class: + "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" + ], fn f -> %> <%= if @changeset.action && not @changeset.valid? do %> -Oops, something went wrong! Please check the errors below.
++ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %> +
-
+ +
- Forgot your password?
+
+
+ <%= dgettext("actions", "Forgot your password?") %>
+
<%= form_for :user,
Routes.user_reset_password_path(@conn, :create),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= submit("Send instructions to reset password", class: "btn btn-primary") %>
-
-
- <%= link("Register",
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link("Log in",
- to: Routes.user_session_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
+
+ <%= submit(dgettext("actions", "Send instructions to reset password"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
+ <% end %>
+
+
+
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
<% end %>
+ <%= link(dgettext("actions", "Log in"),
+ to: Routes.user_session_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/lokal_web/templates/user_session/new.html.heex b/lib/lokal_web/templates/user_session/new.html.heex
index 6edc948..15c77cd 100644
--- a/lib/lokal_web/templates/user_session/new.html.heex
+++ b/lib/lokal_web/templates/user_session/new.html.heex
@@ -1,41 +1,50 @@
-
-
- Log in
+
+
+ <%= dgettext("actions", "Log in") %>
+
<%= form_for @conn,
Routes.user_session_path(@conn, :create),
- [as: :user, class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ as: :user,
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
<%= if @error_message do %>
-
+
<%= @error_message %>
<% end %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
-
- <%= label(f, :password, class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
-
-
- <%= label(f, :remember_me, "Keep me logged in for 60 days", class: "title text-lg text-primary-500") %>
- <%= checkbox(f, :remember_me, class: "checkbox") %>
-
- <%= submit("Log in", class: "btn btn-primary") %>
-
-
- <%= link("Register",
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link("Forgot your password?",
- to: Routes.user_reset_password_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
+
+ <%= label(f, :password, class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
+
+ <%= label(f, :remember_me, gettext("Keep me logged in for 60 days"),
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= checkbox(f, :remember_me, class: "checkbox col-span-2") %>
+
+ <%= submit(dgettext("actions", "Log in"), class: "mx-auto btn btn-primary col-span-3") %>
+ <% end %>
+
+
+
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
<% end %>
+ <%= link(dgettext("actions", "Forgot your password?"),
+ to: Routes.user_reset_password_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/lokal_web/templates/user_settings/edit.html.heex b/lib/lokal_web/templates/user_settings/edit.html.heex
index 6bd12cb..c0f500d 100644
--- a/lib/lokal_web/templates/user_settings/edit.html.heex
+++ b/lib/lokal_web/templates/user_settings/edit.html.heex
@@ -1,82 +1,114 @@
-
-
- Settings
+
+
+ <%= gettext("Settings") %>
-
- Change email
-
+
+
+
<%= form_for @email_changeset,
Routes.user_settings_path(@conn, :update),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
- <%= if @email_changeset.action do %>
-
- Oops, something went wrong! Please check the errors below.
+
+ <%= dgettext("actions", "Change email") %>
+
+
+ <%= if @email_changeset.action && not @email_changeset.valid? do %>
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
+
<%= hidden_input(f, :action, name: "action", value: "update_email") %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :email) %>
-
- <%= label(f, :current_password,
- for: "current_password_for_email",
- class: "title text-lg text-primary-500"
- ) %>
- <%= password_input(f, :current_password,
- required: true,
- name: "current_password",
- id: "current_password_for_email",
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :current_password) %>
- <%= submit("Change email", class: "btn btn-primary") %>
+
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "mx-2 my-1 input input-primary col-span-2") %>
+ <%= error_tag(f, :email, "col-span-3") %>
+
+ <%= label(f, :current_password, gettext("Current password"),
+ for: "current_password_for_email",
+ class: "mx-2 my-1 title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :current_password,
+ required: true,
+ name: "current_password",
+ id: "current_password_for_email",
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :current_password, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Change email"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
<% end %>
-
- Change password
-
+
+
+
<%= form_for @password_changeset,
Routes.user_settings_path(@conn, :update),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
- <%= if @password_changeset.action do %>
-
- Oops, something went wrong! Please check the errors below.
+
+ <%= dgettext("actions", "Change password") %>
+
+
+ <%= if @password_changeset.action && not @password_changeset.valid? do %>
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
+
<%= hidden_input(f, :action, name: "action", value: "update_password") %>
-
- <%= label(f, :password, "New password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password,
- required: true,
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :password) %>
-
- <%= label(f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password_confirmation,
- required: true,
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :password_confirmation) %>
-
- <%= label(f, :current_password,
- for: "current_password_for_password",
- class: "title text-lg text-primary-500"
- ) %>
- <%= password_input(f, :current_password,
- required: true,
- name: "current_password",
- id: "current_password_for_password",
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :current_password) %>
- <%= submit("Change password", class: "btn btn-primary") %>
+
+ <%= label(f, :password, gettext("New password"), class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password,
+ required: true,
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password, "col-span-3") %>
+
+ <%= label(f, :password_confirmation, gettext("Confirm new password"),
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :password_confirmation,
+ required: true,
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password_confirmation, "col-span-3") %>
+
+ <%= label(f, :current_password, gettext("Current password"),
+ for: "current_password_for_password",
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :current_password,
+ required: true,
+ name: "current_password",
+ id: "current_password_for_password",
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :current_password, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Change password"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
<% end %>
+
+
+
+ <%= link(dgettext("actions", "Delete User"),
+ to: Routes.user_settings_path(@conn, :delete, @current_user),
+ method: :delete,
+ class: "btn btn-alert",
+ data: [confirm: dgettext("prompts", "Are you sure you want to delete your account?")]
+ ) %>
diff --git a/lib/lokal_web/views/layout_view.ex b/lib/lokal_web/views/layout_view.ex
index 820c730..3f82f70 100644
--- a/lib/lokal_web/views/layout_view.ex
+++ b/lib/lokal_web/views/layout_view.ex
@@ -1,6 +1,7 @@
defmodule LokalWeb.LayoutView do
use LokalWeb, :view
import LokalWeb.Components.Topbar
+ alias LokalWeb.{Endpoint, PageLive}
# Phoenix LiveDashboard is available only in development by default,
# so we instruct Elixir to not warn if the dashboard route is missing.
+ <%= dgettext("actions", "Forgot your password?") %>
+ <%= form_for :user, Routes.user_reset_password_path(@conn, :create), - [class: "flex flex-col justify-center items-center space-y-4"], + [ + class: + "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" + ], fn f -> %> --
+ +
- Log in
+
+
+ <%= dgettext("actions", "Log in") %>
+
<%= form_for @conn,
Routes.user_session_path(@conn, :create),
- [as: :user, class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ as: :user,
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
<%= if @error_message do %>
-
+
<%= @error_message %>
<% end %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
-
- <%= label(f, :password, class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
-
-
- <%= label(f, :remember_me, "Keep me logged in for 60 days", class: "title text-lg text-primary-500") %>
- <%= checkbox(f, :remember_me, class: "checkbox") %>
-
- <%= submit("Log in", class: "btn btn-primary") %>
-
-
- <%= link("Register",
- to: Routes.user_registration_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
- <%= link("Forgot your password?",
- to: Routes.user_reset_password_path(@conn, :new),
- class: "btn btn-primary"
- ) %>
-
+
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
+
+ <%= label(f, :password, class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password, required: true, class: "input input-primary col-span-2") %>
+
+ <%= label(f, :remember_me, gettext("Keep me logged in for 60 days"),
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= checkbox(f, :remember_me, class: "checkbox col-span-2") %>
+
+ <%= submit(dgettext("actions", "Log in"), class: "mx-auto btn btn-primary col-span-3") %>
+ <% end %>
+
+
+
+
+ <%= if Accounts.allow_registration?() do %>
+ <%= link(dgettext("actions", "Register"),
+ to: Routes.user_registration_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
<% end %>
+ <%= link(dgettext("actions", "Forgot your password?"),
+ to: Routes.user_reset_password_path(@conn, :new),
+ class: "btn btn-primary"
+ ) %>
+
diff --git a/lib/lokal_web/templates/user_settings/edit.html.heex b/lib/lokal_web/templates/user_settings/edit.html.heex
index 6bd12cb..c0f500d 100644
--- a/lib/lokal_web/templates/user_settings/edit.html.heex
+++ b/lib/lokal_web/templates/user_settings/edit.html.heex
@@ -1,82 +1,114 @@
-
-
- Settings
+
+
+ <%= gettext("Settings") %>
-
- Change email
-
+
+
+
<%= form_for @email_changeset,
Routes.user_settings_path(@conn, :update),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
- <%= if @email_changeset.action do %>
-
- Oops, something went wrong! Please check the errors below.
+
+ <%= dgettext("actions", "Change email") %>
+
+
+ <%= if @email_changeset.action && not @email_changeset.valid? do %>
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
+
<%= hidden_input(f, :action, name: "action", value: "update_email") %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :email) %>
-
- <%= label(f, :current_password,
- for: "current_password_for_email",
- class: "title text-lg text-primary-500"
- ) %>
- <%= password_input(f, :current_password,
- required: true,
- name: "current_password",
- id: "current_password_for_email",
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :current_password) %>
- <%= submit("Change email", class: "btn btn-primary") %>
+
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "mx-2 my-1 input input-primary col-span-2") %>
+ <%= error_tag(f, :email, "col-span-3") %>
+
+ <%= label(f, :current_password, gettext("Current password"),
+ for: "current_password_for_email",
+ class: "mx-2 my-1 title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :current_password,
+ required: true,
+ name: "current_password",
+ id: "current_password_for_email",
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :current_password, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Change email"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
<% end %>
-
- Change password
-
+
+
+
<%= form_for @password_changeset,
Routes.user_settings_path(@conn, :update),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
- <%= if @password_changeset.action do %>
-
- Oops, something went wrong! Please check the errors below.
+
+ <%= dgettext("actions", "Change password") %>
+
+
+ <%= if @password_changeset.action && not @password_changeset.valid? do %>
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
+
<%= hidden_input(f, :action, name: "action", value: "update_password") %>
-
- <%= label(f, :password, "New password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password,
- required: true,
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :password) %>
-
- <%= label(f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password_confirmation,
- required: true,
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :password_confirmation) %>
-
- <%= label(f, :current_password,
- for: "current_password_for_password",
- class: "title text-lg text-primary-500"
- ) %>
- <%= password_input(f, :current_password,
- required: true,
- name: "current_password",
- id: "current_password_for_password",
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :current_password) %>
- <%= submit("Change password", class: "btn btn-primary") %>
+
+ <%= label(f, :password, gettext("New password"), class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password,
+ required: true,
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password, "col-span-3") %>
+
+ <%= label(f, :password_confirmation, gettext("Confirm new password"),
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :password_confirmation,
+ required: true,
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password_confirmation, "col-span-3") %>
+
+ <%= label(f, :current_password, gettext("Current password"),
+ for: "current_password_for_password",
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :current_password,
+ required: true,
+ name: "current_password",
+ id: "current_password_for_password",
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :current_password, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Change password"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
<% end %>
+
+
+
+ <%= link(dgettext("actions", "Delete User"),
+ to: Routes.user_settings_path(@conn, :delete, @current_user),
+ method: :delete,
+ class: "btn btn-alert",
+ data: [confirm: dgettext("prompts", "Are you sure you want to delete your account?")]
+ ) %>
diff --git a/lib/lokal_web/views/layout_view.ex b/lib/lokal_web/views/layout_view.ex
index 820c730..3f82f70 100644
--- a/lib/lokal_web/views/layout_view.ex
+++ b/lib/lokal_web/views/layout_view.ex
@@ -1,6 +1,7 @@
defmodule LokalWeb.LayoutView do
use LokalWeb, :view
import LokalWeb.Components.Topbar
+ alias LokalWeb.{Endpoint, PageLive}
# Phoenix LiveDashboard is available only in development by default,
# so we instruct Elixir to not warn if the dashboard route is missing.
+ <%= dgettext("actions", "Log in") %>
+ <%= form_for @conn, Routes.user_session_path(@conn, :create), - [as: :user, class: "flex flex-col justify-center items-center space-y-4"], + [ + as: :user, + class: + "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" + ], fn f -> %> <%= if @error_message do %> -<%= @error_message %>
-
+ +
- Settings
+
+
+ <%= gettext("Settings") %>
-
- Change email
-
+
+
+
<%= form_for @email_changeset,
Routes.user_settings_path(@conn, :update),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
- <%= if @email_changeset.action do %>
-
- Oops, something went wrong! Please check the errors below.
+
+ <%= dgettext("actions", "Change email") %>
+
+
+ <%= if @email_changeset.action && not @email_changeset.valid? do %>
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
+
<%= hidden_input(f, :action, name: "action", value: "update_email") %>
-
- <%= label(f, :email, class: "title text-lg text-primary-500") %>
- <%= email_input(f, :email, required: true, class: "input input-primary col-span-2") %>
-
- <%= error_tag(f, :email) %>
-
- <%= label(f, :current_password,
- for: "current_password_for_email",
- class: "title text-lg text-primary-500"
- ) %>
- <%= password_input(f, :current_password,
- required: true,
- name: "current_password",
- id: "current_password_for_email",
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :current_password) %>
- <%= submit("Change email", class: "btn btn-primary") %>
+
+ <%= label(f, :email, class: "title text-lg text-primary-600") %>
+ <%= email_input(f, :email, required: true, class: "mx-2 my-1 input input-primary col-span-2") %>
+ <%= error_tag(f, :email, "col-span-3") %>
+
+ <%= label(f, :current_password, gettext("Current password"),
+ for: "current_password_for_email",
+ class: "mx-2 my-1 title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :current_password,
+ required: true,
+ name: "current_password",
+ id: "current_password_for_email",
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :current_password, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Change email"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
<% end %>
-
- Change password
-
+
+
+
<%= form_for @password_changeset,
Routes.user_settings_path(@conn, :update),
- [class: "flex flex-col justify-center items-center space-y-4"],
+ [
+ class:
+ "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
+ ],
fn f -> %>
- <%= if @password_changeset.action do %>
-
- Oops, something went wrong! Please check the errors below.
+
+ <%= dgettext("actions", "Change password") %>
+
+
+ <%= if @password_changeset.action && not @password_changeset.valid? do %>
+
+
+ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %>
+
<% end %>
+
<%= hidden_input(f, :action, name: "action", value: "update_password") %>
-
- <%= label(f, :password, "New password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password,
- required: true,
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :password) %>
-
- <%= label(f, :password_confirmation, "Confirm new password", class: "title text-lg text-primary-500") %>
- <%= password_input(f, :password_confirmation,
- required: true,
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :password_confirmation) %>
-
- <%= label(f, :current_password,
- for: "current_password_for_password",
- class: "title text-lg text-primary-500"
- ) %>
- <%= password_input(f, :current_password,
- required: true,
- name: "current_password",
- id: "current_password_for_password",
- class: "input input-primary col-span-2"
- ) %>
-
- <%= error_tag(f, :current_password) %>
- <%= submit("Change password", class: "btn btn-primary") %>
+
+ <%= label(f, :password, gettext("New password"), class: "title text-lg text-primary-600") %>
+ <%= password_input(f, :password,
+ required: true,
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password, "col-span-3") %>
+
+ <%= label(f, :password_confirmation, gettext("Confirm new password"),
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :password_confirmation,
+ required: true,
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :password_confirmation, "col-span-3") %>
+
+ <%= label(f, :current_password, gettext("Current password"),
+ for: "current_password_for_password",
+ class: "title text-lg text-primary-600"
+ ) %>
+ <%= password_input(f, :current_password,
+ required: true,
+ name: "current_password",
+ id: "current_password_for_password",
+ class: "mx-2 my-1 input input-primary col-span-2"
+ ) %>
+ <%= error_tag(f, :current_password, "col-span-3") %>
+
+ <%= submit(dgettext("actions", "Change password"),
+ class: "mx-auto btn btn-primary col-span-3"
+ ) %>
<% end %>
+
+
+
+ <%= link(dgettext("actions", "Delete User"),
+ to: Routes.user_settings_path(@conn, :delete, @current_user),
+ method: :delete,
+ class: "btn btn-alert",
+ data: [confirm: dgettext("prompts", "Are you sure you want to delete your account?")]
+ ) %>
diff --git a/lib/lokal_web/views/layout_view.ex b/lib/lokal_web/views/layout_view.ex
index 820c730..3f82f70 100644
--- a/lib/lokal_web/views/layout_view.ex
+++ b/lib/lokal_web/views/layout_view.ex
@@ -1,6 +1,7 @@
defmodule LokalWeb.LayoutView do
use LokalWeb, :view
import LokalWeb.Components.Topbar
+ alias LokalWeb.{Endpoint, PageLive}
# Phoenix LiveDashboard is available only in development by default,
# so we instruct Elixir to not warn if the dashboard route is missing.
+ <%= gettext("Settings") %>
-- Change email -
+ ++ <%= form_for @email_changeset, Routes.user_settings_path(@conn, :update), - [class: "flex flex-col justify-center items-center space-y-4"], + [ + class: + "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" + ], fn f -> %> - <%= if @email_changeset.action do %> -
Oops, something went wrong! Please check the errors below.
++ <%= dgettext("actions", "Change email") %> +
+ + <%= if @email_changeset.action && not @email_changeset.valid? do %> ++ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %> +
- Change password -
+ ++ <%= form_for @password_changeset, Routes.user_settings_path(@conn, :update), - [class: "flex flex-col justify-center items-center space-y-4"], + [ + class: + "flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center" + ], fn f -> %> - <%= if @password_changeset.action do %> -
Oops, something went wrong! Please check the errors below.
++ <%= dgettext("actions", "Change password") %> +
+ + <%= if @password_changeset.action && not @password_changeset.valid? do %> ++ <%= dgettext("errors", "Oops, something went wrong! Please check the errors below.") %> +
+ + <%= link(dgettext("actions", "Delete User"), + to: Routes.user_settings_path(@conn, :delete, @current_user), + method: :delete, + class: "btn btn-alert", + data: [confirm: dgettext("prompts", "Are you sure you want to delete your account?")] + ) %>