Skip to content

Commit

Permalink
[2375] Mark other stages as complete when going back to dataset
Browse files Browse the repository at this point in the history
This is not technically correct but works for the moment.
  • Loading branch information
aron committed Jun 25, 2012
1 parent 4227caf commit 6dac226
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions ckan/controllers/package.py
Expand Up @@ -433,9 +433,10 @@ def new(self, data=None, errors=None, error_summary=None):
error_summary = error_summary or {}
# in the phased add dataset we need to know that
# we have already completed stage 1
stage = 1
stage = ['active']
if c.form_style == 'new':
stage = 1
stage = ['active', 'complete', 'complete']

vars = {'data': data, 'errors': errors, 'error_summary': error_summary, 'action': 'new', 'stage' : stage}
c.errors_json = json.dumps(errors)

Expand All @@ -447,7 +448,7 @@ def new(self, data=None, errors=None, error_summary=None):
c.form = render(self.package_form, extra_vars=vars)
else:
c.form = render(self._package_form(package_type=package_type), extra_vars=vars)
return render( self._new_template(package_type))
return render( self._new_template(package_type), extra_vars={'stage': stage})

def new_resource(self, id, data=None, errors=None, error_summary=None):
''' FIXME: This is a temporary action to allow styling of the forms. '''
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/package/pages/form_page.html
Expand Up @@ -9,7 +9,7 @@
{% block primary_content %}
<section class="module">
<div class="module-content">
{% block stages %}{{ h.snippet('package/snippets/stages.html', stages=['active']) }}{% endblock %}
{% block stages %}{{ h.snippet('package/snippets/stages.html', stages=stage) }}{% endblock %}
{% block form %}{{ c.form | safe }}{% endblock %}
</div>
</section>
Expand Down

0 comments on commit 6dac226

Please sign in to comment.