Skip to content

Commit

Permalink
[#1200] Fix for undefined on new resource form on non-draft datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmartin committed Oct 23, 2013
1 parent 9359e8d commit e09d4c3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
7 changes: 1 addition & 6 deletions ckan/templates/package/new_resource.html
Expand Up @@ -13,12 +13,7 @@
{% block form %}{% snippet 'package/snippets/resource_form.html', data=data, errors=errors, error_summary=error_summary, include_metadata=false, pkg_name=pkg_name, stage=stage, allow_upload=g.ofs_impl and logged_in %}{% endblock %}

{% block secondary_content %}
<section class="module module-narrow module-shallow">
<h2 class="module-heading"><i class="icon-info-sign"></i> {{ _('What\'s a resource?') }}</h2>
<div class="module-content">
<p>{{ _('A resource can be any file or link to a file containing useful data.') }}</p>
</div>
</section>
{% snippet 'package/snippets/resource_help.html' %}
{% endblock %}

{% block scripts %}
Expand Down
12 changes: 12 additions & 0 deletions ckan/templates/package/new_resource_not_draft.html
Expand Up @@ -3,6 +3,18 @@
{% block subtitle %}{{ _('Add resource') }} - {{ h.dataset_display_name(pkg) }}{% endblock %}
{% block form_title %}{{ _('Add resource') }}{% endblock %}

{% block breadcrumb_content %}
<li class="active"><a href="#">{{ _('Add New Resource') }}</a></li>
{% endblock %}

{% block form %}
{% snippet 'package/snippets/resource_form.html', data=data, errors=errors, error_summary=error_summary, include_metadata=false, pkg_name=pkg_name, stage=stage, allow_upload=g.ofs_impl and logged_in %}
{% endblock %}

{% block content_primary_nav %}
<li class="active"><a href="#"><i class="icon-edit"></i> {{ _('New resource') }}</a></li>
{% endblock %}

{% block secondary_content %}
{% snippet 'package/snippets/resource_help.html' %}
{% endblock %}
6 changes: 4 additions & 2 deletions ckan/templates/package/resource_edit_base.html
Expand Up @@ -8,12 +8,14 @@
{% block breadcrumb_content %}
{{ super() }}
<li>{% link_for h.resource_display_name(res)|truncate(30), controller='package', action='resource_read', id=pkg.name, resource_id=res.id %}</li>
<li class="active"><a href="">Edit</a></li>
<li class="active"><a href="">{{ _('Edit') }}</a></li>
{% endblock %}

{% block content_action %}
{% link_for _('All resources'), controller='package', action='resources', id=pkg.name, class_='btn', icon='arrow-left' %}
{% link_for _('View resource'), controller='package', action='resource_read', id=pkg.name, resource_id=res.id, class_='btn', icon='eye-open' %}
{% if res %}
{% link_for _('View resource'), controller='package', action='resource_read', id=pkg.name, resource_id=res.id, class_='btn', icon='eye-open' %}
{% endif %}
{% endblock %}

{% block content_primary_nav %}
Expand Down
6 changes: 6 additions & 0 deletions ckan/templates/package/snippets/resource_help.html
@@ -0,0 +1,6 @@
<section class="module module-narrow module-shallow">
<h2 class="module-heading"><i class="icon-info-sign"></i> {{ _('What\'s a resource?') }}</h2>
<div class="module-content">
<p>{{ _('A resource can be any file or link to a file containing useful data.') }}</p>
</div>
</section>

0 comments on commit e09d4c3

Please sign in to comment.