Skip to content

Commit

Permalink
[#2703] Wrap stages in add resource form in conditional
Browse files Browse the repository at this point in the history
If an empty array is provided then the stages will be omitted.
  • Loading branch information
aron committed Jul 18, 2012
1 parent 8611078 commit 49ed93a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ckan/templates/package/snippets/resource_form.html
Expand Up @@ -6,7 +6,10 @@

<form class="dataset-form dataset-resource-form form-horizontal" method="post" action="{{ action }}" data-module="basic-form resource-form">
{% block stages %}
{{ h.snippet('package/snippets/stages.html', stages=stage, pkg_name=pkg_name) }}
{# An empty stages variable will not show the stages #}
{% if stages %}
{{ h.snippet('package/snippets/stages.html', stages=stage, pkg_name=pkg_name) }}
{% endif %}
{% endblock %}

{{ form.errors(error_summary) }}
Expand Down

0 comments on commit 49ed93a

Please sign in to comment.