90ceb4f6fe
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
59 lines
2.1 KiB
Elixir
59 lines
2.1 KiB
Elixir
<%= form_for @changeset, @action, [as: :registration], fn f -> %>
|
|
|
|
<%= if @changeset.action do %>
|
|
<div class="alert alert-danger">
|
|
<p><%= dgettext "coherence", "Oops, something went wrong! Please check the errors below." %></p>
|
|
<ul>
|
|
<%= for error <- @changeset.errors do %>
|
|
<li><%= error %></li>
|
|
<% end %>
|
|
</ul>
|
|
</div>
|
|
<% end %>
|
|
|
|
<div class="form-group">
|
|
<%= required_label f, dgettext("coherence", "Name"), class: "control-label" %>
|
|
<%= text_input f, :username, class: "form-control", required: "" %>
|
|
<%= error_tag f, :username %>
|
|
</div>
|
|
|
|
<%= unless (login_field = Coherence.Config.login_field) == :email do %>
|
|
<div class="form-group">
|
|
<%= required_label f, login_field, class: "control-label" %>
|
|
<%= text_input f, login_field, class: "form-control", required: "" %>
|
|
<%= error_tag f, login_field %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<div class="form-group">
|
|
<%= required_label f, dgettext("coherence", "Email"), class: "control-label" %>
|
|
<%= text_input f, :email, class: "form-control", required: "" %>
|
|
<%= error_tag f, :email %>
|
|
</div>
|
|
|
|
<%= if Coherence.Config.require_current_password and not is_nil(@changeset.data.id) do %>
|
|
<div class="form-group">
|
|
<%= required_label f, :current_password, class: "control-label" %>
|
|
<%= password_input f, :current_password, [class: "form-control"] ++ @required %>
|
|
<%= error_tag f, :current_password %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<div class="form-group">
|
|
<%= required_label f, dgettext("coherence", "Password"), class: "control-label" %>
|
|
<%= password_input f, :password, [class: "form-control"] ++ @required %>
|
|
<%= error_tag f, :password %>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<%= required_label f, dgettext("coherence", "Password Confirmation"), class: "control-label" %>
|
|
<%= password_input f, :password_confirmation, [class: "form-control"] ++ @required %>
|
|
<%= error_tag f, :password_confirmation %>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<%= submit @label, class: "btn btn-primary" %>
|
|
<%= link dgettext("coherence", "Cancel"), to: Coherence.Config.logged_out_url("/"), class: "btn" %>
|
|
</div>
|
|
<% end %>
|