combo/combo/apps/wcs/templates/combo/wcs/cards-field.html

36 lines
1.6 KiB
HTML

{% spaceless %}
{% if item.varname == "@custom@" %}
{% if item.template %}
{% with card.custom_fields|get:item.template|force_escape as value %}
{% if not ul_display %}<td>{% endif %}{{ value }}{% if not ul_display %}</td>{% endif %}
{% endwith %}
{% endif %}
{% elif item.varname == "@link@" %}
{% if item.template and item.page|default:item.url_template %}
{% with item.page|default:item.url_template as url_key %}
{% with card.custom_fields|get:item.template|force_escape as link_label and card.urls|get:url_key|force_escape as link_url %}
{% if not ul_display %}<td>{% endif %}
{% if link_label and link_url %}
<a href="{{ link_url }}"{% if item.display_mode == 'button' %} class="pk-button"{% endif %}>{{ link_label }}</a>
{% endif %}
{% if not ul_display %}</td>{% endif %}
{% endwith %}
{% endwith %}
{% endif %}
{% else %}
{% if item.varname %}
{% with fields_by_varnames|get:item.varname as field %}
{% if field %}
{% with card.fields|get:item.varname as value %}
{% if value %}
{% if not ul_display %}<td>{% endif %}{% include "combo/wcs/card-field-value.html" with mode='inline' %}{% if not ul_display %}</td>{% endif %}
{% else %}
{% if not ul_display %}<td>{% endif %}{% include "combo/wcs/card-field-value.html" with mode='inline' value=item.empty_value %}{% if not ul_display %}</td>{% endif %}
{% endif %}
{% endwith %}
{% endif %}
{% endwith %}
{% endif %}
{% endif %}
{% endspaceless %}