forms: fix form validation error messages.

* Fix it so that all edit forms show an error banner if the form
  has validation errors. Previously forms had to manually call
  `error_messages_for`, which not all forms did.

* Fix it so that the full validation error message is shown next to each
  input attribute that had errors. Also update the styling of these
  error messages to look better.
This commit is contained in:
evazion
2021-02-22 01:36:54 -06:00
parent b9ea9d2f5a
commit cde76e66f6
24 changed files with 24 additions and 72 deletions

View File

@@ -44,8 +44,17 @@ form.simple_form {
}
}
&.field_with_errors input {
border: 1px solid var(--form-input-validation-error-border-color);
&.field_with_errors {
input, select, textarea {
border: 1px solid var(--form-input-validation-error-border-color);
}
span.error {
display: block;
color: var(--form-input-validation-error-text-color);
font-style: italic;
font-size: 0.8em;
}
}
&.text, &.dtext {