-
Notifications
You must be signed in to change notification settings - Fork 2k
/
new.html
124 lines (115 loc) · 6.18 KB
/
new.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!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>Create a dataset</title>
</head>
<body>
<div class="toolbar">
${h.snippet('package/new_breadcrumb.html')}
</div>
<div class="primary">
<section class="module">
<div class="content">
<ol class="stages">
<li class="active"><a href="">Create dataset</a></li>
<li>Add data</li>
<li>Additional data</li>
</ol>
<form class="dataset-form form-horizontal" method="post" py:with="errors = {}; data = {};">
<div class="alert alert-error error-explanation" py:if="False and error_summary">
<h2>Errors in form</h2>
<p>The form contains invalid entries:</p>
<ul>
<li py:for="key, error in error_summary.items()">${"%s: %s" % (key if not key=='Name' else 'URL', error)}</li>
</ul>
</div>
<div class="control-group control-large control-full" py:with="error = errors.get('title', '')">
<label class="control-label" for="field-title">Title</label>
<div class="controls">
<input id="field-title" name="title" value="${data.get('title', '')}" placeholder="${_('A descriptive title')}" />
<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-name">URL</label>
<div class="controls">
<input id="field-name" name="name" value="${data.get('name', '')}" placeholder="${_('my-dataset')}" />
<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-notes">Description</label>
<div class="controls editor">
<textarea id="field-notes" name="notes" 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" py:with="error = errors.get('license_id', '')">
<label class="control-label" for="field-license">License</label>
<div class="controls">
<select id="field-license" name="license_id">
<py:for each="licence_desc, licence_id in c.licences">
<option value="${licence_id}" py:attrs="{'selected': 'selected' if data.get('license_id', '') == licence_id else None}" py:if="licence_desc">${licence_desc}</option>
</py:for>
</select>
<span class="error-block" py:if="error">${error}</span>
<span class="info-block">Don't worry if you don't know which license the data has been released under</span>
</div>
</div>
<div class="control-group" py:if="c.groups_available" py:with="groups = data.get('groups',[])">
<label for="field-groups" class="control-label">Add to Groups</label>
<div class="controls">
<select id="field-groups" name="groups__${len(groups)}__id">
<option selected="selected" value="">Select a group...</option>
<py:for each="group in c.groups_available">
<option value="${group['id']}" >${group['name']}</option>
</py:for>
</select>
</div>
<div class="control-group" py:if="len(data.get('groups', []))" py:with="groups = data.get('groups',[])">
<label for="groups__0__id" class="control-label">Member of Groups</label>
<div class="controls">
<py:for each="num, group in enumerate(groups)">
<?python
authorized_group = [group_authz for group_authz in c.groups_authz if group_authz['id'] == group['id']]
authorized_group = authorized_group[0] if authorized_group else None
?>
<div class="checkbox" py:if="'id' in group">
<label for="groups__${num}__checked">
<input type="${'checkbox' if authorized_group else 'hidden'}" name="groups__${num}__id" checked="checked" value="${group['id']}"/>
${group.get('name', authorized_group['name'] if authorized_group else '')}
</label>
<input type="hidden" name="groups__${num}__name" value="${group.get('name', authorized_group['name'] if authorized_group else '')}" />
</div>
</py:for>
</div>
</div>
</div>
<div class="form-actions">
<a class="btn" href="">Cancel</a>
<button class="btn btn-primary" type="submit">Next: Add Data</button>
</div>
</form>
</div>
</section>
</div>
<div class="secondary">
<section class="module">
<h2 class="heading"><i class="ckan-icon ckan-icon-info"></i> What are datasets?</h2>
<div class="content">
<p>Datasets are simply used to group related pieces of data. These
can then be found under a single url with a description and
licensing information.</p>
</div>
</section>
</div>
</body>
</html>