-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ckan#3046] extract warning into own page
- Loading branch information
Showing
2 changed files
with
33 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
27
ckan/templates/package/snippets/cannot_create_package.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %} |