{% import 'macros/form.html' as form %} {% import 'actor_registry/snippets/help_texts.html' as ht with context %} {% set compact = compact|default(false) %} {% macro help_text() %}{%- snippet 'scheming/form_snippets/help_text.html', field=field -%}{% endmacro %} {% asset 'actor_registry/actor-quick-create' %} {% set saved_value = data.get(field.field_name, '') %} {% set preferred_value = h.preferred_publisher_actor_id() if not data.get('id') and not saved_value else '' %} {% set selected_value = saved_value or preferred_value %}
{%- call form.input_block("field-" + field.field_name, label=h.scheming_language_text(field.label), classes=field.classes if 'classes' in field else ['control-full'], error=errors[field.field_name], is_required=h.scheming_field_required(field), extra_html='' if compact else help_text()) -%} {% set choices = [] %}{#- Fall back to the registry when the schema field has no choices_helper. -#}{% for c in h.scheming_field_choices(field) or h.actors_choices(field) %}{% do choices.append((c.value, h.scheming_language_text(c.label))) %}{% endfor %}{% if field.get('sorted_choices') %}{% set choices = choices|sort(case_sensitive=false, attribute=1) %}{% endif %}
{% if unavailable %}

{% if unavailable.state == 'inactive' %}{{ _('“{name}” is inactive. It stays on this dataset, but it can no longer be chosen; replace it with an active publisher when you can.').format(name=unavailable.name) }}{% else %}{{ _('A publisher that no longer exists is selected. Choose another publisher before you save.') }}{% endif %}

{% endif %} {% if not h.scheming_field_required(field) %}

{{ _('If left empty, the organization is given as publisher when the metadata is exported (DCAT).') }}

{% endif %} {% if preferred_value %}

{{ _('Preselected from the publisher you used last. You can change the choice.') }}

{% endif %} {% if c.userobj %}{% endif %} {%- endcall -%}