manage.get.gov/src/registrar/templates/django/forms/widgets/input.html
Seamus Johnston 0e3f68622f
Bypass Django internal form rendering
The purpose of this change is to allow direct use of Django templates
to make edits to how form fields and labels are rendered, while
retaining the validation logic provided by Django's extensive field and
widget library.

This commit additional contains:
 - Remove `REQUIRED_SUFFIX`, as it is handled by the templates now
 - Remove `required=True` from form fields, as this is the default
 - Remove `required=False` from fields where it was added as workaround
   for conditionally required questions which Django form wizard
   couldn't handle
 - Replace `clean_is_policy_acknowledged` with `error_messages` dict
 - Remove duplicate nil entry for Federal Agency dropdown
 - Update `DOMAIN_REGEX` to match whole string
 - Subtle changes to `is_valid` and `get_forms` in ApplicationWizard to
   reduce database calls and use form object's initial data correctly
2023-02-02 15:06:23 -06:00

8 lines
No EOL
336 B
HTML

<input
type="{{ widget.type }}"
name="{{ widget.name }}"
{# hint: spacing in the class string matters #}
class="{{ uswds_input_class }}{% if classes %} {{ classes }}{% endif %}"
{% if widget.value != None %}value="{{ widget.value|stringformat:'s' }}"{% endif %}
{% include "django/forms/widgets/attrs.html" %}
/>