{# @description The card a project is drawn as in a listing: banner, type and status, title, contributors, abstract, keywords and identifier. The whole card is one link to the project. #} {# @prop object:text | description:"The project, loaded with ProjectQuerySet.with_list_data() and with_contributors()." #} {% load i18n static thumbnail %} {% comment %} Project card for the public listing (#330), drawn directly because `cotton/components/object_card.html` uses Bootstrap-era classes that no longer resolve. The `record-card` classes are shared with the dataset card, so change both together. The card reflows on its own width (`@container`), and its stylesheet is linked once from base.html, never here. Data comes from `ProjectQuerySet.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 project gets a tinted icon panel, not a placeholder file, which would 404. #}
{% if object.image %} {% else %} {% endif %}
{% translate "Project" %} {{ object.get_status_display }} {% if object.dataset_count %} {% blocktrans count counter=object.dataset_count %} {{ counter }} dataset {% plural %} {{ counter }} datasets {% endblocktrans %} {% else %} {% translate "No datasets" %} {% endif %}

{{ object.title }}

{% if object.contributors.all %}
{# `for` is passed explicitly, or the component falls back to `request.user` and draws the visitor's avatar. #} {% for contribution in object.contributors.all|slice:":4" %} {% endfor %}
{% for contribution in object.contributors.all|slice:":3" %} {{ contribution.contributor }}{% if not forloop.last %}, {% endif %} {% endfor %} {% endif %} {% if object.owner %} {{ object.owner }} {% endif %}
{% 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 %}