From 0869d6a58c6de69e97e3351cdfa7356335d092e7 Mon Sep 17 00:00:00 2001 From: Adam Piontek Date: Wed, 3 Mar 2021 08:15:14 -0500 Subject: [PATCH] style improvements and fixes --- assets/css/app.scss | 10 ++++++++++ lib/bones73k_web/controllers/user_auth.ex | 1 - lib/bones73k_web/live/property_live/index.html.leex | 10 +++++----- lib/bones73k_web/live/user/registration.html.leex | 4 ++-- lib/bones73k_web/live/user/reset_password.html.leex | 4 ++-- lib/bones73k_web/live/user/settings.html.leex | 4 ++-- lib/bones73k_web/live/user/settings/email.html.leex | 2 +- .../live/user/settings/password.html.leex | 2 +- lib/bones73k_web/live/user_dashboard_live.ex | 2 +- lib/bones73k_web/templates/layout/_navbar.html.eex | 4 +++- .../templates/user_confirmation/new.html.eex | 4 ++-- .../templates/user_reset_password/new.html.eex | 4 ++-- lib/bones73k_web/templates/user_session/new.html.eex | 6 +++--- lib/bones73k_web/views/icon_helpers.ex | 11 +++++++++++ .../controllers/user_confirmation_controller_test.exs | 2 +- .../controllers/user_registration_controller_test.exs | 2 +- .../user_reset_password_controller_test.exs | 4 ++-- .../controllers/user_session_controller_test.exs | 6 +++--- .../controllers/user_settings_controller_test.exs | 2 +- test/bones73k_web/live/user/registration_test.exs | 4 ++-- test/bones73k_web/live/user/reset_password_test.exs | 4 ++-- 21 files changed, 57 insertions(+), 35 deletions(-) diff --git a/assets/css/app.scss b/assets/css/app.scss index aff89d6..2ae020b 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -15,3 +15,13 @@ /* Navbar toggler icon override */ @import "nav-burger"; + +/* extra */ +.was-validated .no-valid-style .form-check-input:valid, +.form-check-input.is-valid { + border-color: inherit !important; +} +.was-validated .no-valid-style .form-check-input:valid ~ .form-check-label, +.no-valid-style .form-check-input.is-valid ~ .form-check-label { + color: inherit !important; +} diff --git a/lib/bones73k_web/controllers/user_auth.ex b/lib/bones73k_web/controllers/user_auth.ex index 30fbd50..4b9d3a4 100644 --- a/lib/bones73k_web/controllers/user_auth.ex +++ b/lib/bones73k_web/controllers/user_auth.ex @@ -1,7 +1,6 @@ defmodule Bones73kWeb.UserAuth do import Plug.Conn import Phoenix.Controller - import Phoenix.HTML alias Bones73k.Accounts alias Bones73kWeb.Router.Helpers, as: Routes diff --git a/lib/bones73k_web/live/property_live/index.html.leex b/lib/bones73k_web/live/property_live/index.html.leex index 7089e67..c0d32d7 100644 --- a/lib/bones73k_web/live/property_live/index.html.leex +++ b/lib/bones73k_web/live/property_live/index.html.leex @@ -1,4 +1,4 @@ -

Listing Properties

+

Listing Properties

<%= if @live_action in [:new, :edit] do %> <%= live_modal @socket, Bones73kWeb.PropertyLive.FormComponent, @@ -10,12 +10,12 @@ return_to: Routes.property_index_path(@socket, :index) %> <% end %> - +
- - - + + + diff --git a/lib/bones73k_web/live/user/registration.html.leex b/lib/bones73k_web/live/user/registration.html.leex index a03ccbd..9ccd608 100644 --- a/lib/bones73k_web/live/user/registration.html.leex +++ b/lib/bones73k_web/live/user/registration.html.leex @@ -1,10 +1,10 @@
-

+

<%= icon_div @socket, "bi-person-plus", [class: "icon baseline"] %> Register -

+

Registration gains additional features, like remembering your song request history.

<%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, novalidate: true, id: "reg_form"], fn f -> %> diff --git a/lib/bones73k_web/live/user/reset_password.html.leex b/lib/bones73k_web/live/user/reset_password.html.leex index ad0bc23..843a290 100644 --- a/lib/bones73k_web/live/user/reset_password.html.leex +++ b/lib/bones73k_web/live/user/reset_password.html.leex @@ -1,10 +1,10 @@
-

+

<%= icon_div @socket, "bi-shield-lock", [class: "icon baseline"] %> Reset password -

+

Hi <%= @user.email %> — What new word of passage will confirm you are who you say you are?

<%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, novalidate: true, id: "pw_reset_form"], fn f -> %> diff --git a/lib/bones73k_web/live/user/settings.html.leex b/lib/bones73k_web/live/user/settings.html.leex index 994b1fc..31b344d 100644 --- a/lib/bones73k_web/live/user/settings.html.leex +++ b/lib/bones73k_web/live/user/settings.html.leex @@ -1,7 +1,7 @@ -

+

<%= icon_div @socket, "bi-sliders", [class: "icon baseline"] %> User Settings -

+
<%= live_component @socket, Bones73kWeb.UserLive.Settings.Email, id: "email-#{@current_user.id}", current_user: @current_user %> diff --git a/lib/bones73k_web/live/user/settings/email.html.leex b/lib/bones73k_web/live/user/settings/email.html.leex index b589b26..ee5a505 100644 --- a/lib/bones73k_web/live/user/settings/email.html.leex +++ b/lib/bones73k_web/live/user/settings/email.html.leex @@ -1,6 +1,6 @@
-

Change email

+

Change email

<%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, phx_target: @myself], fn f -> %> diff --git a/lib/bones73k_web/live/user/settings/password.html.leex b/lib/bones73k_web/live/user/settings/password.html.leex index 9d84ad4..736b261 100644 --- a/lib/bones73k_web/live/user/settings/password.html.leex +++ b/lib/bones73k_web/live/user/settings/password.html.leex @@ -1,6 +1,6 @@
-

Change password

+

Change password

<%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, phx_target: @myself], fn f -> %> diff --git a/lib/bones73k_web/live/user_dashboard_live.ex b/lib/bones73k_web/live/user_dashboard_live.ex index a6def82..4b79a71 100644 --- a/lib/bones73k_web/live/user_dashboard_live.ex +++ b/lib/bones73k_web/live/user_dashboard_live.ex @@ -11,7 +11,7 @@ defmodule Bones73kWeb.UserDashboardLive do def render(assigns) do ~L"""
-

Welcome to the user dashboard!

+

Welcome to the user dashboard!

""" end diff --git a/lib/bones73k_web/templates/layout/_navbar.html.eex b/lib/bones73k_web/templates/layout/_navbar.html.eex index c3852ca..7fb7276 100644 --- a/lib/bones73k_web/templates/layout/_navbar.html.eex +++ b/lib/bones73k_web/templates/layout/_navbar.html.eex @@ -1,10 +1,12 @@
NamePriceDescriptionNamePriceDescription