{# A card whose body is a grid of small tiles -- one per object, built by add_tiles(). #} {# #} {# Escaping: every field a tile shows is escaped by this template except `heading_html`, #} {# which is the one field rendered as-is and is named so that a caller putting user-entered #} {# text through it is making an obvious mistake rather than an invisible one. Nothing here is #} {# blanket-|safe'd: a heading that is markup has to be passed as `heading_html` deliberately, #} {# and a heading that is text stays text however it is spelled. #} {# #} {# The chrome is in cards/css/cards.css (.django-card__tile*), which the card emits once per #} {# request; only the per-card tile width is inline, as a custom property the stylesheet reads.#}
{% if show_header %}{% if card.title or card.menu %}{# nested: `and` binds tighter than `or` #}
{% if card.header_icon %} {% endif %}{{ card.title }}
{{ card.menu.render }} {% include 'cards/standard/_reload_button.html' %} {% if card.enable_collapse %}
{% endif %}
{% endif %}{% endif %} {{ card.tab_menu.render }}
{% for tile in card.extra_card_info.tiles %}
{# Always drawn, never on hover: the pencil is what tells a reader the tile can #} {# be edited at all. image_gallery reveals its own on hover, and that was found #} {# to hide the affordance, so it is deliberately not copied here. #} {% if tile.edit_url %} {% endif %} {# The one unescaped field, and only when the caller asked for it by name. #} {% if tile.heading_html %}
{{ tile.heading_html|safe }}
{% elif tile.heading %}
{{ tile.heading }}
{% endif %} {% if tile.subheading %}
{{ tile.subheading }}
{% endif %} {% if tile.meta_lines %}
{% for line in tile.meta_lines %}{{ line.text }}
{% endfor %}
{% endif %} {% if tile.image_url %} {{ tile.tooltip|default:tile.heading|default:'' }} {% endif %} {% if tile.badge %}
{{ tile.badge }}
{% endif %}
{% empty %} {% if card.extra_card_info.tiles_empty_message %}

{{ card.extra_card_info.tiles_empty_message }}

{% endif %} {% endfor %}
{% if card.footer %} {% endif %} {% if card.created_modified_dates %} {% endif %} {% include 'cards/standard/_reload_script.html' %}