2021-03-01 13:42:26 -05:00
|
|
|
<div class="row justify-content-center">
|
|
|
|
<div class="col-sm-9 col-md-7 col-lg-5 col-xl-4 ">
|
|
|
|
|
2021-03-03 08:15:14 -05:00
|
|
|
<h2>
|
2021-03-01 13:42:26 -05:00
|
|
|
<%= icon_div @socket, "bi-person-plus", [class: "icon baseline"] %>
|
|
|
|
Register
|
2021-03-03 08:15:14 -05:00
|
|
|
</h2>
|
2021-03-01 13:42:26 -05:00
|
|
|
<p class="lead">Registration gains additional features, like remembering your song request history.</p>
|
|
|
|
|
|
|
|
<%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, novalidate: true, id: "reg_form"], fn f -> %>
|
|
|
|
|
|
|
|
<div class="mb-3" phx-feedback-for="<%= input_id(f, :email) %>">
|
|
|
|
<%= label f, :email, class: "form-label" %>
|
|
|
|
<div class="input-group has-validation">
|
|
|
|
<span class="input-group-text">
|
2021-03-04 22:03:27 -05:00
|
|
|
<%= icon_div @socket, "bi-at", [class: "icon"] %>
|
2021-03-01 13:42:26 -05:00
|
|
|
</span>
|
|
|
|
<%= 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_id(f, :email)
|
|
|
|
%>
|
|
|
|
<%= error_tag f, :email %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mb-3" phx-feedback-for="<%= input_id(f, :password) %>">
|
|
|
|
<%= label f, :password, class: "form-label" %>
|
|
|
|
<div class="input-group has-validation">
|
|
|
|
<span class="input-group-text">
|
2021-03-04 22:03:27 -05:00
|
|
|
<%= icon_div @socket, "bi-key", [class: "icon"] %>
|
2021-03-01 13:42:26 -05:00
|
|
|
</span>
|
|
|
|
<%= password_input f, :password,
|
|
|
|
value: input_value(f, :password),
|
|
|
|
class: input_class(f, :password, "form-control"),
|
|
|
|
maxlength: User.max_password,
|
2021-03-04 22:03:27 -05:00
|
|
|
phx_debounce: "250",
|
2021-03-01 13:42:26 -05:00
|
|
|
aria_describedby: error_id(f, :password)
|
|
|
|
%>
|
|
|
|
<%= error_tag f, :password %>
|
|
|
|
</div>
|
|
|
|
</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 -> %>
|
|
|
|
<%= hidden_input f, :params_token, value: Phoenix.Token.encrypt(Bones73kWeb.Endpoint, "login_params", @login_params) %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|