{% import 'macros/form.html' as form %} {% import 'macros/kata_form.html' as kata_form %}

{{ _('Agents and roles') }}

{% set distributor = h.get_distributor(data) %} {% if distributor or data.id %} {% endif %}

{{ _('Distributor') }}

{% set contacts = h.get_contacts(data) %} {% if contacts|length == 0 %} {% do contacts.append(dict()) %} {% endif %}
{% set distributor_errors = h.get_dict_errors(errors, '__extras', 'contact') %} {% for contact in contacts %}
{% set index = loop.index0 %} {% call form.input('contact__' ~ index ~ '__name', label=_('Name'), id='contact__' ~ index ~ '__name', placeholder=_('John Doe'), value=contact.name, error=h.get_dict_field_errors(errors, 'contact', index, 'name'), classes=['control-custom'], label_classes=['kata-input-comp'], attrs={'class': "kata-medium-input"}) %} {{ kata_form.tooltip(tooltip=_('Field is compulsory.

Type the name of the distributor. Distributor is a person or an organisation who has the right to distribute the dataset or has published the dataset.

You can add multiple distributors but the first one is treated as the primary contact to email based contacts by this service.')) }} {% endcall %} {% call form.input('contact__' ~ index ~ '__phone', label=_('Phone'), id='contact__' ~ index ~ '__phone', placeholder=_('+35844122123'), value=contact.phone, error=h.get_dict_field_errors(errors, 'contact', index, 'phone'), classes=['control-custom'], label_classes=['kata-input-comp'], attrs={'class': "kata-medium-input"}) %} {{ kata_form.tooltip(tooltip=_('Field is compulsory.

Type the contact phone number. The phone number must be in form \"+35812341234\".')) }} {% endcall %} {% call form.input('contact__' ~ index ~ '__email', label=_('Email'), id='contact__' ~ index ~ '__email', placeholder=_('john.doe@example.com'), value=contact.email, error=h.get_dict_field_errors(errors, 'contact', index, 'email'), type='email', classes=['control-custom'], label_classes=['kata-input-comp'], attrs={'class': "kata-medium-input"}) %} {{ kata_form.tooltip(tooltip=_('Field is compulsory.

Type the contact e-mail address. The e-mail address is not shown publicly.')) }} {% endcall %} {% call form.input('contact__' ~ index ~ '__URL', label=_('Homepage'), id='contact__' ~ index ~ '__URL', placeholder=_('http://johndoe.com/contact'), value=contact.URL, error=h.get_dict_field_errors(errors, 'contact', index, 'URL'), classes=['control-custom'], label_classes=['kata-input-comp'], attrs={'class': "kata-medium-input"}) %} {{ kata_form.tooltip(tooltip=_('Field is compulsory.

Type a valid web address to your web page. In case you don\'t have one, you could for example give an address to your research group\'s site or any site that could make it possible to contact the origin of the dataset in case of need.')) }} {% if loop.index0 == 0 %} {{ kata_form.plusbutton(id="contacts_add", onclick="$(\'#obtn__" ~ index ~ "__contact_id\').change();") }} {% endif %} {% endcall %}
{% endfor %} {% if distributor_errors and distributor_errors is iterable %} {{ distributor_errors|join('. ') }} {% endif %}

{{ _('Project that produced this dataset') }}

{{ _('This dataset was produced in a project.') }}
{% set funders = h.get_funders(data) %} {% if funders|length == 0 %} {% do funders.append(dict(role='funder',)) %} {% endif %}
{% set funder_errors = h.get_dict_errors(errors, '__extras', 'funder') %} {% for agent in funders %}
{% set index = agent_index.increase() %} {% set agent_prefix = "agent__" ~ index ~ "__" %} {% if loop.index0 == 0 %} {% call form.input(agent_prefix ~ 'name', label=_('Name'), id=agent_prefix ~ 'name', placeholder=_('my project'), value=agent.name, error=h.get_dict_field_errors(errors, 'agent', index, 'name'), classes=['control-custom'], label_classes=['kata-input-comp'], attrs={'class': "kata-medium-input"}) %} {{ kata_form.tooltip(tooltip=_("Field is compulsory if checkbox \'This dataset was produced in a project.\' is checked.

Type the project\'s name.")) }} {% endcall %} {% call form.input(agent_prefix ~ 'URL', label=_('Homepage'), id=agent_prefix ~ 'URL', placeholder=_('http://myproject'), value=agent.URL, error=h.get_dict_field_errors(errors, 'agent', index, 'URL'), classes=['control-custom'], label_classes=['kata-input-comp'], attrs={'class': "kata-medium-input"}) %} {{ kata_form.tooltip(tooltip=_("Field is compulsory if checkbox \'This dataset was produced in a project.\' is checked.

Type the project\'s homepage")) }} {% endcall %} {% endif %}
{% call form.input(agent_prefix ~ 'organisation', label=_('Funder'), id=agent_prefix ~ 'organisation', placeholder=_('my funder'), value=agent.organisation, error=h.get_dict_field_errors(errors, 'agent', index, 'organisation'), classes=['control-custom'], label_classes=['kata-input-comp'], attrs={'class': "kata-medium-input"}) %} {{ kata_form.tooltip(tooltip=_("Field is compulsory if checkbox \'This dataset was produced in a project.\' is checked.

Type the project funder\'s name.")) }} {% endcall %} {% call form.input(agent_prefix ~ 'fundingid', label=_('Funding id'), id=agent_prefix ~ 'fundingid', placeholder=_('1234'), value=agent['fundingid'], error=h.get_dict_field_errors(errors, 'agent', index, 'fundingid'), classes=['control-custom'], label_classes=['kata-input-comp'], attrs={'class': "kata-medium-input"}) %} {{ kata_form.tooltip(tooltip=_("Field is compulsory if checkbox \'This dataset was produced in a project.\' is checked.

Type the project\'s funding id.")) }} {% if loop.index0 == 0 %} {{ kata_form.plusbutton(id="funders_add", onclick="$(\'#obtn__" ~ index ~ "__value_id\').change();") }} {% endif %} {% endcall %}
{% endfor %} {% if funder_errors and funder_errors is iterable %}{{ funder_errors|join('. ') }}{% endif %}

{{ _('Owner information') }}

{% set owners = h.get_owners(data) %} {% if owners|length == 0 %} {% do owners.append(dict(role='owner',)) %} {% endif %}
{% set owner_errors = h.get_dict_errors(errors, '__extras', 'owner') %} {% for agent in owners %}
{% set index = agent_index.increase() %} {% set agent_prefix = "agent__" ~ index ~ "__" %}
{% if loop.index0 == 0 %} {{ kata_form.tooltip(tooltip=_("Field is compulsory.

Owner is a person or an organisation who decides upon the use of the dataset.

Type the owner\'s name or ID, such as an ORCID identifier.")) }} {{ kata_form.plusbutton(id="owners_add", onclick="$(\'#obtn__" ~ index ~ "__value_id\').change();") }} {% endif %}
{% endfor %} {% if owner_errors and owner_errors is iterable %}{{ owner_errors|join('. ') }}{% endif %}