Improve form: required fields

This commit is contained in:
Neil Martinsen-Burrell 2023-05-01 12:30:21 -05:00
parent 2c525c3887
commit df6525c5b4
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184
2 changed files with 18 additions and 5 deletions

View file

@ -224,10 +224,10 @@ class Domain(TimeStampedModel):
TODO: call EPP to get this info instead of returning fake data.
"""
return [
# reserved example IPs
"192.0.2.1",
"198.51.100.2",
"203.0.113.3",
# reserved example domain
"ns1.example.com",
"ns2.example.com",
"ns3.example.com",
]
def set_nameservers(self, new_nameservers: List[str]):

View file

@ -6,12 +6,25 @@
{% block domain_content %}
<h1>Domain name servers</h1>
<p>Before your domain can be used we'll need information about your domain
name servers.</p>
<p><a href="{% url "todo" %}">Get help with domain servers.</a></p>
{% include "includes/required_fields.html" %}
<form class="usa-form usa-form--large" method="post" novalidate>
{% csrf_token %}
{{ formset.management_form }}
{% for form in formset %}
{% input_with_errors form.server %}
{% if forloop.counter <= 2 %}
{% with attr_required=True %}
{% input_with_errors form.server %}
{% endwith %}
{% else %}
{% input_with_errors form.server %}
{% endif %}
{% endfor %}
<button