{%- set delete_modal_id = ui.util.id() -%} {# This provides a full page that renders a form for adding a dataset. It can then itself be extended to add/remove blocks of functionality. #} {%- call ui.util.call(ui.form, method="POST", action=g.form_action, attrs={"id": "dataset-edit", "novalidate": "", "data-module": "basic-form"}) -%} {{ ui.hidden_input(name="_ckan_phase", value="dataset_new_1") }} {# pkg_name used in 3 stage edit #} {{ ui.hidden_input(name="pkg_name", value=data.id) }} {% block errors %}{{ ui.form_errors(error_summary) }}{% endblock %}
{% block form_actions %} {{ ui.form_annotation() }} {%- call ui.util.call(ui.form_actions) -%} {% block disclaimer %}{%- trans -%}The data license you select above only applies to the contents of any resource files that you add to this dataset. By submitting this form, you agree to release the metadata values that you enter into the form under the Open Database License.{%- endtrans -%}
{% endblock %} {% block delete_button %} {% if form_style == 'edit' and h.check_access('package_delete', {'id': data.id}) and not data.state == 'deleted' %} {%- call ui.util.call(ui.modal_handle, id=delete_modal_id, style="danger") -%} {% block delete_button_text %}{{ _('Delete') }}{% endblock %} {%- endcall %} {% endif %} {% endblock %} {% block publish_button %} {% if form_style == 'edit' %} {%- call ui.util.call(ui.button, style="warning", type="submit", attrs={"name": "save", "value": "go-metadata-unpublish"}) -%} {% block publish_button_text %}{{ _('Unpublish') }}{% endblock %} {%- endcall %} {% endif %} {% endblock %} {% block save_button %} {%- call ui.util.call(ui.button, type="submit", attrs={"name": "save"}) -%} {%- block save_button_text -%} {%- if form_style == 'edit' -%} {{ h.humanize_entity_type('package', pkg_dict.type, 'update label') or _('Update Dataset') }} {%- else -%} {{ _('Next: Add Data') }} {%- endif -%} {%- endblock -%} {%- endcall %} {% endblock %} {%- endcall %} {% endblock %} {%- endcall %} {{ ui.confirm_modal(h.humanize_entity_type('package', dataset_type, 'delete confirmation') or _('Are you sure you want to delete this dataset?'), href=h.url_for(dataset_type ~ '.delete', id=data.id), id=delete_modal_id, dismissible=true) }}