Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.6.155 - Remove accordions from Dashboard #913

Merged
merged 11 commits into from
Feb 25, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ <h2 class="govuk-heading-l amp-margin-bottom-5">{{ retest_page }}</h2>
<div class="govuk-grid-column-full amp-markdown">
{% if hide_fixed %}
{% if retest_page.unfixed_check_results %}
<table class="govuk-table amp-accordion-table">
<table class="govuk-table">
{% include 'audits/helpers/equality_body_retest_page_comparison_table.html' with retest_check_results=retest_page.unfixed_check_results %}
</table>
{% else %}
<p class="govuk-body-m">No unfixed issues</p>
{% endif %}
{% else %}
<table class="govuk-table amp-accordion-table">
<table class="govuk-table">
{% include 'audits/helpers/equality_body_retest_page_comparison_table.html' with retest_check_results=retest_page.all_check_results %}
</table>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ <h2 id="deleted-pages"class="govuk-heading-l amp-margin-bottom-5">Removed pages<
<div class="govuk-grid-column-full">
{% include 'common/amp_form_snippet.html' %}
</div>
{% include 'cases/helpers/save_continue_cancel.html' %}
</div>
{% include 'cases/helpers/save_continue_cancel.html' %}
</form>
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ class MockForm:
cleaned_data: dict[str, str]


def decode_csv_response(response: HttpResponse) -> tuple[list[str], list[list[str]]]:
"""Decode CSV HTTP response and break into column names and data"""
content: str = response.content.decode("utf-8")
csv_reader: Any = csv.reader(io.StringIO(content))
csv_body: list[list[str]] = list(csv_reader)
csv_header: list[str] = csv_body.pop(0)
return csv_header, csv_body


