{# -*- coding: utf-8 -*- This file is part of Invenio. Copyright (C) 2023 CERN. Invenio is free software; you can redistribute it and/or modify it under the terms of the MIT License; see LICENSE file for more details. #} {% macro list_vocabulary_values(values) %} {% if values.title_l10n is defined %} {{ values.title_l10n }} {% else %} {% for value in values %} {{ value.title_l10n }}{{ ", " if not loop.last }} {% endfor %} {% endif %} {% endmacro %} {% macro list_string_values(values) %} {% for value in values %} {{ value }}{{ ", " if not loop.last }} {% endfor %} {% endmacro %} {% macro show_custom_field(value, config) %} {% if value is string %}
{{ value | safe }}
{% elif value is boolean %}
{% if value %} {{ config.props.trueLabel}} {% else %} {{ config.props.falseLabel }} {% endif %}
{% elif config.is_vocabulary %}
{{ list_vocabulary_values(value) }}
{% elif value is mapping and value|length > 0 and value[0] is string %}
{{ list_string_values(value) }}
{% else %}
{{ value }}
{% endif %} {% endmacro %}