{% load assets i18n %}
{% block cell-content %}
{% if not card_not_found %}
{% block cell-header %}
{% if title %}
{{ title|force_escape }}
{% endif %}
{% include "combo/asset_picture_fragment.html" %}
{% endblock %}
{% if card.id %}
{% spaceless %}
{% if cell.custom_schema %}
{% if cell.custom_schema.cells %}
{% with cell.get_custom_schema as custom_schema %}
{% for item in custom_schema.cells %}
{% if item.varname == "@custom@" and item.template %}
{% with card.custom_fields|get:item.template|force_escape as value %}
{% if item.display_mode == "title" %}
{{ value }}
{% elif item.display_mode == "subtitle" %}
{{ value }}
{% elif item.display_mode == "label" %}
{{ value }}
{% elif item.display_mode == "text" %}
{{ value }}
{% endif %}
{% endwith %}
{% else %}
{% with fields_by_varnames|get:item.varname as field %}
{% if field %}
{% with card.fields|get:item.varname as value %}
{% if item.display_mode == "title" %}
{% include "combo/wcs/card-field-as-title.html" with title_tag="h3" %}
{% elif item.display_mode == "subtitle" %}
{% include "combo/wcs/card-field-as-title.html" with title_tag="h4" %}
{% elif item.display_mode == "text" %}
{% if value or item.empty_value == '@empty@' %}
{% include "combo/wcs/card-field-as-text.html" %}
{% elif item.empty_value != '@skip@' and item.empty_value != '@empty@' %}
{% with item.empty_value as value %}
{% include "combo/wcs/card-field-as-text.html" %}
{% endwith %}
{% endif %}
{% endif %}
{% endwith %}
{% endif %}
{% endwith %}
{% endif %}
{% endfor%}
{% endwith %}
{% endif %}
{% else %}
{% for field in schema.fields %}
{% if 'varname' in field and field.varname %}
{% with card.fields|get:field.varname as value %}
{{ field.label }}
{% include "combo/wcs/card-field-value.html" %}