From 47acc979558c7a0ef5c8db7acae8fdd64fe693f6 Mon Sep 17 00:00:00 2001 From: SphericalKat Date: Sun, 15 Aug 2021 05:02:33 +0530 Subject: [PATCH] fix(users): fix styles for login page Signed-off-by: SphericalKat --- lib/ketbin_web/controllers/user_auth.ex | 1 + .../templates/user_session/new.html.eex | 51 +++++++++++-------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/lib/ketbin_web/controllers/user_auth.ex b/lib/ketbin_web/controllers/user_auth.ex index 7df5987..b103bc1 100644 --- a/lib/ketbin_web/controllers/user_auth.ex +++ b/lib/ketbin_web/controllers/user_auth.ex @@ -34,6 +34,7 @@ defmodule KetbinWeb.UserAuth do |> put_session(:user_token, token) |> put_session(:live_socket_id, "users_sessions:#{Base.url_encode64(token)}") |> maybe_write_remember_me_cookie(token, params) + |> put_flash(:info, "Logged in successfully!") |> redirect(to: user_return_to || signed_in_path(conn)) end diff --git a/lib/ketbin_web/templates/user_session/new.html.eex b/lib/ketbin_web/templates/user_session/new.html.eex index 7be6449..cf90058 100644 --- a/lib/ketbin_web/templates/user_session/new.html.eex +++ b/lib/ketbin_web/templates/user_session/new.html.eex @@ -1,27 +1,34 @@ -

Log in

+
+

Log in

-<%= form_for @conn, Routes.user_session_path(@conn, :create), [as: :user], fn f -> %> - <%= if @error_message do %> -
-

<%= @error_message %>

-
- <% end %> + <%= form_for @conn, Routes.user_session_path(@conn, :create), [as: :user, class: "flex flex-col h-full justify-center items-start m-auto"], fn f -> %> + <%= if @error_message do %> +
+

<%= @error_message %>

+
+ <% end %> - <%= label f, :email %> - <%= email_input f, :email, required: true %> +
+ <%= label f, :email %> + <%= email_input f, :email, [class: "text-black px-2 py-1 outline-none", required: true] %> +
- <%= label f, :password %> - <%= password_input f, :password, required: true %> +
+ <%= label f, :password %> + <%= password_input f, :password, [class: "text-black px-2 py-1 outline-none", required: true] %> +
+
+ <%= checkbox f, :remember_me, [class: "mr-2 outline-none"] %> + <%= label f, :remember_me, "Keep me logged in for 60 days" %> +
- <%= label f, :remember_me, "Keep me logged in for 60 days" %> - <%= checkbox f, :remember_me %> +
+ <%= submit "Log in" %> +
+ <% end %> -
- <%= submit "Log in" %> -
-<% end %> - -

- <%= link "Register", to: Routes.user_registration_path(@conn, :new) %> | - <%= link "Forgot your password?", to: Routes.user_reset_password_path(@conn, :new) %> -

+

+ <%= link "Register", to: Routes.user_registration_path(@conn, :new) %> | + <%= link "Forgot your password?", to: Routes.user_reset_password_path(@conn, :new) %> +

+