{% from "components/dataset_icon.html" import dataset_icon %} {% from "components/export_action.html" import export_action %} {% macro symbol(name) -%} {%- endmacro %} {% macro callout(reason) -%}

{{ symbol(reason.icon) }}{{ reason.text }}

{%- endmacro %} {% macro dataset_card(card, href, reason=none, export=false) -%} {% set dataset = card.dataset %}

{{ dataset.name }}

{{ dataset.kind|capitalize }}
{{ dataset_icon(dataset.icon, kind=dataset.kind) }}
{{ symbol('ellipsis') }}
{% if dataset.description %}

{{ dataset.description }}

{% endif %}
{% if card.version %}V{{ card.version.number }} · {{ card.record_count }} {{ 'record' if card.record_count == 1 else 'records' }} {% else %}{{ 'Draft' if card.has_draft else 'No Current version' }}{% endif %}
{% if reason %}
{{ callout(reason) }} {% if reason.note %}

{{ reason.note }}

{% endif %} {% if card.reasons|length > 1 %}

+{{ card.reasons|length - 1 }} more: {% for extra in card.reasons if extra != reason %}{{ extra.label }}{% if not loop.last %} · {% endif %}{% endfor %}

{% endif %}
{% endif %} {% if export and card.may_export %}
{{ export_action(dataset=dataset, version_state={'version': card.version}, label='Export', may_export=card.may_export, may_import=card.may_maintain) }}
{% endif %}
{%- endmacro %} {% macro section_heading(title, count=none, href=none, id=none) -%}
{{ title }}{% if count is not none %} {{ count }}{% endif %}{% if href or caller is defined %}
{% if href %}View all {{ symbol('arrow-right') }}{% endif %}{{ caller() if caller is defined else '' }}
{% endif %}
{%- endmacro %} {% macro owner_switch(all_owners, action, reason=none) -%}
{% if reason %}{% endif %}
{%- endmacro %}