2021-03-01 13:42:26 -05:00
|
|
|
<div class="row justify-content-center">
|
2021-03-10 09:27:24 -05:00
|
|
|
<div class="col-11 col-sm-8 col-md-6 col-lg-5 col-xl-4 col-xxl-3">
|
2021-03-01 13:42:26 -05:00
|
|
|
|
2022-08-13 07:32:36 -04:00
|
|
|
<h2>
|
2022-08-13 09:26:09 -04:00
|
|
|
<i class="bi bi-journal-plus me-1"></i> Register
|
2022-08-13 07:32:36 -04:00
|
|
|
</h2>
|
2021-03-10 09:27:24 -05:00
|
|
|
<p class="lead">Create an account to manage your work shifts with us.</p>
|
2021-03-01 13:42:26 -05:00
|
|
|
|
|
|
|
<%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, novalidate: true, id: "reg_form"], fn f -> %>
|
|
|
|
|
2021-03-09 10:22:05 -05:00
|
|
|
<%= label f, :email, class: "form-label" %>
|
2022-08-13 07:32:36 -04:00
|
|
|
<div class="inner-addon left-addon mb-3" phx-feedback-for={input_id(f, :email)}>
|
|
|
|
<i class="bi bi-at icon is-left text-muted fs-5"></i>
|
2021-03-07 17:17:16 -05:00
|
|
|
<%= email_input f, :email,
|
|
|
|
value: input_value(f, :email),
|
|
|
|
class: input_class(f, :email, "form-control"),
|
|
|
|
placeholder: "e.g., babka@73k.us",
|
|
|
|
maxlength: User.max_email,
|
|
|
|
autofocus: true,
|
|
|
|
phx_debounce: "blur",
|
|
|
|
aria_describedby: error_ids(f, :email)
|
|
|
|
%>
|
|
|
|
<%= error_tag f, :email %>
|
2021-03-01 13:42:26 -05:00
|
|
|
</div>
|
|
|
|
|
2021-03-09 10:22:05 -05:00
|
|
|
<%= label f, :password, class: "form-label" %>
|
2022-08-13 07:32:36 -04:00
|
|
|
<div class="inner-addon left-addon mb-3" phx-feedback-for={input_id(f, :password)}>
|
|
|
|
<i class="bi bi-key icon is-left text-muted fs-5"></i>
|
2021-03-07 17:17:16 -05:00
|
|
|
<%= password_input f, :password,
|
|
|
|
value: input_value(f, :password),
|
|
|
|
class: input_class(f, :password, "form-control"),
|
|
|
|
maxlength: User.max_password,
|
|
|
|
phx_debounce: "250",
|
|
|
|
aria_describedby: error_ids(f, :password)
|
|
|
|
%>
|
|
|
|
<%= error_tag f, :password %>
|
2021-03-01 13:42:26 -05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mb-3">
|
2021-03-04 22:03:27 -05:00
|
|
|
<%= submit (@trigger_submit && "Saving..." || "Register"),
|
|
|
|
class: "btn btn-primary",
|
|
|
|
disabled: @trigger_submit || !@changeset.valid?,
|
|
|
|
aria_disabled: (@trigger_submit || !@changeset.valid?) && "true" || false,
|
|
|
|
phx_disable_with: "Saving..."
|
|
|
|
%>
|
2021-03-01 13:42:26 -05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<%= link "Log in", to: Routes.user_session_path(@socket, :new) %> |
|
|
|
|
<%= link "Forgot your password?", to: Routes.user_reset_password_path(@socket, :new) %>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<%# hidden form for initial login after registration %>
|
|
|
|
<%= form_for :user, Routes.user_session_path(@socket, :create), [phx_trigger_action: @trigger_submit, id: "reg_trigger"], fn f -> %>
|
2021-03-05 19:23:32 -05:00
|
|
|
<%= hidden_input f, :params_token, value: Phoenix.Token.encrypt(Shift73kWeb.Endpoint, "login_params", @login_params) %>
|
2021-03-01 13:42:26 -05:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|