From 0ae2cb72e3d60b40a97700b9e4741e1129612160 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Fri, 5 Jan 2024 14:45:37 -0700 Subject: [PATCH] CSS changes --- src/registrar/assets/sass/_theme/_tables.scss | 2 +- .../assets/sass/_theme/_usa-modal.scss | 12 +++++++++ src/registrar/assets/sass/_theme/styles.scss | 1 + src/registrar/templates/home.html | 26 ++++++++++++++----- src/registrar/templates/includes/modal.html | 2 +- src/registrar/views/index.py | 3 ++- 6 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 src/registrar/assets/sass/_theme/_usa-modal.scss diff --git a/src/registrar/assets/sass/_theme/_tables.scss b/src/registrar/assets/sass/_theme/_tables.scss index 65fb8b487..f3adab18b 100644 --- a/src/registrar/assets/sass/_theme/_tables.scss +++ b/src/registrar/assets/sass/_theme/_tables.scss @@ -27,7 +27,7 @@ } th.action-col-custom-width { - width: 27% !important; + width: 23.25% !important; } // Fix margins in mobile view diff --git a/src/registrar/assets/sass/_theme/_usa-modal.scss b/src/registrar/assets/sass/_theme/_usa-modal.scss new file mode 100644 index 000000000..7106f1961 --- /dev/null +++ b/src/registrar/assets/sass/_theme/_usa-modal.scss @@ -0,0 +1,12 @@ +@use "uswds-core" as *; + +.usa-modal.wider-modal { + width: 40% !important; + max-width: 40% !important; +} + +.usa-modal { + .usa-modal__heading.blue-header{ + color: $dhs-blue; + } +} \ No newline at end of file diff --git a/src/registrar/assets/sass/_theme/styles.scss b/src/registrar/assets/sass/_theme/styles.scss index 8a2e1d2d3..499f9a806 100644 --- a/src/registrar/assets/sass/_theme/styles.scss +++ b/src/registrar/assets/sass/_theme/styles.scss @@ -17,6 +17,7 @@ @forward "tables"; @forward "sidenav"; @forward "register-form"; +@forward "usa-modal"; /*-------------------------------------------------- --- Admin ---------------------------------*/ diff --git a/src/registrar/templates/home.html b/src/registrar/templates/home.html index da9212bea..4e7e9729b 100644 --- a/src/registrar/templates/home.html +++ b/src/registrar/templates/home.html @@ -48,6 +48,9 @@ > Action + {% if has_deletable_applications %} + + {% endif %} @@ -86,6 +89,9 @@ {% endif %} + {% if has_deletable_applications %} + + {% endif %} {% endfor %} @@ -119,7 +125,13 @@ {% for application in domain_applications %} - {{ application.requested_domain.name|default:"New domain request" }} + {% if application.requested_domain and application.requested_domain.name %} + {{ application.requested_domain.name }} + {% elif forloop.counter != 1 %} + New domain request {{ forloop.counter }} + {% else %} + New domain request + {% endif %} {% if application.submission_date %} @@ -135,7 +147,7 @@ - Edit {{ application.requested_domain.name|default:"New domain request" }} + Edit {{ application.requested_domain.name|default:"New domain request"|add:forloop.counter|add:"" }} {% else %} @@ -163,16 +175,18 @@
- {% with heading="Are you sure you want to delete "|add:application.requested_domain.name|add:"?" %} - {% include 'includes/modal.html' with modal_heading=heading modal_description="This will remove the domain request from the .gov registrar. This action cannot be undone." modal_button=modal_button|safe %} - {% endwith %} + {% if application.requested_domain %} + {% include 'includes/modal.html' with modal_heading="Are you sure you want to delete "|add:application.requested_domain.name|add:"?" modal_description="This will remove the domain request from the .gov registrar. This action cannot be undone." modal_button=modal_button|safe %} + {% else %} + {% include 'includes/modal.html' with modal_heading="Are you sure you want to delete your domain request?" modal_description="This will remove the domain request from the .gov registrar. This action cannot be undone." modal_button=modal_button|safe %} + {% endif %}
{% endif %} diff --git a/src/registrar/templates/includes/modal.html b/src/registrar/templates/includes/modal.html index 1f9fbcfd4..a5ae4b1f2 100644 --- a/src/registrar/templates/includes/modal.html +++ b/src/registrar/templates/includes/modal.html @@ -2,7 +2,7 @@
-
diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py index 43f251d47..75a3944a6 100644 --- a/src/registrar/views/index.py +++ b/src/registrar/views/index.py @@ -21,7 +21,7 @@ def index(request): # Determine if the user will see applications that they can delete valid_statuses = [DomainApplication.ApplicationStatus.STARTED, DomainApplication.ApplicationStatus.WITHDRAWN] - has_deletable_applications = applications.filter(status__in=valid_statuses) + has_deletable_applications = applications.filter(status__in=valid_statuses).exists() context["has_deletable_applications"] = has_deletable_applications if has_deletable_applications: @@ -32,4 +32,5 @@ def index(request): ) context["modal_button"] = modal_button + return render(request, "home.html", context)