Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pets form field hints, asterisk, validations #260

Merged
merged 3 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/views/devise/registrations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
<% end %>

<div class="form-group mb-3">
<i>(leave blank if you don't want to change it)</i><br />
<%= f.password_field :password, autocomplete: "new-password",
class: 'form-control', label: 'New password' %>
<i>(leave blank if you don't want to change it)</i><br />
<% if @minimum_password_length %>
<em><%= @minimum_password_length %> characters minimum</em>
<% end %>
Expand All @@ -58,11 +58,11 @@
</div>

<div class="form-group mb-3">
<i>(we need your current password to confirm your changes)</i><br />
<%= f.password_field :current_password,
autocomplete: "current-password",
required: true,
class: 'form-control' %>
<i>(we need your current password to confirm your changes)</i><br />
</div>

<div class="actions">
Expand Down
8 changes: 4 additions & 4 deletions app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@
</div>

<div class="form-group mb-3 bigger">
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em>
<% end %><br />
<%= f.password_field :password,
required: true,
autocomplete: "new-password",
class: 'form-control' %>
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em>
<% end %><br />
</div>

<div class="form-group mb-3 bigger">
<%= f.check_box :tos_agreement, required: true,
class: 'me-2', label: '*I agree to the' %>
class: 'me-2', label: 'I agree to the' %>
<%= link_to 'Terms and Conditions', terms_and_conditions_path,
target: '_blank', class: 'text-decoration-none' %>
<span>& </span>
Expand Down
26 changes: 0 additions & 26 deletions app/views/organizations/pets/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

<div class='form-group'>
<%= form.text_field :name, class: 'form-control' %>

<% pet.errors.full_messages_for(:name).each do |message| %>
<div class="alert alert-danger mt-1" role="alert"><%= message %></div>
<% end %>
</div>

<div class='form-group d-flex'>
Expand All @@ -32,37 +28,19 @@
[[t('general.male'), 'male'], [t('general.female'), 'female']],
{ prompt: t('general.please_select') },
class: 'form-control' %>

<% pet.errors.full_messages_for(:sex).each do |message| %>
<div class="alert alert-danger mt-1" role="alert"><%= message %></div>
<% end %>
</div>

<div class='form-group'>
<%= form.text_field :breed, class: 'form-control' %>

<% pet.errors.full_messages_for(:breed).each do |message| %>
<div class="alert alert-danger mt-1" role="alert"><%= message %></div>
<% end %>
</div>

<div class="form-group mt-3">
<div class='form-group d-flex'>
<div class='me-3'>
<%= form.text_field :weight_from, class: 'form-control', label: 'From weight' %>
<% if pet.errors[:weight_from].any? %>
<div class="alert alert-danger mt-1" role="alert">
<%= pet.errors.full_messages_for(:weight_from).first %>
</div>
<% end %>
</div>
<div class='me-3'>
<%= form.text_field :weight_to, class: 'form-control', label: 'To weight' %>
<% if pet.errors[:weight_to].any? %>
<div class="alert alert-danger mt-1" role="alert">
<%= pet.errors.full_messages_for(:weight_to).first %>
</div>
<% end %>
</div>
<div>
<%= form.select :weight_unit,
Expand All @@ -84,10 +62,6 @@
class: 'form-control' %>
<div data-counter-target='output' class='small mt-2 d-flex flex-row-reverse'></div>
</div>

<% pet.errors.full_messages_for(:description).each do |message| %>
<div class="alert alert-danger mt-1" role="alert"><%= message %></div>
<% end %>
</div>

<div class='form-group'>
Expand Down