From 01ce2fb8a47a24253228003bdce9b3a2885d3321 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Fri, 13 Sep 2024 11:13:11 -0600 Subject: [PATCH 01/14] Update dates displayed + add created by per figma --- src/registrar/models/domain_request.py | 5 ++ .../templates/domain_request_status.html | 67 ++++++++++++++++--- 2 files changed, 61 insertions(+), 11 deletions(-) diff --git a/src/registrar/models/domain_request.py b/src/registrar/models/domain_request.py index b80e063cde..9817824b89 100644 --- a/src/registrar/models/domain_request.py +++ b/src/registrar/models/domain_request.py @@ -1154,6 +1154,11 @@ def to_dict(self): data[field.name] = field.value_from_object(self) return data + def get_formatted_cisa_rep_name(self): + """Returns the cisa representatives name in Western order.""" + names = [n for n in [self.cisa_representative_first_name, self.cisa_representative_last_name] if n] + return " ".join(names) if names else "Unknown" + def _is_federal_complete(self): # Federal -> "Federal government branch" page can't be empty + Federal Agency selection can't be None return not (self.federal_type is None or self.federal_agency is None) diff --git a/src/registrar/templates/domain_request_status.html b/src/registrar/templates/domain_request_status.html index f4defc14ea..f5519b6bea 100644 --- a/src/registrar/templates/domain_request_status.html +++ b/src/registrar/templates/domain_request_status.html @@ -48,25 +48,70 @@

Domain request for {{ DomainRequest.requested_domain.name }}

Status: - {% if DomainRequest.status == 'approved' %} Approved - {% elif DomainRequest.status == 'in review' %} In review - {% elif DomainRequest.status == 'rejected' %} Rejected - {% elif DomainRequest.status == 'submitted' %} Submitted - {% elif DomainRequest.status == 'ineligible' %} Ineligible - {% else %}ERROR Please contact technical support/dev - {% endif %} + {{ DomainRequest.get_status_display|default:"ERROR Please contact technical support/dev" }}


-

Last updated: {{DomainRequest.updated_at|date:"F j, Y"}}

- + + {% if DomainRequest.creator and DomainRequest.creator != request.user %} +

+ Created by: {{DomainRequest.creator.email|default:DomainRequest.creator.get_formatted_name }} +

+ {% endif %} + + {% with statuses=DomainRequest.DomainRequestStatus last_submitted=DomainRequest.last_submitted_date|date:"F j, Y" first_submitted=DomainRequest.first_submitted_date|date:"F j, Y" %} + {% comment %} + These are intentionally seperated this way. + There is some code repetition, but it gives us more flexibility rather than a dense reduction. + Leave it this way until we've solidified our requirements. + {% endcomment %} + {% if DomainRequest.status == statuses.STARTED %} +

+ Started on: {{DomainRequest.last_status_update|date:"F j, Y"}} +

+ {% elif DomainRequest.status == statuses.SUBMITTED %} +

+ Submitted on: {{last_submitted|default:first_submitted }} +

+

+ Last updated on: {{DomainRequest.updated_at|date:"F j, Y"}} +

+ {% elif DomainRequest.status == statuses.ACTION_NEEDED %} +

+ Submitted on: {{last_submitted|default:first_submitted }} +

+

+ Last updated on: {{DomainRequest.updated_at|date:"F j, Y"}} +

+ {% elif DomainRequest.status == statuses.REJECTED %} +

+ Submitted on: {{last_submitted|default:first_submitted }} +

+

+ Rejected on: {{DomainRequest.last_status_update|date:"F j, Y"}} +

+ {% elif DomainRequest.status == statuses.WITHDRAWN %} +

+ Submitted on: {{last_submitted|default:first_submitted }} +

+

+ Withdrawn on: {{DomainRequest.last_status_update|date:"F j, Y"}} +

+ {% else %} + {% comment %} Shown for in_review, approved, ineligible {% endcomment %} +

+ Last updated on: {{DomainRequest.updated_at|date:"F j, Y"}} +

+ {% endif %} + {% if DomainRequest.status != 'rejected' %}

{% include "includes/domain_request.html" %}

Withdraw request

{% endif %} + {% endwith %}
@@ -141,8 +186,8 @@

Summary of your domain request

{% if DomainRequest %}

CISA Regional Representative