Skip to content

Commit

Permalink
[2375] Add the final add metadata stage of the form
Browse files Browse the repository at this point in the history
  • Loading branch information
aron committed Jun 7, 2012
1 parent c8588cb commit c5777d3
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 6 deletions.
1 change: 1 addition & 0 deletions ckan/config/routing.py
Expand Up @@ -170,6 +170,7 @@ def make_map():
'list',
'new',
'new_resource',
'new_metadata',
'autocomplete',
'search'
]))
Expand Down
7 changes: 6 additions & 1 deletion ckan/controllers/package.py
Expand Up @@ -469,10 +469,15 @@ def new(self, data=None, errors=None, error_summary=None):
return render( self._new_template(package_type))

def new_resource(self, data=None, errors=None, error_summary=None):
""" This is a temporary action to allow styling of the forms. """
''' FIXME: This is a temporary action to allow styling of the forms. '''
package_type = self._guess_package_type(True)
return render('package/new_resource.html')

def new_metadata(self, data=None, errors=None, error_summary=None):
''' FIXME: This is a temporary action to allow styling of the forms. '''
package_type = self._guess_package_type(True)
return render('package/new_package_metadata.html')

def edit(self, id, data=None, errors=None, error_summary=None):
package_type = self._get_package_type(id)
context = {'model': model, 'session': model.Session,
Expand Down
3 changes: 3 additions & 0 deletions ckan/templates/package/new_package_form.html
Expand Up @@ -81,6 +81,9 @@ <h2>Errors in form</h2>
</div>

<div class="form-actions">
<p class="action-info small">Important: By submitting content, you
agree to release your contributions under the Open Database
License.</p>
<a class="btn" href="">Cancel</a>
<button class="btn btn-primary" type="submit" name="save">Next: Add Data</button>
</div>
Expand Down
41 changes: 41 additions & 0 deletions ckan/templates/package/new_package_metadata.html
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:i18n="http://genshi.edgewall.org/i18n"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude">
<!--! Include matchers nearest first -->
<xi:include href="../page.html" />

<!--! Now include the current page -->
<head>
<title>Add metadata to the dataset</title>
</head>
<body>
<div class="toolbar">
${h.snippet('package/new_breadcrumb.html')}
</div>

<div class="primary">
<section class="module">
<div class="content">
${h.snippet('package/new_stages.html', stage=3)}
<form class="dataset-form dataset-resource-form form-horizontal" method="post" py:with="errors = {}; data = {};">
<div class="form-actions">
<button class="btn btn-primary" type="submit">Finish</button>
</div>
</form>
</div>
</section>
</div>

<div class="secondary">
<section class="module">
<h2 class="heading"><i class="ckan-icon ckan-icon-info"></i> What is data?</h2>
<div class="content">
<p>Data can be any file or link to a file containing useful data.</p>
</div>
</section>
</div>
</body>
</html>
8 changes: 3 additions & 5 deletions ckan/templates/package/new_resource.html
Expand Up @@ -82,11 +82,9 @@
</div>

<div class="form-actions">
<p class="action-info small">Important: By submitting content, you
agree to release your contributions under the Open Database
License.</p>
<a class="btn" href="">Save and close</a>
<button class="btn btn-primary" type="submit">Next: Add Info</button>
<a class="btn" href="">Save</a>
<a class="btn" href="">Save &amp; add another</a>
<button class="btn btn-primary" type="submit">Next: Additional Info</button>
</div>
</form>
</div>
Expand Down

0 comments on commit c5777d3

Please sign in to comment.