diff --git a/ckan/templates/package/new.html b/ckan/templates/package/new.html index c040d61f928..9ef0635c727 100644 --- a/ckan/templates/package/new.html +++ b/ckan/templates/package/new.html @@ -1,23 +1,10 @@ -{% extends "package/base_form_page.html" %} +{% if not h.organizations_available('create_dataset') + and not h.check_config_permission('ckan.auth.create_unowned_dataset') %} -{% block subtitle %}{{ _('Create Dataset') }}{% endblock %} + {% include "package/snippets/cannot_create_package.html" %} +{% else %} + {% extends "package/base_form_page.html" %} -{% if not h.organizations_available('create_dataset') %} - -{% block primary_content %} -
- {% block page_header %}{% endblock %} -
- {% block primary_content_inner %} -

{{ _('Before you can create a dataset you need to create an organization first.') }}

- - - {{ _('Create a new organization') }} - - {% endblock %} -
-
-{% endblock %} - + {% block subtitle %}{{ _('Create Dataset') }}{% endblock %} {% endif %} \ No newline at end of file diff --git a/ckan/templates/package/snippets/cannot_create_package.html b/ckan/templates/package/snippets/cannot_create_package.html new file mode 100644 index 00000000000..b3711571bbf --- /dev/null +++ b/ckan/templates/package/snippets/cannot_create_package.html @@ -0,0 +1,27 @@ +{% extends "package/base_form_page.html" %} + +{% block primary_content %} + +{% block page_header %}{% endblock %} +
+
+ {% block primary_content_inner %} + {% if h.check_access('organization_create') %} +
{{ _('Before you can create a dataset you need to create an organization.') }}
+ + + {{ _('Create a new organization') }} + + + {% else %} +
+

{{ _('There are no organizations to which you can assign this dataset.') }}

+

{{ _('Ask a system administrator to create an organization before you can continue.') }}

+
+ + {% endif %} + + {% endblock %} +
+
+{% endblock %} \ No newline at end of file