-
Notifications
You must be signed in to change notification settings - Fork 2k
/
new_resource.html
105 lines (95 loc) · 5.17 KB
/
new_resource.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!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 dataset-resource-form form-horizontal" method="post" py:with="errors = {}; data = {};">
<div class="control-group dataset-form-resource-types">
<div class="controls">
<!--!
This block uses a slightly odd pattern. Unlike the rest of the radio
buttons which are wrapped _inside_ the labels here we place the label
after the input. This enables us to style the label based on the state
of the radio using css. eg. input[type=radio]+label {}
-->
<i class="ckan-icon ckan-icon-link-file"></i>
<input id="field-resource-type-file" type="radio" name="resources__0__url" checked="checked" value="file" />
<label class="radio inline" for="field-resource-type-file">Link to a file</label>
<i class="ckan-icon ckan-icon-link-plugin"></i>
<input id="field-resource-type-api" type="radio" name="resources__0__url" value="api" />
<label class="radio inline" for="field-resource-type-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…</option>
</select>
</div>
</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>
</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>