diff --git a/changes/198.backport.feature b/changes/198.backport.feature new file mode 100644 index 00000000000..8f84caaedaa --- /dev/null +++ b/changes/198.backport.feature @@ -0,0 +1,5 @@ +- Saving a draft dataset is now called "Publish" and an "Unpublish" button is available +to move an active dataset back to the draft state. +- Consistent display of draft state across dataset pages. +- Error handling is now done on publish, so validators that only apply certain rules to fields for published datasets (e.g. required-only-when-published) will be properly displayed instead of causing a server error. +- templates/package/new_package_form.html content has been merged into its parent template templates/package/snippets/package_form.html and is now marked as deprecated. diff --git a/changes/8308.feature b/changes/8308.feature new file mode 100644 index 00000000000..8f84caaedaa --- /dev/null +++ b/changes/8308.feature @@ -0,0 +1,5 @@ +- Saving a draft dataset is now called "Publish" and an "Unpublish" button is available +to move an active dataset back to the draft state. +- Consistent display of draft state across dataset pages. +- Error handling is now done on publish, so validators that only apply certain rules to fields for published datasets (e.g. required-only-when-published) will be properly displayed instead of causing a server error. +- templates/package/new_package_form.html content has been merged into its parent template templates/package/snippets/package_form.html and is now marked as deprecated. diff --git a/ckan/lib/plugins.py b/ckan/lib/plugins.py index 9f04a6b0ace..d8b477e97bc 100644 --- a/ckan/lib/plugins.py +++ b/ckan/lib/plugins.py @@ -406,7 +406,7 @@ def resource_template(self) -> str: return 'package/resource_read.html' def package_form(self) -> str: - return 'package/new_package_form.html' + return 'package/snippets/package_form.html' def resource_form(self) -> str: return 'package/snippets/resource_form.html' diff --git a/ckan/templates/package/new_package_form.html b/ckan/templates/package/new_package_form.html index d6669f1f53f..a0868b718fd 100644 --- a/ckan/templates/package/new_package_form.html +++ b/ckan/templates/package/new_package_form.html @@ -1,27 +1,6 @@ {% extends 'package/snippets/package_form.html' %} -{% block stages %} - {% if form_style != 'edit' %} - {{ super() }} - {% endif %} -{% endblock %} +{# this template exists for backwards compatibility with old + IDatasetForm plugins and may be removed in a future release. -{% block save_button_text %} - {% if form_style != 'edit' %} - {{ super() }} - {% else %} - {{ h.humanize_entity_type('package', pkg_dict.type, 'update label') or _('Update Dataset') }} - {% endif %} -{% endblock %} - -{% block cancel_button %} - {% if form_style != 'edit' %} - {{ super() }} - {% endif %} -{% endblock %} - -{% block delete_button %} - {% if form_style == 'edit' and h.check_access('package_delete', {'id': pkg_dict.id}) %} - {{ super() }} - {% endif %} -{% endblock %} + Please extend package/snippets/package_form.html instead. #} diff --git a/ckan/templates/package/new_resource.html b/ckan/templates/package/new_resource.html index ed57a7aafd5..849548fee10 100644 --- a/ckan/templates/package/new_resource.html +++ b/ckan/templates/package/new_resource.html @@ -18,6 +18,7 @@ {% block secondary_content %} {% snippet 'package/snippets/resource_help.html' %} + {% snippet 'package/snippets/resources.html', pkg=pkg %} {% endblock %} {% block scripts %} diff --git a/ckan/templates/package/read.html b/ckan/templates/package/read.html index 457501976ab..f7c47546998 100644 --- a/ckan/templates/package/read.html +++ b/ckan/templates/package/read.html @@ -13,10 +13,10 @@