forked from fixin.me/fixin.me
Simplify and improve labeled form
This commit is contained in:
@@ -1,31 +1,30 @@
|
||||
<% content_for :navigation, flush: true do %>
|
||||
<%= link_to svg_tag("pictograms/arrow-left-bold-outline", t(:back)),
|
||||
<%= link_to svg_tag('pictograms/arrow-left-bold-outline', t(:back)),
|
||||
request.referer.present? ? :back : root_path, class: 'tab' %>
|
||||
<% end %>
|
||||
|
||||
<div class="rightside buttongrid">
|
||||
<%= image_button_to t(".delete"), "account-remove-outline", user_registration_path,
|
||||
form_class: 'tools', method: :delete, data: {turbo: false},
|
||||
onclick: {confirm: t(".confirm_delete")} %>
|
||||
<div class="rightside-area buttongrid">
|
||||
<%#= TODO: Disallow/disable deletion for last admin account, image_button_to_if %>
|
||||
<%= image_button_to t('.delete'), 'account-remove-outline', user_registration_path,
|
||||
form_class: 'tools-area', method: :delete, data: {turbo: false},
|
||||
onclick: {confirm: t('.confirm_delete')} %>
|
||||
</div>
|
||||
|
||||
<%= labelled_form_for resource, url: registration_path(resource),
|
||||
html: {method: :patch, class: 'main'} do |f| %>
|
||||
<%= f.email_field :email, size: 30, autofocus: true, autocomplete: "off" %>
|
||||
<% if f.object.pending_reconfirmation? %>
|
||||
<%= f.text_field :unconfirmed_email, readonly: true, tabindex: -1,
|
||||
hint: t(".unconfirmed_email_hint",
|
||||
timestamp: f.object.confirmation_sent_at.to_fs(:db_without_sec)) %>
|
||||
<%= labeled_form_for resource, url: registration_path(resource),
|
||||
html: {method: :patch, class: 'main-area'} do |f| %>
|
||||
|
||||
<%= f.email_field :email, size: 30, autofocus: true, autocomplete: 'off' %>
|
||||
<% if resource.pending_reconfirmation? %>
|
||||
<%= f.text_field :unconfirmed_email, readonly: true,
|
||||
confirmation_sent_at: l(resource.confirmation_sent_at) %>
|
||||
<% end %>
|
||||
|
||||
<%= f.select :status, User.statuses, readonly: true %>
|
||||
|
||||
<%= f.password_field :password, label: t(".new_password"), size: 30,
|
||||
minlength: @minimum_password_length, autocomplete: "new-password",
|
||||
hint: t(".blank_password_hint_html",
|
||||
subhint: t("users.minimum_password_length", count: @minimum_password_length)) %>
|
||||
<%= f.password_field :password_confirmation, label: t(".password_confirmation"),
|
||||
size: 30, minlength: @minimum_password_length, autocomplete: "off" %>
|
||||
<%= f.password_field :password, size: 30, autocomplete: 'new-password',
|
||||
minlength: @minimum_password_length %>
|
||||
<%= f.password_field :password_confirmation, size: 30, autocomplete: 'off',
|
||||
minlength: @minimum_password_length %>
|
||||
|
||||
<%= f.submit t(".update") %>
|
||||
<%= f.submit %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user