wcs: fix card info cell for fields without varname (#48452)
gitea-wip/combo/pipeline/head There was a failure building this commit Details
gitea/combo/pipeline/head Build started... Details

This commit is contained in:
Lauréline Guérin 2020-11-12 09:42:21 +01:00
parent ae38713746
commit 154df07a3c
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
2 changed files with 7 additions and 0 deletions

View File

@ -10,6 +10,7 @@
{% if card %}
{% for field in schema.fields %}
{% if 'varname' in field and field.varname %}
{% with card.fields|get:field.varname as value %}
<p>
<span class="label">{{ field.label }}</span>
@ -22,6 +23,7 @@
{% endif %}
</p>
{% endwith %}
{% endif %}
{% endfor %}
{% else %}
<p>{% trans 'Unknown Card' %}</p>

View File

@ -143,6 +143,11 @@ WCS_CARDDEF_SCHEMA = {
{'label': 'Field B', 'varname': 'fieldb', 'type': 'bool'},
{'label': 'Field C', 'varname': 'fieldc', 'type': 'date'},
{'label': 'Related', 'varname': 'related', 'type': 'item'},
{'label': 'Page', 'type': 'page'},
{'label': 'Comment', 'type': 'comment'},
{'label': 'Title', 'type': 'title'},
{'label': 'Subtitle', 'type': 'subtitle'},
{'label': 'Empty', 'varname': None, 'type': 'string'},
]
}