-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6cc44a
commit eb57a95
Showing
4 changed files
with
30 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
<div class='mdc-text-field-helper-line'> | ||
<div class="mdc-text-field-helper-text mdc-text-field-helper-text--persistent"> | ||
<% if resource.errors[field].any? %> | ||
<span class='mdc-text-field-helper-text--validation-msg' role='alert'> | ||
<%= resource.errors[field].to_sentence.capitalize %> | ||
</span> | ||
<% elsif text %> | ||
<span><%= text %></span> | ||
<% end %> | ||
</div> | ||
<div class="mt-1 h-2 text-sm text-gray-600"> | ||
<% if resource.errors[field].any? %> | ||
<span class="text-red-600" role="alert"> | ||
<%= resource.errors[field].to_sentence.capitalize %> | ||
</span> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
<% if resource.errors[field].any? %> | ||
<i aria-hidden="true" class="material-icons mdc-text-field__icon mdc-text-field__icon--trailing">error</i> | ||
<span class="absolute inset-y-0 right-0 flex items-center pr-3 text-red-700"> | ||
<span class="material-icons">error</span> | ||
</span> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
<div class="items-center justify-between" data-controller="textfield show-password"> | ||
<div class="flex items-center justify-between"> | ||
<%= f.label field, label_text, class: "block text-sm/6 font-medium text-indigo-900" %> | ||
<%= f.label field, label_text, class: "block text-sm/6 font-medium #{resource.errors[field].any? ? 'text-red-600' : 'text-indigo-900'}" %> | ||
|
||
<% if with_forgot_password_link %> | ||
<%= link_to '¿Has olvidado tu contraseña?', new_password_path(resource), class: "font-semibold text-indigo-700 hover:text-indigo-600 text-sm" %> | ||
<% end %> | ||
</div> | ||
<div class="relative w-full"> | ||
<%= f.password_field field, class: "block w-full pr-10 rounded-md bg-white px-3 py-1.5 text-base outline-1 -outline-offset-1 outline-indigo-400 focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-700 sm:text-sm/6", required:, autofocus: true, autocomplete:, data: { show_password_target: "password" } %> | ||
<button type="button" class="absolute inset-y-0 right-0 flex items-center pr-3 text-indigo-700 hover:text-indigo-600 cursor-pointer" data-action="show-password#toggle"> | ||
<%= f.password_field field, class: "block w-full pr-16 rounded-md bg-white px-3 py-1.5 text-base outline-1 -outline-offset-1 #{resource.errors[field].any? ? 'outline-red-600 focus:outline-2 focus:outline-red-600' : 'outline-indigo-400 focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-700'} sm:text-sm/6", required:, autofocus: true, autocomplete:, data: { show_password_target: "password" } %> | ||
|
||
<button type="button" class="absolute inset-y-0 <%= resource.errors[field].any? ? 'right-6' : 'right-0' %> flex items-center pr-3 cursor-pointer <%= resource.errors[field].any? ? "text-red-700 hover:text-red-600" : "text-indigo-700 hover:text-indigo-600" %> " data-action="show-password#toggle"> | ||
<span class="material-icons" data-show-password-target="icon">visibility</span> | ||
</button> | ||
|
||
<%= render 'shared/invalid_icon', resource: resource, field: field %> | ||
</div> | ||
</div> |