combo/combo/apps/wcs/templates/combo/wcs/card-field-value.html

30 lines
1.2 KiB
HTML

{% load combo %}{% spaceless %}
{% if field.type == "text" and field.display_mode == 'rich' and value %}
{% if cell.display_mode == 'table' or cell.display_mode == 'card' and item.display_mode == 'text' %}
<div class="value">{{ value|safe }}</div>
{% else %}
{{ value|striptags }}
{% endif %}
{% elif field.type == "text" and mode != 'inline' and value %}
<div class="value">{{ field|format_text:value }}</div>
{% else %}
{% if not mode == 'inline' %}<div class="value">{% endif %}
{% if field.type == "date" %}
{{ value|date }}
{% elif field.type == "bool" and value is not None %}
{{ value|yesno }}
{% elif field.type == "email" and value is not None %}
<a class="pk-card-field-email" href="mailto:{{ value }}">{{ value }}</a>
{% elif field.type == 'file' and value %}
{% if value.content_type|startswith:"image/" %}
<img alt="" src="{% make_public_url url=value.url %}">
{% else %}
<a class="pk-card-field-filename" href="{% make_public_url url=value.url %}" download="{{ value.filename }}">{{ value.filename }}</a>
{% endif %}
{% else %}
{{ value|default:""|urlize }}
{% endif %}
{% if not mode == 'inline' %}</div>{% endif %}
{% endif %}
{% endspaceless %}