wcs: add css classes to emails and filenames values (#69351)

This commit is contained in:
Frédéric Péters 2022-09-21 10:19:59 +02:00
parent 8aade8287b
commit 498f0db67e
1 changed files with 2 additions and 2 deletions

View File

@ -8,12 +8,12 @@
{% elif field.type == "bool" and value is not None %}
{{ value|yesno }}
{% elif field.type == "email" and value is not None %}
<a href="mailto:{{ value }}">{{ value }}</a>
<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 href="{% make_public_url url=value.url %}" download="{{ value.filename }}">{{ value.filename }}</a>
<a class="pk-card-field-filename" href="{% make_public_url url=value.url %}" download="{{ value.filename }}">{{ value.filename }}</a>
{% endif %}
{% else %}
{{ value|default:""|urlize }}