From d734e8ad0233e7a68d43a2afcd2b27fabaf23110 Mon Sep 17 00:00:00 2001 From: SphericalKat Date: Fri, 20 Aug 2021 02:27:16 +0530 Subject: [PATCH] refactor(users): add styles for remaining user management templates Signed-off-by: SphericalKat --- .../templates/user_confirmation/new.html.eex | 28 ++++--- .../user_reset_password/edit.html.eex | 48 ++++++------ .../user_reset_password/new.html.eex | 28 ++++--- .../templates/user_settings/edit.html.eex | 75 +++++++++++-------- 4 files changed, 103 insertions(+), 76 deletions(-) diff --git a/lib/ketbin_web/templates/user_confirmation/new.html.eex b/lib/ketbin_web/templates/user_confirmation/new.html.eex index 803080f..3bac891 100644 --- a/lib/ketbin_web/templates/user_confirmation/new.html.eex +++ b/lib/ketbin_web/templates/user_confirmation/new.html.eex @@ -1,15 +1,19 @@ -

Resend confirmation instructions

+
+

Resend confirmation instructions

-<%= form_for :user, Routes.user_confirmation_path(@conn, :create), fn f -> %> - <%= label f, :email %> - <%= email_input f, :email, required: true %> + <%= form_for :user, Routes.user_confirmation_path(@conn, :create), [class: "flex flex-col h-full justify-center items-start m-auto"], fn f -> %> +
+ <%= label f, :email %> + <%= email_input f, :email, [class: "text-black px-2 py-1 outline-none", required: true] %> +
-
- <%= submit "Resend confirmation instructions" %> -
-<% end %> +
+ <%= submit "Resend confirmation instructions" %> +
+ <% end %> -

- <%= link "Register", to: Routes.user_registration_path(@conn, :new) %> | - <%= link "Log in", to: Routes.user_session_path(@conn, :new) %> -

+

+ <%= link "Register", to: Routes.user_registration_path(@conn, :new) %> | + <%= link "Log in", to: Routes.user_session_path(@conn, :new) %> +

+
diff --git a/lib/ketbin_web/templates/user_reset_password/edit.html.eex b/lib/ketbin_web/templates/user_reset_password/edit.html.eex index 94a550a..9809345 100644 --- a/lib/ketbin_web/templates/user_reset_password/edit.html.eex +++ b/lib/ketbin_web/templates/user_reset_password/edit.html.eex @@ -1,26 +1,32 @@ -

Reset password

+
+

Reset password

-<%= form_for @changeset, Routes.user_reset_password_path(@conn, :update, @token), fn f -> %> - <%= if @changeset.action do %> -
-

Oops, something went wrong! Please check the errors below.

-
- <% end %> + <%= form_for @changeset, Routes.user_reset_password_path(@conn, :update, @token), [class: "flex flex-col h-full justify-center items-start m-auto"], fn f -> %> + <%= if @changeset.action do %> +
+

Oops, something went wrong! Please check the errors below.

+
+ <% end %> - <%= label f, :password, "New password" %> - <%= password_input f, :password, required: true %> - <%= error_tag f, :password %> +
+ <%= label f, :password, "New password" %> + <%= password_input f, :password, [class: "text-black px-2 py-1 outline-none", required: true] %> + <%= error_tag f, :password %> +
- <%= label f, :password_confirmation, "Confirm new password" %> - <%= password_input f, :password_confirmation, required: true %> - <%= error_tag f, :password_confirmation %> +
+ <%= label f, :password_confirmation, "Confirm new password" %> + <%= password_input f, :password_confirmation, [class: "text-black px-2 py-1 outline-none", required: true] %> + <%= error_tag f, :password_confirmation %> +
-
- <%= submit "Reset password" %> -
-<% end %> +
+ <%= submit "Reset password" %> +
+ <% end %> -

- <%= link "Register", to: Routes.user_registration_path(@conn, :new) %> | - <%= link "Log in", to: Routes.user_session_path(@conn, :new) %> -

+

+ <%= link "Register", to: Routes.user_registration_path(@conn, :new) %> | + <%= link "Log in", to: Routes.user_session_path(@conn, :new) %> +

+
diff --git a/lib/ketbin_web/templates/user_reset_password/new.html.eex b/lib/ketbin_web/templates/user_reset_password/new.html.eex index 619c535..6419a75 100644 --- a/lib/ketbin_web/templates/user_reset_password/new.html.eex +++ b/lib/ketbin_web/templates/user_reset_password/new.html.eex @@ -1,15 +1,19 @@ -

