Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Fs 4159 tasklist content (#573)
Browse files Browse the repository at this point in the history
* fs-4159 updated tasklist content

* fs-4155 updating links

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixing tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
srh-sloan and pre-commit-ci[bot] authored Feb 23, 2024
1 parent 6713332 commit d3c264f
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 34 deletions.
14 changes: 9 additions & 5 deletions app/blueprints/assessments/models/fund_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,15 @@ def create_round_summaries(fund: Fund, filters: LandingFilters) -> list[RoundSum
round_short_name=round.short_name.lower(),
report_type="ASSESSOR_EXPORT",
)
assessment_tracker_href = url_for(
"assessment_bp.assessor_export",
fund_short_name=fund.short_name,
round_short_name=round.short_name.lower(),
report_type="OUTPUT_TRACKER",
assessment_tracker_href = (
url_for(
"assessment_bp.assessor_export",
fund_short_name=fund.short_name,
round_short_name=round.short_name.lower(),
report_type="OUTPUT_TRACKER",
)
if fund.short_name.upper() != "COF-EOI"
else None
)
feedback_export_href = (
url_for(
Expand Down
24 changes: 13 additions & 11 deletions app/blueprints/assessments/templates/assessor_tasklist.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,21 @@ <h2 class="govuk-heading-l govuk-!-margin-top-8">All uploaded documents</h2>
) }}
{% endif %}

<h2 class="govuk-heading-l govuk-!-margin-top-8">Unscored</h2>
{% if state.criterias|length > 0 %}<h2 class="govuk-heading-l govuk-!-margin-top-8">Unscored</h2>{% endif %}
{% for section in state.sections %}
{{ section_element(section.name, section.sub_criterias, application_id) }}
{% endfor %}
<h2 class="govuk-heading-l govuk-!-margin-top-8">Scored</h2>
<p class="govuk-body">Assess all responses under each sub criteria.</p>
{% for criteria in state.criterias %}
{% set name_classes = "govuk-heading-m govuk-!-margin-bottom-2" %}
{% if loop.index > 0 %}
{% set name_classes = "govuk-heading-m govuk-!-margin-bottom-2 govuk-!-margin-top-8" %}
{% endif %}
{{ criteria_element(criteria, name_classes, application_id, max_possible_sub_criteria_score) }}
{{ section_element(section.name, section.sub_criterias, application_id, show_caption=(state.fund_short_name.upper() != "COF-EOI")) }}
{% endfor %}
{% if state.criterias|length > 0 %}
<h2 class="govuk-heading-l govuk-!-margin-top-8">Scored</h2>
<p class="govuk-body">Assess all responses under each sub criteria.</p>
{% for criteria in state.criterias %}
{% set name_classes = "govuk-heading-m govuk-!-margin-bottom-2" %}
{% if loop.index > 0 %}
{% set name_classes = "govuk-heading-m govuk-!-margin-bottom-2 govuk-!-margin-top-8" %}
{% endif %}
{{ criteria_element(criteria, name_classes, application_id, max_possible_sub_criteria_score) }}
{% endfor %}
{% endif %}
</div>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@
</br>
</br>
<a class="govuk-link" href="{{ feedback_export_href }}">
Export applicants feedback information
Export feedback survey responses
</a>
{% endif %}
{% endif %}
</br>
</br>
<a class="govuk-link" href="{{ assessment_tracker_href }}">
Assessment Tracker Export
</a>
{% if assessment_tracker_href %}
</br>
</br>
<a class="govuk-link" href="{{ assessment_tracker_href }}">
Assessment Tracker Export
</a>
{% endif %}
{% endif %}
{% endmacro %}

Expand Down
8 changes: 4 additions & 4 deletions app/templates/macros/banner_summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<div class="govuk-grid-column-two-thirds govuk-!-padding-0">
<p class="govuk-heading-xl fsd-banner-content">Fund: <span class="govuk-!-font-weight-regular">{{ fund_name }}</span></p>
<p class="govuk-heading-l fsd-banner-content">Project reference: <span class="govuk-!-font-weight-regular">{{ project_reference | format_project_ref }}</span></p>
<p class="govuk-body-l fsd-banner-content fsd-banner-collapse-padding">Project name: {{ project_name }}</p>

{% if fund_shortname not in ("DPIF",) %} {# Funds that should hide total funding requested. #}
{% set project_name_caption = "Project name:" if fund_shortname not in ["COF-EOI"] else "Organisation name:" %}
<p class="govuk-body-l fsd-banner-content fsd-banner-collapse-padding">{{project_name_caption}}&nbsp;{{ project_name }}</p>
{% if fund_shortname not in ["DPIF", "COF-EOI"] %} {# Funds that should hide total funding requested. #}
<p class="govuk-body-l fsd-banner-content ">Total funding requested: £{{ "{:,.2f}".format(funding_amount_requested | float) }}</p>
{% endif %}

{% if g.access_controller.has_any_assessor_role and display_status %}
<p><strong class="govuk-tag govuk-tag--grey govuk-!-margin-top-4">{{ assessment_status }}</strong>
{% if fund_shortname.upper() != "COF-EOI" %}<p><strong class="govuk-tag govuk-tag--grey govuk-!-margin-top-4">{{ assessment_status }}</strong>{% endif %}
{% if "Flagged" in flag_status or flag_status in ["Multiple flags to resolve", "Stopped", "Flagged"] %}
<p class="govuk-body-l fsd-banner-content fsd-banner-collapse-padding govuk-!-margin-top-3">{{ flag_status or "" }}</p>
{% endif %}
Expand Down
21 changes: 14 additions & 7 deletions tests/test_jinja_macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,13 +546,16 @@ def test_theme_mapping_works_based_on_meta_key(self, request_ctx, clazz, argumen
assert expected_unique_id in rendered_html, "Unique ID not found"

@pytest.mark.parametrize(
"fund_short_name, show_funding_amount_requested",
"fund_short_name, show_funding_amount_requested, project_name_caption,show_assessment_status",
[
("TFID", True),
("DPIF", False),
("TFID", True, "Project name:", True),
("DPIF", False, "Project name:", True),
("COF-EOI", False, "Organisation name:", False),
],
)
def test_banner_summary_macro(self, request_ctx, fund_short_name, show_funding_amount_requested):
def test_banner_summary_macro(
self, request_ctx, fund_short_name, show_funding_amount_requested, project_name_caption, show_assessment_status
):
fund_name = "Test Fund"
project_reference = "TEST123"
project_name = "Test Project"
Expand Down Expand Up @@ -586,7 +589,7 @@ def test_banner_summary_macro(self, request_ctx, fund_short_name, show_funding_a
assert soup.find(
"p",
class_="govuk-body-l fsd-banner-content fsd-banner-collapse-padding",
text="Project name: Test Project",
text=f"{project_name_caption}\xa0Test Project",
), "Project name not found"

funding_amount_requested_element = soup.find(
Expand All @@ -599,11 +602,15 @@ def test_banner_summary_macro(self, request_ctx, fund_short_name, show_funding_a
else:
assert not funding_amount_requested_element, "Funding amount found"

assert soup.find(
assessment_status_element = soup.find(
"strong",
class_="govuk-tag",
text="Submitted",
), "Assessment status not found"
)
if show_assessment_status:
assert assessment_status_element, "Assessment status not found"
else:
assert not assessment_status_element, "Assessment status found when not expected"
assert soup.find("p", class_="fsd-banner-content", text="Flagged"), "Flag status not found"

def test_stopped_flag_macro(self, request_ctx):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_route_landing_export_link_visibility(
access_controller=access_controller_mock,
export_href="/assess/assessor_export/TF/tr/ASSESSOR_EXPORT",
feedback_export_href="/assess/feedback_export/TF/tr",
assessment_tracker_href="",
assessment_tracker_href="/assess/tracker",
round_application_fields_download_available=download_available,
sorting_date="",
assessment_stats=Stats(
Expand Down

0 comments on commit d3c264f

Please sign in to comment.