{# @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. #}
{% 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 %}