Skip to content

Commit

Permalink
[#3046] extract warning into own page
Browse files Browse the repository at this point in the history
  • Loading branch information
k-nut authored and Knut Hühne committed Jun 6, 2016
1 parent 7227b70 commit 48ffbf5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 19 deletions.
25 changes: 6 additions & 19 deletions 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 %}
<section class="module">
{% block page_header %}{% endblock %}
<div class="module-content">
{% block primary_content_inner %}
<p>{{ _('Before you can create a dataset you need to create an organization first.') }}</p>

<a class='btn btn-primary' href="{{ h.url_for(controller='organization', action='new') }}">
{{ _('Create a new organization') }}
</a>
{% endblock %}
</div>
</section>
{% endblock %}

{% block subtitle %}{{ _('Create Dataset') }}{% endblock %}
{% endif %}
27 changes: 27 additions & 0 deletions 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 %}
<section class="module">
<div class="module-content">
{% block primary_content_inner %}
{% if h.check_access('organization_create') %}
<div class="alert alert-warning">{{ _('Before you can create a dataset you need to create an organization.') }}</div>

<a class='btn btn-primary' href="{{ h.url_for(controller='organization', action='new') }}">
{{ _('Create a new organization') }}
</a>

{% else %}
<div class="alert alert-danger">
<p> {{ _('There are no organizations to which you can assign this dataset.') }} </p>
<p>{{ _('Ask a system administrator to create an organization before you can continue.') }}</p>
</div>

{% endif %}

{% endblock %}
</div>
</section>
{% endblock %}

0 comments on commit 48ffbf5

Please sign in to comment.