{# Renders all Zenodo-specific custom fields for the dataset form. #} {% import 'macros/form.html' as form %} {# Pull in our JS + CSS via webassets (CKAN 2.9+). #} {% asset 'ckanext_zenodo/zenodo_style' %} {% asset 'ckanext_zenodo/zenodo_form' %} {% if data.id or data.name %}
{% endif %} {% set linked_to_zenodo = h.zenodo_get_extra(data, 'zenodo_deposition_id') or h.zenodo_get_extra(data, 'zenodo_doi') or h.zenodo_get_extra(data, 'zenodo_record_url') %}
{{ _('Marine Research Publishing') }}

{{ _('Zenodo publishing') }}

{{ _('Prepare a clean archival record for long-term discovery, citation and reuse alongside the CKAN dataset.') }}

{# CHECKBOX PATTERN: Each checkbox has a companion hidden input that carries the actual form value ("true"/"false"). The checkbox itself has NO name attribute. JS syncs checkbox.checked -> hidden.value on every change and on submit. This avoids all Flask/CKAN issues with missing vs duplicate form fields. #} {# ---------- Publish to Zenodo ---------- #}
{% if h.zenodo_use_sandbox() %} {{ _('Sandbox mode is active -- DOIs are for testing only.') }} {% endif %}
{# ===== Zenodo-only section ===== #} {% set publish_checked = h.zenodo_get_extra(data, 'zenodo_publish') == 'true' %}
{# ---------- Request DOI ---------- #} {% set request_doi = h.zenodo_get_extra(data, 'zenodo_request_doi', 'true') %} {% set custom_doi = h.zenodo_get_extra(data, 'zenodo_custom_doi') %}
{{ _('If checked, Zenodo will assign a new DOI automatically. Uncheck if you already have a DOI.') }} {% if linked_to_zenodo %}
{{ _('For datasets already linked to Zenodo, leaving this unchecked without entering a custom DOI keeps the current DOI behaviour.') }}
{% endif %}
{{ _('Enter the DOI you already have.') }}
{% if errors.get('zenodo_custom_doi') %}
{{ errors['zenodo_custom_doi']|join(', ') }}
{% endif %}
{# ---------- Info.txt ---------- #} {% set generate_info = h.zenodo_get_extra(data, 'zenodo_generate_info', 'true') %}
{{ _('If checked, an info.txt file with research context metadata will be uploaded to Zenodo.') }}
{# ---------- Resource type ---------- #}
{{ form.select('resource_type', label=_('Resource type'), options=h.zenodo_upload_types(), selected=h.zenodo_get_extra(data, 'resource_type') or 'dataset', error=errors.get('resource_type'), attrs={'class': 'form-select'}) }}
{{ _('Maps to Zenodo upload_type.') }}
{# ---------- Zenodo community ---------- #}
{{ form.input('zenodo_community', label=_('Zenodo community'), id='field-zenodo_community', value=h.zenodo_get_extra(data, 'zenodo_community'), error=errors.get('zenodo_community'), placeholder=_('Community identifier, e.g. "marine-data"'), classes=['control-medium']) }}
{# /zenodo-publish-section #} {# ===== JS ===== #} {# NOTE: License is rendered via the block override in package_basic_fields.html. #} {# ===== Research context fields (always visible) ===== #} {# ---------- Date interval ---------- #}
{{ _('Time coverage') }}

{{ _('Period covered by the data (ISO 8601: YYYY-MM-DD).') }}

{% if errors.get('date_interval_start') %}
{{ errors['date_interval_start']|join(', ') }}
{% endif %}
{% if errors.get('date_interval_end') %}
{{ errors['date_interval_end']|join(', ') }}
{% endif %}
{# ---------- Authors & contributors ---------- #} {% snippet 'package/snippets/authors_repeating.html', data=data, errors=errors %} {% snippet 'package/snippets/contributors_repeating.html', data=data, errors=errors %} {# ---------- Custom research fields ---------- #}
{{ _('Cruise and acquisition metadata') }}

{{ _('Research context') }}

{{ _('These fields describe the sampling mission, observation setting, instrumentation and processing environment.') }}

{{ form.input('expedition', label=_('Expedition'), id='field-expedition', value=h.zenodo_get_extra(data, 'expedition'), placeholder=_('e.g. "Black Sea Cruise 2024, Leg 3"')) }}
{{ _('Name or code of the expedition, cruise or campaign.') }}
{{ form.input('location', label=_('Location'), id='field-location', value=h.zenodo_get_extra(data, 'location'), placeholder=_('e.g. "Black Sea, 44.1N 30.0E"')) }}
{{ _('Geographic area, station or observation sector.') }}
{{ form.input('acquisition_instrument', label=_('Acquisition instrument'), id='field-acquisition_instrument', value=h.zenodo_get_extra(data, 'acquisition_instrument'), placeholder=_('e.g. "Seabird SBE 9plus CTD"')) }}
{{ _('Instrument used, ideally including model or serial identifier.') }}
{{ form.input('operator_name', label=_('Operator name'), id='field-operator_name', value=h.zenodo_get_extra(data, 'operator_name')) }}
{{ _('Person who operated the instrument or acquisition workflow.') }}
{{ form.input('operator_email', label=_('Operator email'), id='field-operator_email', value=h.zenodo_get_extra(data, 'operator_email'), error=errors.get('operator_email'), placeholder='operator@example.org') }}
{{ _('Contact email for the operator or acquisition lead.') }}
{{ form.input('coordinate_system', label=_('Coordinate system'), id='field-coordinate_system', value=h.zenodo_get_extra(data, 'coordinate_system'), placeholder=_('e.g. "WGS 84 (EPSG:4326)"')) }}
{{ _('Coordinate reference system used in the exported data products.') }}
{{ form.input('software_used', label=_('Software used'), id='field-software_used', value=h.zenodo_get_extra(data, 'software_used'), placeholder=_('e.g. "Matlab R2023b, Ocean Data View 5.6"')) }}
{{ _('Software and processing environment used to quality-control or transform the data.') }}