{% set mimetype_attrs = {'data-module': 'autocomplete', 'data-module-tags': 'true', 'data-module-source': '/api/2/util/media_type_autocomplete?incomplete=?'} %}
{% call form.input('mimetype', label=_('MIME type'), id='mimetype', placeholder=_('MIME. eg. application/pdf, application/txt'), value=data.mimetype, classes=['control-medium'], label_classes=['kata-input-comp'], attrs=mimetype_attrs) %}
{{ kata_form.tooltip(tooltip=_("The file format of the research data can be provided here by typing the MIME type information to this field. Examples of MIME types are: application/octet-stream, application/pdf and text/plain.")) }}
{% if errors.resources %}
{# Todo: these indices don't necessarily match, index 0 might be a metadata supplement #}
{% if errors.resources[0].mimetype %}
{{ errors.resources[0].mimetype[0] }}
{% endif %}
{% endif %}
{% endcall %}
{% call form.input('checksum', label=_('Checksum'), id='checksum', placeholder=_('hex string from eg. MD5, SHA-1'), value=data.checksum, classes=['control-medium'], label_classes=['kata-input-comp'], attrs={'class': "kata-medium-input"}) %}
{{ kata_form.tooltip(tooltip=_("The checksum of the data file can be provided here. This can be for example a fixed length hex string taken from the data generated with a hash algorithm, like SHA-2.
Checksums are a good way to enable verification of the content to ensure the file is unchanged and genuine.")) }}
{% if errors.resources %}
{% if errors.resources[0].hash %}
{{ errors.resources[0].hash[0] }}
{% endif %}
{% endif %}
{% endcall %}
{% call form.input('algorithm', label=_('Algorithm'), id='algorithm', placeholder=_('eg. MD5'), value=data.algorithm, classes=['control-medium'], label_classes=['kata-input-comp'], attrs={'class': "kata-medium-input"}) %}
{{ kata_form.tooltip(tooltip=_('If the checksum is provided above, the algorithm used for generating the hash should be provided here. There are many different hash algorithms with varying levels of security.')) }}
{% if errors.resources %}
{% if errors.resources[0].algorithm %}
{{ errors.resources[0].algorithm[0] }}
{% endif %}
{% endif %}
{% endcall %}