mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 02:36:02 +02:00
cancel button, template tweaks
This commit is contained in:
parent
43b6d1e380
commit
37ada699a0
4 changed files with 33 additions and 13 deletions
|
@ -55,7 +55,7 @@ class DomainNameserverForm(forms.Form):
|
|||
server = forms.CharField(label="Name server", strip=True)
|
||||
|
||||
ip = IPAddressField(
|
||||
label="IP address",
|
||||
label="IP Address (IPv4 or IPv6)",
|
||||
strip=True,
|
||||
required=False,
|
||||
# validators=[
|
||||
|
|
|
@ -11,8 +11,16 @@
|
|||
|
||||
<h1>DNS name servers</h1>
|
||||
|
||||
<p>Before your domain can be used we'll need information about your domain
|
||||
name servers.</p>
|
||||
<p>Before your domain can be used we’ll need information about your domain name servers. Name server records indicate which DNS server is authoritative for your domain.</p>
|
||||
|
||||
<p>Add a name server record by entering the address (e.g., ns1.nameserver.com) in the name server fields below. You may add up to 13 name servers.</p>
|
||||
|
||||
<div class="usa-alert usa-alert--slim usa-alert--info">
|
||||
<div class="usa-alert__body">
|
||||
<p class="margin-top-0">Add an IP address only when your name server's address includes your domain name (e.g., if your domain name is "example.gov" and your name server is "ns1.example.gov,” then an IP address is required.) To add multiple IP addresses, separate them with commas.</p>
|
||||
<p class="margin-bottom-0">This step is uncommon unless you self-host your DNS or use custom addresses for your nameserver.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% include "includes/required_fields.html" %}
|
||||
|
||||
|
@ -36,7 +44,7 @@
|
|||
{% endwith %}
|
||||
</div>
|
||||
<div class="tablet:grid-col-6">
|
||||
{% with sublabel_text="Example: ns"|concat:forloop.counter|concat:".example.com" add_group_class="usa-form-group--unstyled-error" %}
|
||||
{% with sublabel_text="Ex: 86.124.49.54 or 2001:db8::1234:5678" %}
|
||||
{% input_with_errors form.ip %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
|
@ -44,7 +52,7 @@
|
|||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<button type="button" class="usa-button usa-button--unstyled display-block" id="add-nameserver-form">
|
||||
<button type="button" class="usa-button usa-button--unstyled display-block margin-bottom-2" id="add-nameserver-form">
|
||||
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24" height="24">
|
||||
<use xlink:href="{%static 'img/sprite.svg'%}#add_circle"></use>
|
||||
</svg><span class="margin-left-05">Add another name server</span>
|
||||
|
@ -57,4 +65,13 @@
|
|||
</button>
|
||||
</form>
|
||||
|
||||
<form aria-label="form to undo changes to the Name Servers">
|
||||
<button
|
||||
type="submit"
|
||||
class="usa-button usa-button--outline btn-cancel"
|
||||
name="btn-cancel-click"
|
||||
aria-label="Reset the data in the Name Server form to the registry state (undo changes)"
|
||||
>Cancel
|
||||
</button>
|
||||
</form>
|
||||
{% endblock %} {# domain_content #}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="usa-alert usa-alert--{{ message.tags }} usa-alert--slim margin-bottom-2">
|
||||
<div class="usa-alert usa-alert--{{ message.tags }} usa-aler margin-bottom-2">
|
||||
<div class="usa-alert__body">
|
||||
{{ message }}
|
||||
</div>
|
||||
|
|
|
@ -255,7 +255,6 @@ class DomainNameserversView(DomainFormBaseView, BaseFormSet):
|
|||
for i, form in enumerate(formset):
|
||||
# form = self.get_form(self, **kwargs)
|
||||
form.fields["server"].label += f" {i+1}"
|
||||
form.fields["ip"].label += f" {i+1}"
|
||||
if i < 2:
|
||||
form.fields["server"].required = True
|
||||
else:
|
||||
|
@ -270,11 +269,15 @@ class DomainNameserversView(DomainFormBaseView, BaseFormSet):
|
|||
This post method harmonizes using DomainBaseView and FormMixin
|
||||
"""
|
||||
self._get_domain(request)
|
||||
form = self.get_form()
|
||||
if form.is_valid():
|
||||
return self.form_valid(form)
|
||||
formset = self.get_form()
|
||||
|
||||
if "btn-cancel-click" in request.POST:
|
||||
return redirect("/", {"formset": formset}, RequestContext(request))
|
||||
|
||||
if formset.is_valid():
|
||||
return self.form_valid(formset)
|
||||
else:
|
||||
return self.form_invalid(form)
|
||||
return self.form_invalid(formset)
|
||||
|
||||
def form_valid(self, formset):
|
||||
"""The formset is valid, perform something with it."""
|
||||
|
@ -320,7 +323,7 @@ class DomainNameserversView(DomainFormBaseView, BaseFormSet):
|
|||
logger.error(f"Registry error: {Err}")
|
||||
else:
|
||||
messages.success(
|
||||
self.request, "The name servers for this domain have been updated."
|
||||
self.request, "The name servers for this domain have been updated. Keep in mind that DNS changes may take some time to propagate across the internet. It can take anywhere from a few minutes to 48 hours for your changes to take place."
|
||||
)
|
||||
|
||||
# superclass has the redirect
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue