{# @description The card a dataset is drawn as in a listing: banner, type and counts, title, contributors, abstract, keywords and identifier. The whole card is one link to the dataset. #} {# @prop object:text | description:"The dataset, loaded with DatasetQuerySet.with_list_data()." #} {% load i18n static thumbnail %} {% comment %} Dataset card for the public listing (#333), mirroring `project/project_card.html` and sharing its `record-card` classes, so change both together. Drawn directly because `cotton/components/object_card.html` uses Bootstrap-era classes that no longer resolve. It reflows on its own width (`@container`), and its stylesheet is linked once from base.html, never here. Data comes from `DatasetQuerySet.with_list_data()` and `with_contributors()`; a field that neither prefetches adds a query per card. {% endcomment %} {# The reflow lives on this wrapper: a container query is answered by an ancestor, so `.record-card` cannot respond to its own width. #}
{# Every card has a media block so listings stay aligned. An imageless dataset gets a tinted icon panel, not a placeholder file, which would 404. #}
{% if object.image %} {% else %} {% endif %}
{# Only the positive case of `published` is shown, as an unpublished dataset is the ordinary case and a badge on each is noise. #} {% translate "Dataset" %} {% if object.published %} {% translate "Published" %} {% endif %} {% if object.published %} {# Counts are shown only for published datasets, as a size is data a visitor has no right to see before release. #} {% if object.sample_count %} {% blocktrans count counter=object.sample_count %} {{ counter }} sample {% plural %} {{ counter }} samples {% endblocktrans %} {% else %} {% translate "No samples" %} {% endif %} {% if object.measurement_count %} {% blocktrans count counter=object.measurement_count %} {{ counter }} measurement {% plural %} {{ counter }} measurements {% endblocktrans %} {% else %} {% translate "No measurements" %} {% endif %} {% endif %}

{{ object.name }}

{% with summary=object.get_abstract_summary %} {% if summary %} {# Plain text, escaped like any string. Never `|safe`: the source markdown is user-authored. #}

{{ summary }}

{% endif %} {% endwith %} {% if object.keywords.all %}
{# Badges, not links: keyword filters are named from a setting, so there is no stable query parameter. #} {% for keyword in object.keywords.all %} {{ keyword.display_label }} {% endfor %}
{% endif %}