refactor password field to use form helpers

This commit is contained in:
Emin Kocan 2024-07-01 13:23:03 +02:00
parent f9db802c7b
commit 1ce191943c

View file

@ -33,15 +33,12 @@
<%= f.text_field :username, :label => t(".email or username"), :autofocus => true, :tabindex => 1, :value => params[:username] %> <%= f.text_field :username, :label => t(".email or username"), :autofocus => true, :tabindex => 1, :value => params[:username] %>
<div class="row"> <div class="d-flex flex-wrap column-gap-3 justify-content-between align-items-baseline">
<div class="col"> <%= f.label :password, t(".password"), :class => "my-2" %>
<%= f.label :password, t(".password"), :class => "form-label" %>
</div>
<div class="col text-end">
<small><%= link_to(t(".lost password link"), user_forgot_password_path) %></small> <small><%= link_to(t(".lost password link"), user_forgot_password_path) %></small>
</div> </div>
</div>
<input class="form-control mb-3" type="password" name="password" id="password" tabindex="2" value="" autocomplete="on" /> <%= f.password_field :password, :autocomplete => "on", :tabindex => 2, :value => "", :skip_label => true %>
<%= f.form_group do %> <%= f.form_group do %>
<%= f.check_box :remember_me, { :label => t(".remember"), :tabindex => 3, :checked => (params[:remember_me] == "yes") }, "yes" %> <%= f.check_box :remember_me, { :label => t(".remember"), :tabindex => 3, :checked => (params[:remember_me] == "yes") }, "yes" %>