{# -*- coding: utf-8 -*- This file is part of Invenio. Copyright (C) 2015-2020 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 render_field(field, icon='', placeholder='', errormsg=True, autofocus=False) %} {%- if field.widget.input_type == 'hidden' %} {{ field() }} {%- else %}
{%- if icon %} {%- endif %} {%- set extras = dict(autofocus='') if autofocus else dict() %} {{ field(placeholder=_(field.label.text | string), **extras) }}
{%- if field.description %} {{ field.description }} {%- endif %} {%- if field.errors and errormsg %} -->
{%- for error in field.errors %}

{{error}}

{%- endfor %}
{%- endif %}
{%- endif %} {% endmacro %} {% macro render_scopes_field(field) %}
{% for value, label, checked, render_kw in field.iter_choices() %} {%- set choice_id = field.id ~ "-" ~ value %}
{% endfor %}
{%- if field.description %}

{{ field.description }}

{%- endif %} {%- if field.errors and errormsg %} -->
{%- for error in field.errors %}

{{error}}

{%- endfor %}
{%- endif %}
{% endmacro %}