Forgot your password?

+
+

Forgot your password?

-<%= form_for :user, Routes.user_reset_password_path(@conn, :create), fn f -> %> - <%= label f, :email %> - <%= email_input f, :email, required: true %> + <%= form_for :user, Routes.user_reset_password_path(@conn, :create), [class: "flex flex-col h-full justify-center items-start m-auto"], fn f -> %> +
+ <%= label f, :email %> + <%= email_input f, :email, [class: "text-black px-2 py-1 outline-none", required: true] %> +
-
- <%= submit "Send instructions to reset password" %> -
-<% end %> +
+ <%= submit "Send instructions to reset password" %> +
+ <% end %> -

- <%= link "Register", to: Routes.user_registration_path(@conn, :new) %> | - <%= link "Log in", to: Routes.user_session_path(@conn, :new) %> -

+

+ <%= link "Register", to: Routes.user_registration_path(@conn, :new) %> | + <%= link "Log in", to: Routes.user_session_path(@conn, :new) %> +

+
diff --git a/lib/ketbin_web/templates/user_settings/edit.html.eex b/lib/ketbin_web/templates/user_settings/edit.html.eex index 6e8abf9..19cd6c8 100644 --- a/lib/ketbin_web/templates/user_settings/edit.html.eex +++ b/lib/ketbin_web/templates/user_settings/edit.html.eex @@ -1,8 +1,9 @@ -

Settings

+

Settings

-

Change email

+
+<%= form_for @email_changeset, Routes.user_settings_path(@conn, :update), [class: "flex flex-col h-full justify-center items-start m-auto"], fn f -> %> +

Change email

-<%= form_for @email_changeset, Routes.user_settings_path(@conn, :update), fn f -> %> <%= if @email_changeset.action do %>

Oops, something went wrong! Please check the errors below.

@@ -11,43 +12,55 @@ <%= hidden_input f, :action, name: "action", value: "update_email" %> - <%= label f, :email %> - <%= email_input f, :email, required: true %> - <%= error_tag f, :email %> +
+ <%= label f, :email %> + <%= email_input f, :email, [class: "text-black px-2 py-1 outline-none", required: true] %> + <%= error_tag f, :email %> +
- <%= label f, :current_password, for: "current_password_for_email" %> - <%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_email" %> - <%= error_tag f, :current_password %> +
+ <%= label f, :current_password, for: "current_password_for_email" %> + <%= password_input f, :current_password, [class: "text-black px-2 py-1 outline-none", required: true, name: "current_password", id: "current_password_for_email"]%> + <%= error_tag f, :current_password %> +
-
+
<%= submit "Change email" %>
<% end %> -

Change password

-<%= form_for @password_changeset, Routes.user_settings_path(@conn, :update), fn f -> %> - <%= if @password_changeset.action do %> -
-

Oops, something went wrong! Please check the errors below.

-
- <% end %> + <%= form_for @password_changeset, Routes.user_settings_path(@conn, :update), [class: "flex flex-col h-full justify-center items-start m-auto"], fn f -> %> +

Change password

- <%= hidden_input f, :action, name: "action", value: "update_password" %> + <%= if @password_changeset.action do %> +
+

Oops, something went wrong! Please check the errors below.

+
+ <% end %> - <%= label f, :password, "New password" %> - <%= password_input f, :password, required: true %> - <%= error_tag f, :password %> + <%= hidden_input f, :action, name: "action", value: "update_password" %> - <%= label f, :password_confirmation, "Confirm new password" %> - <%= password_input f, :password_confirmation, required: true %> - <%= error_tag f, :password_confirmation %> +
+ <%= label f, :password, "New password" %> + <%= password_input f, :password, [class: "text-black px-2 py-1 outline-none", required: true] %> + <%= error_tag f, :password %> +
- <%= label f, :current_password, for: "current_password_for_password" %> - <%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_password" %> - <%= error_tag f, :current_password %> +
+ <%= label f, :password_confirmation, "Confirm new password" %> + <%= password_input f, :password_confirmation, [class: "text-black px-2 py-1 outline-none", required: true] %> + <%= error_tag f, :password_confirmation %> +
-
- <%= submit "Change password" %> -
-<% end %> +
+ <%= label f, :current_password, for: "current_password_for_password" %> + <%= password_input f, :current_password, [class: "text-black px-2 py-1 outline-none", required: true, name: "current_password", id: "current_password_for_password"] %> + <%= error_tag f, :current_password %> +
+ +
+ <%= submit "Change password" %> +
+ <% end %> +