Fix styling

This commit is contained in:
zandercymatics 2024-01-05 11:27:24 -07:00
parent 2042fd1146
commit 0bbbc895b0
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 29 additions and 8 deletions

View file

@ -25,6 +25,10 @@
color: color('primary-darker');
padding-bottom: units(2px);
}
th.action-col-custom-width {
width: 27% !important;
}
}
.dotgov-table {

View file

@ -41,8 +41,13 @@
<th data-sortable scope="col" role="columnheader">Domain name</th>
<th data-sortable scope="col" role="columnheader">Expires</th>
<th data-sortable scope="col" role="columnheader">Status</th>
<th scope="col" role="columnheader"><span class="usa-sr-only">Action</span></th>
<th scope="col" role="columnheader">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
<th
scope="col"
role="columnheader"
{% if has_deletable_applications %} class="action-col-custom-width" {% else %} class="width-15" {% endif %}
>
<span class="usa-sr-only">Action</span>
</th>
</tr>
</thead>
<tbody>
@ -105,7 +110,9 @@
<th data-sortable scope="col" role="columnheader">Date submitted</th>
<th data-sortable scope="col" role="columnheader">Status</th>
<th scope="col" role="columnheader"><span class="usa-sr-only">Action</span></th>
{% if has_deletable_applications %}
<th scope="col" role="columnheader"><span class="usa-sr-only">Delete Action</span></th>
{% endif %}
</tr>
</thead>
<tbody>
@ -139,6 +146,7 @@
{% endif %}
</a>
</td>
{% if has_deletable_applications %}
<td>
{% if application.status == "started" or application.status == "withdrawn" %}
<a
@ -169,6 +177,7 @@
</div>
{% endif %}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>

View file

@ -18,11 +18,19 @@ def index(request):
domains = Domain.objects.filter(id__in=domain_ids)
context["domains"] = domains
# 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 = (
'<button type="submit" '
'class="usa-button usa-button--secondary" '
'name="delete-application">Yes, delete request</button>'
)
context["modal_button"] = modal_button
return render(request, "home.html", context)