From 0bbbc895b02f5abf7289ebbf9798768082c1487e Mon Sep 17 00:00:00 2001
From: zandercymatics <141044360+zandercymatics@users.noreply.github.com>
Date: Fri, 5 Jan 2024 11:27:24 -0700
Subject: [PATCH] Fix styling
---
src/registrar/assets/sass/_theme/_tables.scss | 4 ++++
src/registrar/templates/home.html | 13 ++++++++++--
src/registrar/views/index.py | 20 +++++++++++++------
3 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/src/registrar/assets/sass/_theme/_tables.scss b/src/registrar/assets/sass/_theme/_tables.scss
index 6dcc6f3bc..6a52a5d08 100644
--- a/src/registrar/assets/sass/_theme/_tables.scss
+++ b/src/registrar/assets/sass/_theme/_tables.scss
@@ -25,6 +25,10 @@
color: color('primary-darker');
padding-bottom: units(2px);
}
+
+ th.action-col-custom-width {
+ width: 27% !important;
+ }
}
.dotgov-table {
diff --git a/src/registrar/templates/home.html b/src/registrar/templates/home.html
index b5bef3b71..62bbc3ac6 100644
--- a/src/registrar/templates/home.html
+++ b/src/registrar/templates/home.html
@@ -41,8 +41,13 @@
Domain name |
Expires |
Status |
- Action |
- |
+
+ Action
+ |
@@ -105,7 +110,9 @@
Date submitted |
Status |
Action |
+ {% if has_deletable_applications %}
Delete Action |
+ {% endif %}
@@ -139,6 +146,7 @@
{% endif %}
+ {% if has_deletable_applications %}
{% if application.status == "started" or application.status == "withdrawn" %}
{% endif %}
|
+ {% endif %}
{% endfor %}
diff --git a/src/registrar/views/index.py b/src/registrar/views/index.py
index a4a8e3d90..5996c27f6 100644
--- a/src/registrar/views/index.py
+++ b/src/registrar/views/index.py
@@ -18,11 +18,19 @@ def index(request):
domains = Domain.objects.filter(id__in=domain_ids)
context["domains"] = domains
- modal_button = (
- ''
- )
- context["modal_button"] = modal_button
+ # 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)
+ context["has_deletable_applications"] = has_deletable_applications
+
+ if has_deletable_applications:
+ modal_button = (
+ ''
+ )
+
+
+ context["modal_button"] = modal_button
return render(request, "home.html", context)