-
Notifications
You must be signed in to change notification settings - Fork 2k
/
new_group_form.html
122 lines (116 loc) · 4.94 KB
/
new_group_form.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
<form
class="form-horizontal ${'has-errors' if errors else ''}"
id="group-edit"
action=""
method="post"
xmlns:i18n="http://genshi.edgewall.org/i18n"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude">
<div class="error-explanation" py:if="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>
<fieldset id="basic-information">
<div class="control-group">
<label for="name" class="control-label">Title</label>
<div class="controls">
<input class="js-title" id="title" name="title" type="text" value="${data.get('title', '')}"/>
</div>
</div>
<div class="control-group">
<label for="title" class="control-label">Url</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on">${h.url(controller='group', action='index')+'/'}</span>
<input maxlength="100" name="name" type="text" class="js-url-input" value="${data.get('name', '')}" />
</div>
<p class="js-url-is-valid"> </p>
<p class="url-is-long">Warning: URL is very long. Consider changing it to something shorter.</p>
<p>2+ characters, lowercase, using only 'a-z0-9' and '-_'</p>
<p class="field_error" py:if="errors.get('name', '')">${errors.get('name', '')}</p>
</div>
</div>
<div class="control-group">
<label for="" class="control-label">Description</label>
<div class="controls">
${h.markdown_editor('notes',data.get('description',''),id='notes')}
</div>
</div>
<div class="state-field control-group" py:if="c.is_sysadmin or c.auth_for_change_state">
<label for="" class="control-label">State</label>
<div class="controls">
<select id="state" name="state" >
<option py:attrs="{'selected': 'selected' if data.get('state') == 'active' else None}" value="active">active</option>
<option py:attrs="{'selected': 'selected' if data.get('state') == 'deleted' else None}" value="deleted">deleted</option>
</select>
</div>
</div>
</fieldset>
<fieldset id="extras">
<h3>Extras</h3>
<dl>
<py:with vars="extras = data.get('extras', [])">
<py:for each="num, extra in enumerate(data.get('extras', []))">
<div class="control-group">
<label class="control-label" for="extras__${num}__value">${extra.get('key')}</label>
<div class="controls">
<input id="extras__${num}__key" name="extras__${num}__key" type="hidden" value="${extra.get('key')}" />
<input id="extras__${num}__value" name="extras__${num}__value" type="text" value="${extra.get('value')}" />
<label class="checkbox" style="display: inline-block;">
<input type="checkbox" name="extras__${num}__deleted" checked="${extra.get('deleted')}" />Delete
</label>
</div>
</div>
</py:for>
<hr py:if="len(extras)" class="extras-divider" />
<py:for each="num in range(len(extras), len(extras) + 4)">
<div class="control-group">
<label class="control-label" for="extras__${num}__key">Add...</label>
<div class="controls">
<label>
<span class="extras-label">Key =</span>
<input class="medium-width" id="extras__${num}__key" name="extras__${num}__key" type="text" />
</label>
<label>
<span class="extras-label">Value =</span>
<input class="medium-width" id="extras__${num}__value" name="extras__${num}__value" type="text" />
</label>
</div>
</div>
</py:for>
</py:with>
</dl>
</fieldset>
<fieldset id="datasets">
<h3>Datasets</h3>
<div py:if="data.get('packages')">
<py:for each="num, package in enumerate(data.get('packages'))">
<div class="control-group">
<div class="controls">
<div class="checkbox">
<input value="${package['name']}" checked="checked" id="datasets__${num}__name" name="packages__${num}__name" type="checkbox" />
<label for="packages__${num}__name">${package['name']}</label>
</div>
</div>
</div>
</py:for>
</div>
<p py:if="not data.get('packages')">There are no datasets currently in this group.</p>
<h3>Add datasets</h3>
<div class="control-group">
<label class="control-label" for="packages__${len(data.get('packages', []))}__name">Dataset</label>
<div class="controls">
<input class="autocomplete-dataset" id="datasets__${len(data.get('packages', []))}__name" name="packages__${len(data.get('packages', []))}__name" type="text" />
</div>
</div>
</fieldset>
<div class="form-actions">
<input id="save" class="btn btn-primary" name="save" type="submit" value="${_('Save Changes')}" />
<py:if test="c.group">
<input id="cancel" class="btn href-action" name="cancel" type="reset" value="${_('Cancel')}" action="${h.url_for(controller='group', action='read', id=c.group.name)}" />
</py:if>
</div>
</form>