def validate_csv_response(
csv_header: list[str],
csv_body: list[list[str]],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{% if tense == "future" %}
<strong>{{ date_to_tag|amp_date }}</strong>
{{ date_to_tag|amp_date_trunc }}
{% else %}
<div>
<strong class="govuk-tag govuk-tag--red">{{ date_to_tag|amp_date }}</strong>
<strong class="govuk-tag govuk-tag--red">{{ date_to_tag|amp_date_trunc }}</strong>
<span class="govuk-visually-hidden">{% if tense == "past" %}over{% endif %}due</span>
<span class="amp-alert-icon" aria-hidden="true">!</span>
</div>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from ..utils import ( # pylint: disable=relative-beyond-top-level
amp_format_date,
amp_format_trunc_date,
amp_format_datetime,
undo_double_escapes,
)
Expand Down Expand Up @@ -47,6 +48,12 @@ def amp_date(date_to_format: date) -> str:
return amp_format_date(date_to_format)


@register.filter
def amp_date_trunc(date_to_format: date) -> str:
"""Format truncated date according to GDS style guide"""
return amp_format_trunc_date(date_to_format)


@register.filter
def amp_datetime(datetime_to_format: datetime) -> str:
"""Format date and time according to GDS style guide"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_active_qa_auditor_present(admin_client):
assert response.status_code == 200
assertContains(
response,
f"""<div class="govuk-heading-xl amp-margin-bottom-0">{USER_FIRST_NAME}</div>""",
f"""<p class="govuk-body govuk-!-font-size-16 amp-margin-bottom-10">{USER_FIRST_NAME}</p>""",
html=True,
)

Expand Down
5 changes: 5 additions & 0 deletions accessibility_monitoring_platform/apps/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ def amp_format_date(date_to_format: date) -> str:
return f"{date_to_format:%-d %B %Y}" if date_to_format else ""


def amp_format_trunc_date(date_to_format: date) -> str:
"""Format date according to GDS style guide"""
return f"{date_to_format:%-d %b %Y}" if date_to_format else ""


def amp_format_time(datetime_to_format: datetime) -> str:
"""Format time according to GDS style guide"""
return f"{datetime_to_format:%-I:%M%p}".lower() if datetime_to_format else ""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% if cases|length == 0 %}
<p class="govuk-body">There are currently no cases in after 12-week correspondence</p>
{% else %}
<table class="govuk-table amp-accordion-table">
<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header amp-width-one-quarter">Update acknowledged</th>
<th scope="col" class="govuk-table__header amp-width-15-percent">Update acknowledged</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Case</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Full URL</th>
{% if show_all_cases %}
Expand All @@ -17,8 +17,8 @@
<tbody class="govuk-table__body">
{% for case in cases %}
<tr class="govuk-table__row ">
<th scope="row" class="govuk-table__header amp-width-one-quarter">
{{ case.twelve_week_correspondence_acknowledged_date| amp_date }}
<th scope="row" class="govuk-table__header amp-width-15-percent govuk-!-font-weight-regular">
{{ case.twelve_week_correspondence_acknowledged_date| amp_date_trunc }}
</th>
<td class="govuk-table__cell amp-width-one-quarter">
<a href="{{ case.get_absolute_url }}" class="govuk-link">{{case.organisation_name|truncatechars:25}}</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% if cases|length == 0 %}
<p class="govuk-body"> There are currently no cases in final decision due</p>
{% else %}
<table class="govuk-table amp-accordion-table">
<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header amp-width-one-quarter">12-week review date</th>
<th scope="col" class="govuk-table__header amp-width-15-percent">12-week review date</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Case</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Full URL</th>
{% if show_all_cases %}
Expand All @@ -17,8 +17,8 @@
<tbody class="govuk-table__body">
{% for case in cases %}
<tr class="govuk-table__row ">
<th scope="row" class="govuk-table__header amp-width-one-quarter">
{{ case.report_followup_week_12_due_date|amp_date }}
<th scope="row" class="govuk-table__header amp-width-15-percent govuk-!-font-weight-regular">
{{ case.report_followup_week_12_due_date|amp_date_trunc }}
</th>
<td class="govuk-table__cell amp-width-one-quarter">
<a href="{{ case.get_absolute_url }}" class="govuk-link"> {{case.organisation_name|truncatechars:25}} </a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% if cases|length == 0 %}
<p class="govuk-body">There are currently no cases in correspondence</p>
{% else %}
<table class="govuk-table amp-accordion-table">
<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header amp-width-one-quarter">12-week review date</th>
<th scope="col" class="govuk-table__header amp-width-15-percent">12-week review date</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Case</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Full URL</th>
{% if show_all_cases %}
Expand All @@ -17,8 +17,8 @@
<tbody class="govuk-table__body">
{% for case in cases %}
<tr class="govuk-table__row ">
<th scope="row" class="govuk-table__header amp-width-one-quarter">
{{ case.report_followup_week_12_due_date|amp_date }}
<th scope="row" class="govuk-table__header amp-width-15-percent govuk-!-font-weight-regular">
{{ case.report_followup_week_12_due_date|amp_date_trunc }}
</th>
<td class="govuk-table__cell amp-width-one-quarter">
<a href="{{ case.get_absolute_url }}" class="govuk-link"> {{case.organisation_name|truncatechars:25}} </a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% if all_cases_in_qa|length == 0 %}
<p class="govuk-body">There are currently no reports in QA</p>
{% else %}
<table class="govuk-table amp-accordion-table">
<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header amp-width-one-quarter">Date created</th>
<th scope="col" class="govuk-table__header amp-width-15-percent">Date created</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Case</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">QA status</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Auditor</th>
Expand All @@ -13,8 +13,8 @@
<tbody class="govuk-table__body">
{% for case in all_cases_in_qa %}
<tr class="govuk-table__row ">
<th scope="row" class="govuk-table__header amp-width-one-quarter">
{{ case.created|amp_date }}
<th scope="row" class="govuk-table__header amp-width-15-percent govuk-!-font-weight-regular">
{{ case.created|amp_date_trunc }}
</th>
<td class="govuk-table__cell amp-width-one-quarter">
<a href="{% url 'cases:edit-qa-auditor' case.id %}" class="govuk-link">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
{% if cases|length == 0 %}
<p class="govuk-body"> There are currently no new cases </p>
{% else %}
<table class="govuk-table amp-accordion-table">
<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header amp-width-one-quarter">Date created</th>
<th scope="col" class="govuk-table__header amp-width-15-percent">Date created</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Case</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Full URL</th>
{% if show_all_cases %}
Expand All @@ -18,7 +18,7 @@
<tbody class="govuk-table__body">
{% for case in cases %}
<tr class="govuk-table__row ">
<th scope="row" class="govuk-table__header amp-width-one-quarter">{{ case.created|amp_date }}</th>
<th scope="row" class="govuk-table__header amp-width-15-percent govuk-!-font-weight-regular">{{ case.created|amp_date_trunc }}</th>
<td class="govuk-table__cell amp-width-one-quarter">
<a href="{{ case.get_absolute_url }}" class="govuk-link">{{ case.organisation_name|truncatechars:25 }}</a>
</td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% if cases|length == 0 %}
<p class="govuk-body"> There are currently no tests in progress </p>
{% else %}
<table class="govuk-table amp-accordion-table">
<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row amp-width-one-quarter">
<th scope="col" class="govuk-table__header amp-width-one-quarter">Date created</th>
<th scope="col" class="govuk-table__header amp-width-15-percent">Date created</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Case</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Full URL</th>
{% if show_all_cases %}
Expand All @@ -17,14 +17,16 @@
<tbody class="govuk-table__body">
{% for case in cases %}
<tr class="govuk-table__row">
<th scope="row" class="govuk-table__header amp-width-one-quarter">{{ case.created|amp_date }} </th>
<th scope="row" class="govuk-table__header amp-width-15-percent govuk-!-font-weight-regular">{{ case.created|amp_date_trunc }} </th>
<td class="govuk-table__cell amp-width-one-quarter">
<a href="{{ case.get_absolute_url }}" class="govuk-link">{{ case.organisation_name|truncatechars:25 }}</a>
</td>
<td class="govuk-table__cell amp-width-one-quarter">{{ case.domain|truncatechars:25 }}</td>
<td class="govuk-table__cell amp-width-one-quarter">
{% if show_all_cases %}
<a href="{% url 'cases:case-list' %}?auditor={{ case.auditor.id }}" class="govuk-link"> {{ case.auditor.get_full_name }} </a>
{% elif case.audit %}
<a href="{% url 'audits:edit-audit-metadata' case.audit.id %}" class="govuk-link"> Testing details </a>
{% else %}
<a href="{% url 'cases:edit-test-results' case.id %}" class="govuk-link"> Testing details </a>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% if cases|length == 0 %}
<p class="govuk-body"> There are currently no reports in progress </p>
{% else %}
<table class="govuk-table amp-accordion-table">
<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header amp-width-one-quarter">Date created</th>
<th scope="col" class="govuk-table__header amp-width-15-percent">Date created</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Case</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Full URL</th>
{% if show_all_cases %}
Expand All @@ -17,7 +17,7 @@
<tbody class="govuk-table__body">
{% for case in cases %}
<tr class="govuk-table__row ">
<th scope="row" class="govuk-table__header amp-width-one-quarter"> {{ case.created|amp_date }} </th>
<th scope="row" class="govuk-table__header amp-width-15-percent govuk-!-font-weight-regular"> {{ case.created|amp_date_trunc }} </th>
<td class="govuk-table__cell amp-width-one-quarter">
<a href="{{ case.get_absolute_url }}" class="govuk-link">{{ case.organisation_name|truncatechars:25 }}</a>
</td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% if cases|length == 0 %}
<p class="govuk-body"> There are currently no cases in QA </p>
{% else %}
<table class="govuk-table amp-accordion-table">
<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header amp-width-one-quarter">Date created</th>
<th scope="col" class="govuk-table__header amp-width-15-percent">Date created</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Case</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Full URL</th>
{% if show_all_cases %}
Expand All @@ -17,7 +17,7 @@
<tbody class="govuk-table__body">
{% for case in cases %}
<tr class="govuk-table__row ">
<th scope="row" class="govuk-table__header amp-width-one-quarter">{{ case.created|amp_date }}</th>
<th scope="row" class="govuk-table__header amp-width-15-percent govuk-!-font-weight-regular">{{ case.created|amp_date_trunc }}</th>
<td class="govuk-table__cell amp-width-one-quarter">
<a href="{{ case.get_absolute_url }}" class="govuk-link">{{ case.organisation_name|truncatechars:25 }}</a>
</td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% if cases|length == 0 %}
<p class="govuk-body"> There are currently no cases in ready to send </p>
{% else %}
<table class="govuk-table amp-accordion-table">
<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header amp-width-one-quarter">Date created</th>
<th scope="col" class="govuk-table__header amp-width-15-percent">Date created</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Case</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Full URL</th>
{% if show_all_cases %}
Expand All @@ -17,7 +17,7 @@
<tbody class="govuk-table__body">
{% for case in cases %}
<tr class="govuk-table__row ">
<th scope="row" class="govuk-table__header amp-width-one-quarter">{{ case.created|amp_date }}</th>
<th scope="row" class="govuk-table__header amp-width-15-percent">{{ case.created|amp_date_trunc }}</th>
<td class="govuk-table__cell amp-width-one-quarter">
<a href="{{ case.get_absolute_url }}" class="govuk-link">{{case.organisation_name|truncatechars:25}}</a>
</td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% if cases|length == 0 %}
<p class="govuk-body"> There are currently no cases in report sent </p>
{% else %}
<table class="govuk-table amp-accordion-table">
<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header amp-width-one-quarter">Next action due</th>
<th scope="col" class="govuk-table__header amp-width-15-percent">Next action due</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Case</th>
<th scope="col" class="govuk-table__header amp-width-one-quarter">Full URL</th>
{% if show_all_cases %}
Expand All @@ -17,7 +17,7 @@
<tbody class="govuk-table__body">
{% for case in cases %}
<tr class="govuk-table__row ">
<td scope="row" class="govuk-table__cell amp-width-one-quarter">
<td scope="row" class="govuk-table__cell amp-width-one-15-percent govuk-!-font-weight-regular">
{% include "common/amp_date_tag.html" with date_to_tag=case.next_action_due_date tense=case.next_action_due_date_tense %}
</td>
<td class="govuk-table__cell amp-width-one-quarter">
Expand Down
Loading
Loading