forked from edgewall/trac
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jadmin_repositories.html
282 lines (262 loc) · 9.31 KB
/
jadmin_repositories.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
{# Copyright (C) 2009-2014 Edgewall Software
This software is licensed as described in the file COPYING, which
you should have received as part of this distribution. The terms
are also available at http://trac.edgewall.com/license.html.
This software consists of voluntary contributions made by many
individuals. For the exact contribution history, see the revision
history and logs, available at http://trac.edgewall.org/.
#}
# extends "jadmin.html"
<!DOCTYPE html>
<html>
<head>
<title>
# block admintitle
${_("Repositories")}
# endblock admintitle
</title>
<script type="text/javascript">
jQuery(document).ready(function($) {
$("#trac-reposlist").addSelectAllCheckboxes();
});
</script>
</head>
<body>
# block adminpanel
# set sorted_repos = repositories|dictsort
<h2>
# set nb_repos
# if view == 'list':
<span class="trac-count">(${len(repositories)})</span>
# endif
# endset
# trans nb_repos = nb_repos
Manage Repositories ${nb_repos}
# endtrans
</h2>
# macro type_field(editable, multiline=false, selected=none)
<div class="field">
<label>
${_("Type:")}
# if multiline:
<br />
# endif
<select size="1" id="trac-type" name="type"${
{'disabled': not editable}|htmlattr}>
# for type in types:
<option${{'value': type,
'selected': type == selected
}|htmlattr}>${type or _('(default)')}</option>
# endfor
# if selected and selected not in types:
<option selected="selected">${selected}</option>
# endif
</select>
</label>
<span class="hint">
${_("Default: %(default_type)s", default_type=default_type)}
</span>
</div>
# endmacro
# macro alias_field(editable, multiline=false, selected=none)
<div class="field">
<label>
${_("Repository:")}
# if multiline:
<br />
# endif
<select size="1" id="trac-repository" name="alias"${
{'disabled': not editable}|htmlattr}>
# for reponame, info in sorted_repos:
# if 'alias' not in info:
<option${{'value': info.name,
'selected': info.name == selected
}|htmlattr}>${info.name or _('(default)')}</option>
# endif
# endfor
# if selected is not none and selected not in repositories:
<option selected="selected">${selected}</option>
# endif
</select>
</label>
</div>
# endmacro
# if view == 'detail':
# set info = repositories[reponame]
<form id="edit" class="mod" method="post" action="">
${jmacros.form_token_input()}
<fieldset>
# with
# set readonly = 'readonly' if not info.editable
# if info.editable:
<legend>${_("Modify Repository:")}</legend>
# else:
<legend>${_("View Repository:")}</legend>
# endif
# if readonly:
<p class="hint">
# trans
<strong>Note:</strong> This repository is not defined in
the database and cannot be edited on this page.
# endtrans
</p>
# endif
<div class="field">
<label>${_("Name:")}<br /><input type="text" name="name"
class="trac-autofocus"${
{'value': info.name,
'readonly': readonly
}|htmlattr}/></label>
</div>
# if 'alias' in info:
${alias_field(info.editable, true, info.alias)}
# else:
${type_field(info.editable, true, info.type)}
<div class="field">
<label>${_("Directory:")}<br /><input type="text" name="dir" size="48"${
{'value': info.dir,
'readonly': readonly
}|htmlattr}/></label>
</div>
<div class="field">
<label>${_("URL:")}<br /><input type="text" name="url" size="48"${
{'value': info.url,
'readonly': readonly
}|htmlattr}/></label>
</div>
# endif
<div class="field">
<label><input type="checkbox" name="sync_per_request" value="1"${
{'checked': info.sync_per_request,
'disabled': not info.editable
}|htmlattr}/>
${_("Sync on every request")}
</label>
<span class="hint">
# set tracreposadmin
<a href="${href.wiki('TracRepositoryAdmin') + '#ExplicitSync'}">${_("explicit synchronization")}</a>
# endset
# trans tracreposadmin = tracreposadmin
Not recommended. See ${tracreposadmin} for more info.
# endtrans
</span>
</div>
<div class="field">
<label><input type="checkbox" name="hidden" value="1"${
{'checked': info.hidden,
'disabled': not info.editable
}|htmlattr}/>
${_("Hide from repository index")}
</label>
</div>
<div class="field description">
<label for="description">
# set wikiformatting
<a tabindex="42" href="${href.wiki('WikiFormatting')}">WikiFormatting</a>
# endset
# trans wikiformatting = wikiformatting
Description: (you may use ${wikiformatting} here)
# endtrans
</label>
<textarea id="description" name="description" class="wikitext trac-fullwidth trac-resizable"
rows="8" cols="78"${
{'readonly': readonly
}|htmlattr}>${info.description}</textarea>
</div>
# endwith
</fieldset>
<div class="buttons">
# if info.editable:
<input type="submit" name="save" class="trac-disable-on-submit" value="${_('Submit changes')}" />
# endif
<input type="submit" name="cancel" value="${_('Cancel')}" />
</div>
</form>
# else:
<form class="addnew" id="trac-addrepos" method="post" action="">
${jmacros.form_token_input()}
<fieldset>
<legend>${_("Add Repository:")}</legend>
<div class="field">
<label>${_("Name:")} <input type="text" name="name"/></label>
</div>
${type_field(true)}
<div class="field">
<label>${_("Directory:")} <input type="text" name="dir"/></label>
</div>
<div class="buttons">
<input type="submit" name="add_repos" class="trac-disable-on-submit" value="${_('Add')}"/>
</div>
</fieldset>
</form>
# if can_add_alias:
<form class="addnew" id="trac-addalias" method="post" action="">
${jmacros.form_token_input()}
<fieldset>
<legend>${_("Add Alias:")}</legend>
<div class="field">
<label>${_("Name:")} <input type="text" name="name"/></label>
</div>
${alias_field(true)}
<div class="buttons">
<input type="submit" name="add_alias" class="trac-disable-on-submit" value="${_('Add')}"/>
</div>
</fieldset>
</form>
# endif
# if sorted_repos:
<form id="trac-repository_table" method="post" action="">
${jmacros.form_token_input()}
<table class="listing" id="trac-reposlist">
<thead>
<tr><th class="sel"></th>
<th>${_("Name")}</th><th>${_("Type")}</th><th>${_("Directory")}</th><th>Revision</th>
</tr>
</thead>
<tbody>
# for reponame, info in sorted_repos:
<tr>
<td class="sel">
# if info.editable:
<input type="checkbox" class="trac-disable-determinant"
name="sel" value="${info.name}"/>
# endif
</td>
<td class="name">
<a href="${panel_href(info.name or '(default)')}">${info.name or _('(default)')}</a>
</td>
<td>${(info.type or _('(default)')) if 'alias' not in info}</td>
<td>
# if 'alias' in info:
<em>
# trans repo = info.alias or _('(default)')
Alias of ${repo}
# endtrans
</em>
# else:
# if info.error:
<span class="missing" title="${info.error}">${info.prettydir}</span>
# else:
${info.prettydir}
# endif
</td>
# endif
<td>
# if info.rev:
<a href="${href.changeset(info.rev, reponame)}">[${info.display_rev}]</a>
# endif
</td>
</tr>
# endfor
</tbody>
</table>
<div class="buttons">
<input type="submit" name="refresh" value="${_('Refresh')}"/>
<input type="submit" name="remove" class="trac-disable trac-disable-on-submit" value="${_('Remove selected items')}"/>
</div>
</form>
# endif
# endif
# endblock adminpanel
</body>
</html>