diff --git a/src/registrar/assets/sass/_theme/_base.scss b/src/registrar/assets/sass/_theme/_base.scss index 9d2ed4177..a6132312d 100644 --- a/src/registrar/assets/sass/_theme/_base.scss +++ b/src/registrar/assets/sass/_theme/_base.scss @@ -225,3 +225,7 @@ abbr[title] { .break-word { word-break: break-word; } + +.dhs-red-50 { + color: $dhs-red-50; +} diff --git a/src/registrar/assets/sass/_theme/_cisa_colors.scss b/src/registrar/assets/sass/_theme/_cisa_colors.scss index 23ecf7989..2bf045333 100644 --- a/src/registrar/assets/sass/_theme/_cisa_colors.scss +++ b/src/registrar/assets/sass/_theme/_cisa_colors.scss @@ -63,6 +63,7 @@ $dhs-red-90: #080102; $dhs-red-80: #37050d; $dhs-red-70: #660919; $dhs-red-60: #950e24; +$dhs-red-50: #C41131; $dhs-red: #c41230; $dhs-red-40: #d24b62; $dhs-red-30: #e08493; diff --git a/src/registrar/config/urls.py b/src/registrar/config/urls.py index 9b9ed569e..4dcb4d056 100644 --- a/src/registrar/config/urls.py +++ b/src/registrar/config/urls.py @@ -169,6 +169,11 @@ urlpatterns = [ views.DomainRequestStatus.as_view(), name="domain-request-status", ), + path( + "domain-request/viewonly/", + views.DomainRequestStatusViewOnly.as_view(), + name="domain-request-status-viewonly", + ), path( "domain-request//withdraw", views.DomainRequestWithdrawConfirmation.as_view(), diff --git a/src/registrar/models/domain_request.py b/src/registrar/models/domain_request.py index 101534034..39cf9e5fb 100644 --- a/src/registrar/models/domain_request.py +++ b/src/registrar/models/domain_request.py @@ -1190,7 +1190,7 @@ class DomainRequest(TimeStampedModel): def _is_creator_complete(self): return self.creator is not None - def _is_organization_name_and_address_complete(self): + def is_organization_name_and_address_complete(self): return not ( self.organization_name is None and self.address_line1 is None @@ -1258,7 +1258,7 @@ class DomainRequest(TimeStampedModel): def _is_general_form_complete(self, request): return ( self._is_creator_complete() - and self._is_organization_name_and_address_complete() + and self.is_organization_name_and_address_complete() and self._is_senior_official_complete() and self._is_requested_domain_complete() and self._is_purpose_complete() diff --git a/src/registrar/templates/domain_request_status.html b/src/registrar/templates/domain_request_status.html index 8bc083835..5f6624f15 100644 --- a/src/registrar/templates/domain_request_status.html +++ b/src/registrar/templates/domain_request_status.html @@ -1,207 +1,10 @@ {% extends 'base.html' %} - {% load custom_filters %} - -{% block title %}Domain request status | {{ DomainRequest.requested_domain.name }} | {% endblock %} {% load static url_helpers %} +{% block title %}Domain request status | {{ DomainRequest.requested_domain.name }} | {% endblock %} + + {% block content %} -
-
- {% if portfolio %} - {% url 'domain-requests' as url %} - {% else %} - {% url 'home' as url %} - {% endif %} - - -

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

-
-
-

- - Status: - - {{ DomainRequest.get_status_display|default:"ERROR Please contact technical support/dev" }} -

-
-
-
- - {% with statuses=DomainRequest.DomainRequestStatus last_submitted=DomainRequest.last_submitted_date|date:"F j, Y" first_submitted=DomainRequest.first_submitted_date|date:"F j, Y" last_status_update=DomainRequest.last_status_update|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 %} - {% with first_started_date=DomainRequest.get_first_status_started_date|date:"F j, Y" %} -

- {% comment %} - A newly created domain request will not have a value for last_status update. - This is because the status never really updated. - However, if this somehow goes back to started we can default to displaying that new date. - {% endcomment %} - Started on: {{last_status_update|default:first_started_date}} -

- {% endwith %} - {% 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: {{last_status_update}} -

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

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

-

- Withdrawn on: {{last_status_update}} -

- {% 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 %} -
- -
-

Summary of your domain request

- {% with heading_level='h3' %} - {% with org_type=DomainRequest.get_generic_org_type_display %} - {% include "includes/summary_item.html" with title='Type of organization' value=org_type heading_level=heading_level %} - {% endwith %} - - {% if DomainRequest.tribe_name %} - {% include "includes/summary_item.html" with title='Tribal government' value=DomainRequest.tribe_name heading_level=heading_level %} - - {% if DomainRequest.federally_recognized_tribe %} -

Federally-recognized tribe

- {% endif %} - - {% if DomainRequest.state_recognized_tribe %} -

State-recognized tribe

- {% endif %} - - {% endif %} - - {% if DomainRequest.get_federal_type_display %} - {% include "includes/summary_item.html" with title='Federal government branch' value=DomainRequest.get_federal_type_display heading_level=heading_level %} - {% endif %} - - {% if DomainRequest.is_election_board %} - {% with value=DomainRequest.is_election_board|yesno:"Yes,No,Incomplete" %} - {% include "includes/summary_item.html" with title='Election office' value=value heading_level=heading_level %} - {% endwith %} - {% endif %} - - {% if DomainRequest.organization_name %} - {% include "includes/summary_item.html" with title='Organization name and mailing address' value=DomainRequest address='true' heading_level=heading_level %} - {% endif %} - - {% if DomainRequest.about_your_organization %} - {% include "includes/summary_item.html" with title='About your organization' value=DomainRequest.about_your_organization heading_level=heading_level %} - {% endif %} - - {% if DomainRequest.senior_official %} - {% include "includes/summary_item.html" with title='Senior official' value=DomainRequest.senior_official contact='true' heading_level=heading_level %} - {% endif %} - - {% if DomainRequest.current_websites.all %} - {% include "includes/summary_item.html" with title='Current websites' value=DomainRequest.current_websites.all list='true' heading_level=heading_level %} - {% endif %} - - {% if DomainRequest.requested_domain %} - {% include "includes/summary_item.html" with title='.gov domain' value=DomainRequest.requested_domain heading_level=heading_level %} - {% endif %} - - {% if DomainRequest.alternative_domains.all %} - {% include "includes/summary_item.html" with title='Alternative domains' value=DomainRequest.alternative_domains.all list='true' heading_level=heading_level %} - {% endif %} - - {% if DomainRequest.purpose %} - {% include "includes/summary_item.html" with title='Purpose of your domain' value=DomainRequest.purpose heading_level=heading_level %} - {% endif %} - - {% if DomainRequest.creator %} - {% include "includes/summary_item.html" with title='Your contact information' value=DomainRequest.creator contact='true' heading_level=heading_level %} - {% endif %} - - {% if DomainRequest.other_contacts.all %} - {% include "includes/summary_item.html" with title='Other employees from your organization' value=DomainRequest.other_contacts.all contact='true' list='true' heading_level=heading_level %} - {% else %} - {% include "includes/summary_item.html" with title='Other employees from your organization' value=DomainRequest.no_other_contacts_rationale heading_level=heading_level %} - {% endif %} - - {# We always show this field even if None #} - {% if DomainRequest %} -

CISA Regional Representative

-
    - {% if DomainRequest.cisa_representative_first_name %} - {{ DomainRequest.get_formatted_cisa_rep_name }} - {% else %} - No - {% endif %} -
- -

Anything else

-
    - {% if DomainRequest.anything_else %} - {{DomainRequest.anything_else}} - {% else %} - No - {% endif %} -
- {% endif %} - {% endwith %} -
- -
+ {% include "includes/domain_request_status_manage.html" %} {% endblock %} diff --git a/src/registrar/templates/domain_request_status_viewonly.html b/src/registrar/templates/domain_request_status_viewonly.html new file mode 100644 index 000000000..8b5de5475 --- /dev/null +++ b/src/registrar/templates/domain_request_status_viewonly.html @@ -0,0 +1,10 @@ +{% extends 'base.html' %} +{% load custom_filters %} +{% load static url_helpers %} + +{% block title %}Domain request status | {{ DomainRequest.requested_domain.name }} | {% endblock %} + + +{% block content %} + {% include "includes/domain_request_status_view.html" %} +{% endblock %} diff --git a/src/registrar/templates/includes/contact.html b/src/registrar/templates/includes/contact.html index 68c243558..9cd1f8dd3 100644 --- a/src/registrar/templates/includes/contact.html +++ b/src/registrar/templates/includes/contact.html @@ -1,6 +1,14 @@ +{% if contact %}
{{ contact.get_formatted_name }}
{% if contact.title %}{{ contact.title }}
{% endif %} {% if contact.email %}{{ contact.email }}
{% endif %} {% if contact.phone %}{{ contact.phone.as_national }}{% endif %}
+{% else %} + {% if custom_text_for_value_none %} + {{ custom_text_for_value_none }} + {% else %} + None + {% endif %} +{% endif %} diff --git a/src/registrar/templates/includes/domain_request_status_manage.html b/src/registrar/templates/includes/domain_request_status_manage.html new file mode 100644 index 000000000..b1edebe6c --- /dev/null +++ b/src/registrar/templates/includes/domain_request_status_manage.html @@ -0,0 +1,198 @@ +{% load custom_filters %} +{% load static url_helpers %} +
+
+ {% block breadcrumb %} + {% if portfolio %} + {% url 'domain-requests' as url %} + {% else %} + {% url 'home' as url %} + {% endif %} + + {% endblock breadcrumb %} + + {% block header %} +

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

+ {% endblock header %} + + {% block status_summary %} +
+
+

+ + Status: + + {{ DomainRequest.get_status_display|default:"ERROR Please contact technical support/dev" }} +

+
+
+
+ + {% with statuses=DomainRequest.DomainRequestStatus last_submitted=DomainRequest.last_submitted_date|date:"F j, Y" first_submitted=DomainRequest.first_submitted_date|date:"F j, Y" last_status_update=DomainRequest.last_status_update|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 %} + {% with first_started_date=DomainRequest.get_first_status_started_date|date:"F j, Y" %} +

+ {% comment %} + A newly created domain request will not have a value for last_status update. + This is because the status never really updated. + However, if this somehow goes back to started we can default to displaying that new date. + {% endcomment %} + Started on: {{last_status_update|default:first_started_date}} +

+ {% endwith %} + {% 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: {{last_status_update}} +

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

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

+

+ Withdrawn on: {{last_status_update}} +

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

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

+ {% endif %} + {% endwith %} + {% endblock status_summary %} + + {% block modify_request %} + {% if DomainRequest.status != 'rejected' %} +

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

+

+ Withdraw request +

+ {% endif %} + {% endblock modify_request %} +
+ +
+ {% block request_summary_header %} +

Summary of your domain request

+ {% endblock request_summary_header%} + + {% block request_summary %} + {% with heading_level='h3' %} + {% with org_type=DomainRequest.get_generic_org_type_display %} + {% include "includes/summary_item.html" with title='Type of organization' value=org_type heading_level=heading_level %} + {% endwith %} + + {% if DomainRequest.show_tribal_government %} + {% include "includes/summary_item.html" with title='Tribal government' value=DomainRequest.tribe_name heading_level=heading_level custom_text_for_value_none="Incomplete" %} + + {% if DomainRequest.federally_recognized_tribe %} +

Federally-recognized tribe

+ {% endif %} + + {% if DomainRequest.state_recognized_tribe %} +

State-recognized tribe

+ {% endif %} + {% endif %} + + {% if DomainRequest.show_organization_federal %} + {% include "includes/summary_item.html" with title='Federal government branch' value=DomainRequest.get_federal_type_display heading_level=heading_level custom_text_for_value_none="Incomplete" %} + {% endif %} + + {% if DomainRequest.show_organization_election %} + {% with value=DomainRequest.is_election_board|yesno:"Yes,No,Incomplete" %} + {% include "includes/summary_item.html" with title='Election office' value=value heading_level=heading_level %} + {% endwith %} + {% endif %} + + {% if not portfolio %} + {% include "includes/summary_item.html" with title='Organization name and mailing address' value=DomainRequest address='true' heading_level=heading_level custom_text_for_value_none="Incomplete" %} + {% endif %} + + {% if DomainRequest.show_about_your_organization %} + {% include "includes/summary_item.html" with title='About your organization' value=DomainRequest.about_your_organization heading_level=heading_level custom_text_for_value_none="Incomplete" %} + {% endif %} + + {% include "includes/summary_item.html" with title='Senior official' value=DomainRequest.senior_official contact='true' heading_level=heading_level custom_text_for_value_none="Incomplete" %} + + {% include "includes/summary_item.html" with title='Current websites' value=DomainRequest.current_websites.all list='true' heading_level=heading_level %} + + {% include "includes/summary_item.html" with title='.gov domain' value=DomainRequest.requested_domain heading_level=heading_level custom_text_for_value_none="Incomplete" %} + + {% include "includes/summary_item.html" with title='Alternative domains' value=DomainRequest.alternative_domains.all list='true' heading_level=heading_level %} + + {% include "includes/summary_item.html" with title='Purpose of your domain' value=DomainRequest.purpose heading_level=heading_level custom_text_for_value_none="Incomplete" %} + + {% if DomainRequest.other_contacts.all %} + {% include "includes/summary_item.html" with title='Other employees from your organization' value=DomainRequest.other_contacts.all contact='true' list='true' heading_level=heading_level custom_text_for_value_none="Incomplete" %} + {% else %} + {% include "includes/summary_item.html" with title='Other employees from your organization' value=DomainRequest.no_other_contacts_rationale heading_level=heading_level custom_text_for_value_none="Incomplete" %} + {% endif %} + + {# We always show this field even if None #} + {% if DomainRequest %} +

CISA Regional Representative

+
    + {% if DomainRequest.cisa_representative_first_name %} + {{ DomainRequest.get_formatted_cisa_rep_name }} + {% else %} + No + {% endif %} +
+ +

Anything else

+
    + {% if DomainRequest.anything_else %} + {{DomainRequest.anything_else}} + {% else %} + No + {% endif %} +
+ {% endif %} + {% endwith %} + {% endblock request_summary %} +
+
\ No newline at end of file diff --git a/src/registrar/templates/includes/domain_request_status_view.html b/src/registrar/templates/includes/domain_request_status_view.html new file mode 100644 index 000000000..244842321 --- /dev/null +++ b/src/registrar/templates/includes/domain_request_status_view.html @@ -0,0 +1,7 @@ +{% extends 'includes/domain_request_status_manage.html' %} +{% load custom_filters %} +{% load static url_helpers %} + +{% comment %} Do not show the withdraw button {% endcomment %} +{% block modify_request %} +{% endblock modify_request %} \ No newline at end of file diff --git a/src/registrar/templates/includes/organization_address.html b/src/registrar/templates/includes/organization_address.html index c0baf3c9f..720700e81 100644 --- a/src/registrar/templates/includes/organization_address.html +++ b/src/registrar/templates/includes/organization_address.html @@ -1,3 +1,4 @@ +{% if organization.is_organization_name_and_address_complete %}
{% if organization.federal_agency %} {{ organization.federal_agency }}
@@ -25,4 +26,11 @@ {% if organization.urbanization %}
{{ organization.urbanization }} {% endif %} -
\ No newline at end of file + +{% else %} + {% if custom_text_for_value_none %} + {{ custom_text_for_value_none }} + {% else %} + None + {% endif %} +{% endif %} \ No newline at end of file diff --git a/src/registrar/templates/includes/summary_item.html b/src/registrar/templates/includes/summary_item.html index f69bbaf96..bde83db8c 100644 --- a/src/registrar/templates/includes/summary_item.html +++ b/src/registrar/templates/includes/summary_item.html @@ -43,7 +43,7 @@ {% endfor %} {% elif custom_text_for_value_none %} -

+

{{ custom_text_for_value_none }}

{% else %} @@ -96,15 +96,18 @@ {% endif %} {% else %} -

{% if value %} - {{ value }} +

+ {{ value }} +

{% elif custom_text_for_value_none %} +

+ {{ value }} +

{{ custom_text_for_value_none }} {% else %} None {% endif %} -

{% endif %} diff --git a/src/registrar/views/domain_request.py b/src/registrar/views/domain_request.py index 5fed89215..b2b65a5b4 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -749,6 +749,38 @@ class Finished(DomainRequestWizard): class DomainRequestStatus(DomainRequestPermissionView): template_name = "domain_request_status.html" + def has_permission(self): + """ + Override of the base has_permission class to account for portfolio permissions + """ + has_base_perms = super().has_permission() + if not has_base_perms: + return False + + if self.request.user.is_org_user(self.request): + portfolio = self.request.session.get("portfolio") + if not self.request.user.has_edit_request_portfolio_permission(portfolio): + return False + + return True + + +class DomainRequestStatusViewOnly(DomainRequestPermissionView): + template_name = "domain_request_status_viewonly.html" + def has_permission(self): + """ + Override of the base has_permission class to account for portfolio permissions + """ + has_base_perms = super().has_permission() + if not has_base_perms: + return False + + if self.request.user.is_org_user(self.request): + portfolio = self.request.session.get("portfolio") + if not self.request.user.has_view_all_requests_portfolio_permission(portfolio): + return False + + return True class DomainRequestWithdrawConfirmation(DomainRequestPermissionWithdrawView): diff --git a/src/registrar/views/domain_requests_json.py b/src/registrar/views/domain_requests_json.py index bc880cdaf..840a67f73 100644 --- a/src/registrar/views/domain_requests_json.py +++ b/src/registrar/views/domain_requests_json.py @@ -121,7 +121,7 @@ def serialize_domain_request(request, domain_request, user): action_url_map = { "Edit": reverse("edit-domain-request", kwargs={"id": domain_request.id}), "Manage": reverse("domain-request-status", kwargs={"pk": domain_request.id}), - "View": "#", + "View": reverse("domain-request-status-viewonly", kwargs={"pk": domain_request.id}), } svg_icon_map = {"Edit": "edit", "Manage": "settings", "View": "visibility"}