mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-01 07:26:34 +02:00
Finishing or canceling a request redirects to domain request view
This commit is contained in:
parent
2939c89e0d
commit
3c3fd26b93
3 changed files with 57 additions and 17 deletions
|
@ -16,6 +16,24 @@
|
||||||
<use xlink:href="{%static 'img/sprite.svg'%}#arrow_back"></use>
|
<use xlink:href="{%static 'img/sprite.svg'%}#arrow_back"></use>
|
||||||
</svg><span class="margin-left-05">Previous step</span>
|
</svg><span class="margin-left-05">Previous step</span>
|
||||||
</a>
|
</a>
|
||||||
|
{% else %}
|
||||||
|
{% if portfolio %}
|
||||||
|
{% url 'domain-requests' as url_2 %}
|
||||||
|
<nav class="usa-breadcrumb padding-top-0" aria-label="Domain request breadcrumb">
|
||||||
|
<ol class="usa-breadcrumb__list">
|
||||||
|
<li class="usa-breadcrumb__list-item">
|
||||||
|
<a href="{{ url_2 }}" class="usa-breadcrumb__link"><span>Domain requests</span></a>
|
||||||
|
</li>
|
||||||
|
<li class="usa-breadcrumb__list-item usa-current" aria-current="page">
|
||||||
|
{% if requested_domain__name %}
|
||||||
|
<span>{{ requested_domain__name }}</span>
|
||||||
|
{% else %}
|
||||||
|
<span>Start a new domain request</span>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% block form_messages %}
|
{% block form_messages %}
|
||||||
|
|
|
@ -13,23 +13,33 @@
|
||||||
Otherwise, lets just redirect back to home.
|
Otherwise, lets just redirect back to home.
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
{% if portfolio %}
|
{% if portfolio %}
|
||||||
{% url 'domain-requests' as url%}
|
{% url 'domain-requests' as url %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% url 'home' as url%}
|
{% url 'home' as url %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="{{ url }}" class="breadcrumb__back">
|
{% if portfolio %}
|
||||||
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img">
|
<nav class="usa-breadcrumb padding-top-0" aria-label="Domain request breadcrumb">
|
||||||
<use xlink:href="{% static 'img/sprite.svg' %}#arrow_back"></use>
|
<ol class="usa-breadcrumb__list">
|
||||||
</svg>
|
<li class="usa-breadcrumb__list-item">
|
||||||
|
<a href="{{ url }}" class="usa-breadcrumb__link"><span>Domain requests</span></a>
|
||||||
|
</li>
|
||||||
|
<li class="usa-breadcrumb__list-item usa-current" aria-current="page">
|
||||||
|
<span>{{ DomainRequest.requested_domain.name }}</span
|
||||||
|
>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
{% else %}
|
||||||
|
<a href="{{ url }}" class="breadcrumb__back">
|
||||||
|
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img">
|
||||||
|
<use xlink:href="{% static 'img/sprite.svg' %}#arrow_back"></use>
|
||||||
|
</svg>
|
||||||
|
|
||||||
<p class="margin-left-05 margin-top-0 margin-bottom-0 line-height-sans-1">
|
<p class="margin-left-05 margin-top-0 margin-bottom-0 line-height-sans-1">
|
||||||
{% if portfolio %}
|
Back to manage your domains
|
||||||
Back to manage your domains requests
|
</p>
|
||||||
{% else %}
|
</a>
|
||||||
Back to manage your domains
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
<h1>Domain request for {{ DomainRequest.requested_domain.name }}</h1>
|
<h1>Domain request for {{ DomainRequest.requested_domain.name }}</h1>
|
||||||
<div
|
<div
|
||||||
class="usa-summary-box dotgov-status-box margin-top-3 padding-left-2"
|
class="usa-summary-box dotgov-status-box margin-top-3 padding-left-2"
|
||||||
|
|
|
@ -402,6 +402,10 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
|
||||||
def get_context_data(self):
|
def get_context_data(self):
|
||||||
"""Define context for access on all wizard pages."""
|
"""Define context for access on all wizard pages."""
|
||||||
|
|
||||||
|
requested_domain_name = None
|
||||||
|
if self.domain_request.requested_domain is not None:
|
||||||
|
requested_domain_name = self.domain_request.requested_domain.name
|
||||||
|
|
||||||
context_stuff = {}
|
context_stuff = {}
|
||||||
if DomainRequest._form_complete(self.domain_request, self.request):
|
if DomainRequest._form_complete(self.domain_request, self.request):
|
||||||
modal_button = '<button type="submit" ' 'class="usa-button" ' ">Submit request</button>"
|
modal_button = '<button type="submit" ' 'class="usa-button" ' ">Submit request</button>"
|
||||||
|
@ -418,6 +422,7 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
|
||||||
You’ll only be able to withdraw your request.",
|
You’ll only be able to withdraw your request.",
|
||||||
"review_form_is_complete": True,
|
"review_form_is_complete": True,
|
||||||
"user": self.request.user,
|
"user": self.request.user,
|
||||||
|
"requested_domain__name": requested_domain_name,
|
||||||
}
|
}
|
||||||
else: # form is not complete
|
else: # form is not complete
|
||||||
modal_button = '<button type="button" class="usa-button" data-close-modal>Return to request</button>'
|
modal_button = '<button type="button" class="usa-button" data-close-modal>Return to request</button>'
|
||||||
|
@ -433,6 +438,7 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
|
||||||
Return to the request and visit the steps that are marked as "incomplete."',
|
Return to the request and visit the steps that are marked as "incomplete."',
|
||||||
"review_form_is_complete": False,
|
"review_form_is_complete": False,
|
||||||
"user": self.request.user,
|
"user": self.request.user,
|
||||||
|
"requested_domain__name": requested_domain_name,
|
||||||
}
|
}
|
||||||
return context_stuff
|
return context_stuff
|
||||||
|
|
||||||
|
@ -512,7 +518,10 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
|
||||||
# if user opted to save progress and return,
|
# if user opted to save progress and return,
|
||||||
# return them to the home page
|
# return them to the home page
|
||||||
if button == "save_and_return":
|
if button == "save_and_return":
|
||||||
return HttpResponseRedirect(reverse("home"))
|
if request.user.is_org_user(request):
|
||||||
|
return HttpResponseRedirect(reverse("domain-requests"))
|
||||||
|
else:
|
||||||
|
return HttpResponseRedirect(reverse("home"))
|
||||||
# otherwise, proceed as normal
|
# otherwise, proceed as normal
|
||||||
return self.goto_next_step()
|
return self.goto_next_step()
|
||||||
|
|
||||||
|
@ -781,7 +790,10 @@ class DomainRequestWithdrawn(DomainRequestPermissionWithdrawView):
|
||||||
domain_request = DomainRequest.objects.get(id=self.kwargs["pk"])
|
domain_request = DomainRequest.objects.get(id=self.kwargs["pk"])
|
||||||
domain_request.withdraw()
|
domain_request.withdraw()
|
||||||
domain_request.save()
|
domain_request.save()
|
||||||
return HttpResponseRedirect(reverse("home"))
|
if self.request.user.is_org_user(self.request):
|
||||||
|
return HttpResponseRedirect(reverse("domain-requests"))
|
||||||
|
else:
|
||||||
|
return HttpResponseRedirect(reverse("home"))
|
||||||
|
|
||||||
|
|
||||||
class DomainRequestDeleteView(DomainRequestPermissionDeleteView):
|
class DomainRequestDeleteView(DomainRequestPermissionDeleteView):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue