diff --git a/assets/css/_phx-liveview.scss b/assets/css/_phx-liveview.scss index 4dadcd43..702bdd9f 100644 --- a/assets/css/_phx-liveview.scss +++ b/assets/css/_phx-liveview.scss @@ -9,7 +9,6 @@ /* sets default bootstrap form-control styles if field not touched yet */ .phx-no-feedback .form-control.is-valid, .phx-no-feedback .form-control.is-invalid { - padding: $input-padding-y $input-padding-x; border: $input-border-width solid $input-border-color; background-image: none; diff --git a/assets/css/app.scss b/assets/css/app.scss index d1d02301..384fc844 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -31,3 +31,36 @@ .cursor-pointer { cursor: pointer !important; } + +/* + icons in input fields + */ +/* enable absolute positioning */ +.inner-addon { + position: relative; +} + +/* style icon */ +.inner-addon > .icon { + position: absolute; + padding: 0.5625rem 0.5rem; + pointer-events: none; +} + +/* align icon */ +.inner-addon > .icon.is-left { + left: 0px; +} +.inner-addon > .icon.is-right { + right: 0px; +} + +/* add padding */ +.left-addon input, +.left-addon select { + padding-left: 2rem; +} +.right-addon input, +.right-addon select { + padding-right: 2rem; +} diff --git a/assets/js/app.js b/assets/js/app.js index aeee1e5f..5d161237 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -19,7 +19,9 @@ import "../node_modules/bootstrap-icons/icons/key-fill.svg"; // pw confirm field import "../node_modules/bootstrap-icons/icons/lock.svg"; // current pw field import "../node_modules/bootstrap-icons/icons/shield.svg"; // role // live tables -import "../node_modules/bootstrap-icons/icons/backspace.svg"; // clear filter +import "../node_modules/bootstrap-icons/icons/arrow-down-up.svg"; // sort +import "../node_modules/bootstrap-icons/icons/funnel.svg"; // filter +import "../node_modules/bootstrap-icons/icons/x-circle-fill.svg"; // clear filter import "../node_modules/bootstrap-icons/icons/sort-down-alt.svg"; import "../node_modules/bootstrap-icons/icons/sort-up-alt.svg"; import "../node_modules/bootstrap-icons/icons/chevron-left.svg"; diff --git a/lib/shift73k_web/live/user/registration.html.leex b/lib/shift73k_web/live/user/registration.html.leex index 511a9666..0bc2afa8 100644 --- a/lib/shift73k_web/live/user/registration.html.leex +++ b/lib/shift73k_web/live/user/registration.html.leex @@ -9,8 +9,9 @@ <%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, novalidate: true, id: "reg_form"], fn f -> %> - -
+ <%= label f, :email, class: "form-label" %> +
+ <%= icon_div @socket, "bi-at", [class: "icon is-left text-muted fs-5"] %> <%= email_input f, :email, value: input_value(f, :email), class: input_class(f, :email, "form-control"), @@ -20,31 +21,22 @@ phx_debounce: "blur", aria_describedby: error_ids(f, :email) %> - <%= label f, :email do %> - <%= icon_div @socket, "bi-at", [class: "icon baseline text-muted"] %> - Email - <% end %> <%= error_tag f, :email %>
- -
+ <%= label f, :password, class: "form-label" %> +
+ <%= icon_div @socket, "bi-key", [class: "icon is-left text-muted fs-5"] %> <%= password_input f, :password, value: input_value(f, :password), class: input_class(f, :password, "form-control"), - placeholder: "Password", maxlength: User.max_password, phx_debounce: "250", aria_describedby: error_ids(f, :password) %> - <%= label f, :password do %> - <%= icon_div @socket, "bi-key", [class: "icon baseline text-muted"] %> - Password - <% end %> <%= error_tag f, :password %>
-
<%= submit (@trigger_submit && "Saving..." || "Register"), class: "btn btn-primary", diff --git a/lib/shift73k_web/live/user/reset_password.html.leex b/lib/shift73k_web/live/user/reset_password.html.leex index b29ae36c..049d15a5 100644 --- a/lib/shift73k_web/live/user/reset_password.html.leex +++ b/lib/shift73k_web/live/user/reset_password.html.leex @@ -9,39 +9,31 @@ <%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, novalidate: true, id: "pw_reset_form"], fn f -> %> -
+ <%= label f, :password, "New password", class: "form-label" %> +
+ <%= icon_div @socket, "bi-key", [class: "icon is-left text-muted fs-5"] %> <%= password_input f, :password, value: input_value(f, :password), class: input_class(f, :password, "form-control"), - placeholder: "New Password", maxlength: User.max_password, autofocus: true, aria_describedby: error_ids(f, :password) %> - <%= label f, :password do %> - <%= icon_div @socket, "bi-key", [class: "icon baseline text-muted"] %> - New password - <% end %> <%= error_tag f, :password %>
- -
+ <%= label f, :password_confirmation, "Confirm new password", class: "form-label" %> +
+ <%= icon_div @socket, "bi-key-fill", [class: "icon is-left text-muted fs-5"] %> <%= password_input f, :password_confirmation, value: input_value(f, :password_confirmation), class: input_class(f, :password_confirmation, "form-control"), - placeholder: "Confirm new password", maxlength: User.max_password, aria_describedby: error_ids(f, :password_confirmation) %> - <%= label f, :password do %> - <%= icon_div @socket, "bi-key-fill", [class: "icon baseline text-muted"] %> - Confirm new password - <% end %> <%= error_tag f, :password_confirmation %>
-
<%= submit "Reset password", class: "btn btn-primary", diff --git a/lib/shift73k_web/live/user/settings/email.html.leex b/lib/shift73k_web/live/user/settings/email.html.leex index 2d1b6e47..d50ce902 100644 --- a/lib/shift73k_web/live/user/settings/email.html.leex +++ b/lib/shift73k_web/live/user/settings/email.html.leex @@ -4,8 +4,9 @@ <%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, phx_target: @myself], fn f -> %> - -
+ <%= label f, :email, class: "form-label" %> +
+ <%= icon_div @socket, "bi-at", [class: "icon is-left text-muted fs-5"] %> <%= email_input f, :email, value: input_value(f, :email), class: input_class(f, :email, "form-control"), @@ -14,29 +15,20 @@ phx_debounce: "500", aria_describedby: error_ids(f, :email) %> - <%= label f, :email do %> - <%= icon_div @socket, "bi-at", [class: "icon baseline text-muted"] %> - Email - <% end %> <%= error_tag f, :email %>
- -
+ <%= label f, :current_password, class: "form-label" %> +
+ <%= icon_div @socket, "bi-lock", [class: "icon is-left text-muted fs-5"] %> <%= password_input f, :current_password, value: input_value(f, :current_password), class: "form-control", - placeholder: "Current Password", aria_describedby: error_ids(f, :current_password) %> - <%= label f, :current_password do %> - <%= icon_div @socket, "bi-lock", [class: "icon baseline text-muted"] %> - Current password - <% end %> <%= error_tag f, :current_password %>
-
<%= submit "Change email", class: "btn btn-primary", diff --git a/lib/shift73k_web/live/user/settings/password.html.leex b/lib/shift73k_web/live/user/settings/password.html.leex index 6d781dfd..a15d30ff 100644 --- a/lib/shift73k_web/live/user/settings/password.html.leex +++ b/lib/shift73k_web/live/user/settings/password.html.leex @@ -4,51 +4,39 @@ <%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, phx_target: @myself], fn f -> %> - -
+ <%= label f, :password, "New password", class: "form-label" %> +
+ <%= icon_div @socket, "bi-key", [class: "icon is-left text-muted fs-5"] %> <%= password_input f, :password, value: input_value(f, :password), class: input_class(f, :password, "form-control"), - placeholder: "New Password", maxlength: User.max_password, phx_debounce: "500", aria_describedby: error_ids(f, :password) %> - <%= label f, :password do %> - <%= icon_div @socket, "bi-key", [class: "icon baseline text-muted"] %> - New password - <% end %> <%= error_tag f, :password %>
- -
+ <%= label f, :password_confirmation, "Confirm new password", class: "form-label" %> +
+ <%= icon_div @socket, "bi-key-fill", [class: "icon is-left text-muted fs-5"] %> <%= password_input f, :password_confirmation, value: input_value(f, :password_confirmation), class: input_class(f, :password_confirmation, "form-control"), - placeholder: "Confirm new password", maxlength: User.max_password, aria_describedby: error_ids(f, :password_confirmation) %> - <%= label f, :password_confirmation do %> - <%= icon_div @socket, "bi-key-fill", [class: "icon baseline text-muted"] %> - Confirm new password - <% end %> <%= error_tag f, :password_confirmation %>
- -
+ <%= label f, :current_password, class: "form-label" %> +
+ <%= icon_div @socket, "bi-lock", [class: "icon is-left text-muted fs-5"] %> <%= password_input f, :current_password, value: input_value(f, :current_password), class: "form-control", - placeholder: "Current Password", aria_describedby: error_ids(f, :current_password) %> - <%= label f, :current_password do %> - <%= icon_div @socket, "bi-lock", [class: "icon baseline text-muted"] %> - Current password - <% end %> <%= error_tag f, :current_password %>
@@ -68,10 +56,4 @@ <%= hidden_input f, :params_token, value: Phoenix.Token.encrypt(Shift73kWeb.Endpoint, "login_params", @login_params) %> <% end %> - <%# hidden form to submit user for relogin after password change %> - <%#= form_for :user_login, Routes.user_session_path(@socket, :create), [phx_trigger_action: @trigger_submit], fn f -> %> - <%#= hidden_input f, :login_params_token, value: Phoenix.Token.encrypt(Shift73kWeb.Endpoint, "login_params", @login_params) %> - <%#= hidden_input f, :remember_me, value: false %> - <%# end %> -
diff --git a/lib/shift73k_web/live/user_management/form_component.html.leex b/lib/shift73k_web/live/user_management/form_component.html.leex index 65607c0c..db0accd5 100644 --- a/lib/shift73k_web/live/user_management/form_component.html.leex +++ b/lib/shift73k_web/live/user_management/form_component.html.leex @@ -6,7 +6,9 @@