{% import 'macros/form.html' as form %} {% resource 'baepublisher/image_upload.js' %} {% set private = data.get('private') %} {% set name = offering['name'] if offering else data.title %} {% set description = offering['description'] if offering else data.notes %} {% set categories = offering['categories'] %} {% set version = offering['version'] if offering else '' %} {% set license_description = offering['license_description'] if offering else '' %} {% set price = offering['price'] if offering else '' %} {% set is_open = offering['is_open'] if offering else True %} {% set update_acquire_url = offering['update_acquire_url'] if offering else True %} {% set catalogs = offering['catalogs'] %} {% set role = offering['role'] if offering else '' %} {% if offering['license_title'] %} {% set license_title = offering['license_title'] %} {% elif data.get('license_id','') == 'notspecified' %} {% set license_title = '' %} {% else %} {% set license_title = data.get('license_title', '') %} {% endif %} {# This provides a full page that renders a form for publishing a dataset. It can then itself be extended to add/remove blocks of functionality. #}
{% block errors %} {% if errors %}

{{ _('The offering could not be published:') }}

{% endif %} {% endblock %} {% block offering_title %} {{ form.input('name', id='field-name', label=_('Name'), placeholder=_('eg. The title of the offering'), value=name, error=errors['name'], classes=['control-full', 'control-large'], is_required=true) }} {% endblock %} {% block offering_description %} {{ form.textarea('description', id='field-description', label=_('Description'), placeholder=_('eg. Offering description'), value=description, error=errors.notes) }} {% endblock %} {% block offering_tags %} {% set category_attrs = {'data-module': 'autocomplete', 'data-module-tags': '', 'data-module-source': '/api/2/util/tag/autocomplete?incomplete=?', 'multiple': true} %} {{ form.select('categories', id='field-category', label=_('Categories'), options=categories, error=errors.categories, classes=['control-full'], attrs=category_attrs) }} {% endblock %} {% block offering_catalogs %} {% set catalog_attrs = {'data-module': 'autocomplete', 'data-module-tags': '', 'data-module-source': '/api/2/util/tag/autocomplete?incomplete=?' } %} {{ form.select('catalogs', id='field-catalogs', label=_('Catalogs'), options=catalogs, error=errors.catalogs, classes=['control-full'], attrs=catalog_attrs) }} {% endblock %} {% block offering_version %} {{ form.input('version', id='field-version', label=_('Version'), placeholder=_('eg. 1.0, 2.3.4'), value=version, classes=['control-full', 'control-medium'], is_required=true) }} {% endblock %} {% block offering_license_title %} {{ form.input('license_title', id='field-license_title', label=_('License'), placeholder=_('eg. Creative Commons Attribution'), value=license_title, classes=['control-full', 'control-medium']) }} {% endblock %} {% block offering_license_description %} {{ form.textarea('license_description', id='field-license_description', label=_('License Description'), placeholder=_('License description. You can find license definitions at opendefinition.org'), value=license_description, error=errors.notes) }} {% endblock %} {% block offering_role %} {{ form.input('role', id='field-role', label=_('Acquisition Role'), placeholder=_('eg. query_customer'), value=role, classes=['control-full', 'control-medium']) }} {% endblock %} {% block image %}
{% trans %}Upload{% endtrans %} {% trans %} Attach an image to the offering. If you do not upload an image, a default one will be used. {% endtrans %}
{% endblock %} {% if not private %} {% block offering_open %}
{% endblock %} {% else %} {% block offering_price %}
{% trans %} Price in Euros. Leave it in blank to create a free offering. {% endtrans %}
{% endblock %} {% endif %} {% block form_actions %}
{% endblock %}