Skip to content

Commit

Permalink
[2375] Add a new dataset resource template
Browse files Browse the repository at this point in the history
  • Loading branch information
aron committed May 24, 2012
1 parent 05c1db7 commit 4d85ca0
Showing 1 changed file with 101 additions and 0 deletions.
101 changes: 101 additions & 0 deletions ckan/templates/package/new_resource.html
@@ -0,0 +1,101 @@
<!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 data 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=2)}

<form class="dataset-form form-horizontal" method="post" py:with="errors = {}; data = {};">
<div class="control-group dataset-form-resource-types">
<div class="controls">
<label class="radio inline" for="field-resource-type-file">
<input id="field-resource-type-file" type="radio" name="resources__0__url" checked="checked" value="file" />
Link to a file
</label>
<label class="radio inline" for="field-resource-type-api">
<input id="field-resource-type-api" type="radio" name="resources__0__url" value="api" />
Link to an API
</label>
</div>
</div>

<div class="control-group control-large control-full" py:with="error = errors.get('title', '')">
<label class="control-label" for="field-resource-url">Resource</label>
<div class="controls">
<input id="field-resource-url" name="resources__0__url" value="${data.get('title', '')}" placeholder="${_('eg. http://example.com/jan-2011.json')}" />
<span class="error-block" py:if="error">${error}</span>
</div>
</div>

<div class="control-group control-full" py:with="error = errors.get('name', '')">
<label class="control-label" for="field-resources-name">Name</label>
<div class="controls">
<input id="field-resource-name" name="resources__0__name" value="${data.get('name', '')}" placeholder="${_('eg. January 2011')}" />
<span class="error-block" py:if="error">${error}</span>
</div>
</div>

<div class="control-group control-full" py:with="error = errors.get('notes', '')">
<label class="control-label" for="field-resource-description">Description</label>
<div class="controls editor">
<textarea id="field-resource-description" name="resources__0__description" cols="20" rows="5" placeholder="Some useful notes about the data">${data.get('notes', '')}</textarea>
<span class="info-block">You can use <a href="http://daringfireball.net/projects/markdown/syntax">Markdown</a> editing here</span>
<span class="error-block" py:if="error">${error}</span>
</div>
</div>

<div class="control-group control-full" py:with="error = errors.get('', '')">
<label class="control-label" for="field-resource-format">Format</label>
<div class="controls">
<input id="field-resource-name" name="resources__0__format" value="${data.get('', '')}" placeholder="${_('eg. application/json')}" />
<span class="error-block" py:if="error">${error}</span>
</div>
</div>

<div class="control-group">
<label for="field-resource-type" class="control-label">Resource Type</label>
<div class="controls">
<select id="field-resource-type" name="resources__0__type">
<option selected="selected" value="">Select a type&hellip;</option>
</select>
</div>
</div>

<div class="form-actions">
<p class="action-info">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>
</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>

0 comments on commit 4d85ca0

Please sign in to comment.