{% from "common/macros/status.html" import reportStatusTag with context %}
{% from "govuk_frontend_jinja/components/summary-list/macro.html" import govukSummaryList %}
{% from "govuk_frontend_jinja/components/tag/macro.html" import govukTag %}
{% macro collection_card(collection) %}
{% set can_edit = authorisation_helper.can_edit_collection(current_user, collection.id) %}
{% set grant = collection.grant %}
{% set formSectionsText %}
{% if can_edit %}
{% if collection.forms | length == 0 %}
{# TODO: in the next commit the collection type will be included to any url for collection pages like add section, change name, etc. #}
{# appropriate language for each context will then be swapped out as needed #}
Add sections to {{ collection.name }}
to create your {{ collection.type.constants.singular }}
Sections are groups of questions with a common theme
{% else %}
{% trans count = collection.forms | length %}{{ count }} section{% pluralize %}{{ count }} sections{% endtrans %}
in form for {{ collection.name }}
{% endif %}
{% else %}
{% trans count = collection.forms | length %}{{ count }} section{% pluralize %}{{ count }} sections{% endtrans %}
in form for {{ collection.name }}
{% endif %}
{% endset %}
{% set dataSetsHtml %}
{% trans count = collection.data_sources | length %}{{ count }} data set{% pluralize %}{{ count }} data sets{% endtrans %}
for {{ collection.name }}
{% if collections_with_missing_data_data_sets and collection.id in collections_with_missing_data_data_sets %}
{{ govukTag({"text": "Data missing", "classes": "govuk-tag--orange govuk-!-margin-left-1"}) }}
{% endif %}
{% endset %}
{% set liveSubmissionsText %}
{% trans count = collection.live_submissions | length %}{{ count }} live submission{% pluralize %}{{ count }} live submissions{% endtrans %}
for {{ collection.name }}
{% endset %}
{% set testSubmissionsText %}
{% trans count = collection.test_submissions | length %}{{ count }} test submission{% pluralize %}{{ count }} test submissions{% endtrans %}
for {{ collection.name }}
{% endset %}
{% set submissionsHtml %}