forked from edgewall/trac
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jbrowser.html
331 lines (299 loc) · 10.8 KB
/
jbrowser.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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
{# Copyright (C) 2006-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 'jlayout.html'
<!DOCTYPE html>
<html>
<head>
<title>
# block title
# if len(path_links) == 1:
/
# elif len(path_links) == 2:
${path_links[-1].name}
# else:
# trans basename = path_links[-1].name, dirname = path_links[1:-1]|map(attribute='name')|join('/')
${basename} in ${dirname}
# endtrans
# endif
${ super() }
# endblock title
</title>
# block head
${ super() }
# if file and file.annotate:
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
# elif dir:
<meta name="ROBOTS" content="NOINDEX" />
# endif
<script type="text/javascript"
src="${chrome.htdocs_location}js/folding.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".trac-toggledeleted").show().click(function() {
$(this).siblings().find(".trac-deleted").toggle();
return false;
}).click();
$("#jumploc input").hide();
$("#jumploc select").change(function () {
this.parentNode.parentNode.submit();
});
# if dir or repo:
/* browsers using old WebKits have issues with expandDir... */
var webkit_rev = /AppleWebKit\/(\d+)/.exec(navigator.userAgent);
if ( !webkit_rev || (521 - webkit_rev[1]).toString()[0] == "-" )
enableExpandDir(null, $("table.dirlist tr"), {
action: 'inplace',
range_min_secs: '${dir.range_min_secs}',
range_max_secs: '${dir.range_max_secs}'
});
# elif file:
# if file.annotate == 'blame':
enableBlame("${href.changeset()}/", "${reponame}", "${path}");
# endif
$('#preview table.code').enableCollapsibleColumns(
$('#preview table.code thead th.content'));
# endif
});
</script>
# endblock head
</head>
<body>
# block content
<div id="content" class="browser">
# if dir or file:
# with
# set repo_index = repo and repo.repositories
# set path_links = none if repo_index else path_links
<h1>
# if repo_index:
<span class="pathentry">Default Repository</span>
# endif
# include 'jpath_links.html'
</h1>
<div id="diffrev">
<form action="${href.changeset()}" method="get">
<div>
# with full_path = (reponame, path)|reject('none')|map('trim', '/')|join('/')
<label title="${_("Show the diff against a specific revision")}">
${_("View diff against:")}
<input type="text" name="old" size="6"/>
<input type="hidden" name="old_path" value="${full_path}"/>
<input type="hidden" name="new" value="${stickyrev}"/>
<input type="hidden" name="new_path" value="${full_path}"/>
</label>
# endwith
</div>
</form>
</div>
<div id="jumprev">
<form action="" method="get">
<div>
<label for="rev"
title="${_("Hint: clear the field to view latest revision"
) if stickyrev}">
${_("View revision:")}</label>
<input type="text" id="rev" name="rev" value="${stickyrev}"
size="6" />
</div>
</form>
</div>
# if quickjump_entries:
<div id="jumploc">
<form action="" method="get">
<div class="buttons">
<label for="preselected">${_("Visit:")}</label>
<select id="preselected" name="preselected">
<option selected="selected"></option>
# for category, locations in quickjump_entries|groupby('0'):
<optgroup label="${category}">
# for _a, name, lpath, rev in locations:
<option value="${href.browser(reponame, lpath, rev=rev)}">${
name}</option>
# endfor
</optgroup>
# endfor
</select>
<input type="submit" value="${_("Go!")}"
title="${_("Jump to the chosen preselected path")}" />
</div>
</form>
</div>
# endif
# if changeset:
<div class="trac-tags">
# for branch, head in changeset.get_branches() if branch not in ('default', 'master'):
<span ${{'class': classes('branch', head=head)}|htmlattr}
title="${_("Branch head") if head else _("Branch")}">${
branch}</span>
# endfor
# for tag in changeset.get_tags():
<span class="tag" title="${_("Tag")}">${tag}</span>
# endfor
# for bookmark in changeset.get_bookmarks():
<span class="trac-bookmark" title="${_("Bookmark")}">${bookmark}</span>
# endfor
</div>
# endif
# if dir:
<table class="listing dirlist" id="dirlist">
# include 'jdirlist_thead.html'
<tbody>
# if 'up' in chrome.links:
<tr class="even">
<td class="name" colspan="6">
<a class="parent" title="${_("Parent Directory")}"
href="${chrome.links.up[0].href}">../</a>
</td>
</tr>
# endif
# include 'jdir_entries.html'
# if 'up' not in chrome.links and not dir.entries:
<tr class="even">
<td class="name" colspan="6">
${_("No files found")}
</td>
</tr>
# endif
</tbody>
</table>
# endif
# if properties or file:
<table id="info" summary="Revision info">
# if file:
<tr>
<th>
# with cset, rcset, drev, author, age = (
href.changeset(created_rev, reponame),
href.changeset(created_rev, reponame, created_path),
display_rev(created_rev),
authorinfo(file.changeset.author),
pretty_dateinfo(file.changeset.date))
# set last_change_link
<a href="${rcset}" title="View differences">Last change</a>
# endset
# set rev_link
<a href="${cset}"
title="${_("View changeset %(rev)s", rev=drev)}">${drev}</a>
#- endset
# if stickyrev:
# trans last_change = last_change_link, stickyrev = display_rev(stickyrev), rev = rev_link, author, age
${last_change} on this file since ${stickyrev} was ${rev},
checked in by ${author}, ${age}
# endtrans
# else:
# trans last_change = last_change_link, rev = rev_link, author, age
${last_change} on this file was ${rev},
checked in by ${author}, ${age}
# endtrans
# endif
# endwith
</th>
</tr>
<tr>
<td class="message searchable">
# if wiki_format_messages:
${wiki_to_html(context.child('changeset', file.changeset.rev,
parent=repos.resource),
file.changeset.message, escape_newlines=True)}
# else:
${file.changeset.message}
# endif
</td>
</tr>
# endif
# if properties:
<tr>
<td colspan="2">
<ul class="props">
# for prop in properties:
<li>
# macro prop_value(prop)
# if prop.value is text:
<em><code>${prop.value}</code></em>
# else:
${prop.value}
# endif
# endmacro
# if prop.rendered:
# if prop.rendered.name:
<span ${prop.rendered.name_attributes|htmlattr}>${
prop.rendered.name}</span>
# endif
<div ${prop.rendered.content_attributes|htmlattr}>${
prop.rendered.content}</div>
# else:
# trans name = prop.name, value = prop_value(prop)
Property <strong>${name}</strong> set to ${value}
# endtrans
# endif
</li>
# endfor
</ul>
</td>
</tr>
# endif
# if file:
<tr>
<td colspan="2">
<strong>${_("File size:")}</strong>
<span title="${_("%(size)s bytes", size=file.size)}">${
pretty_size(file.size)}</span>
</td>
</tr>
# endif
</table>
# endif
# endwith
# endif
# if dir and path == '/':
<div class="description">
${wiki_to_html(context.child('source', '/', parent=repos.resource),
repoinfo.description)}
</div>
# endif
# if repo and repo.repositories:
<h1>${_("Repository Index")}</h1>
# with repoindex = 'repoindex'
# include 'jrepository_index.html'
# endwith
# endif
# if file and file.preview:
<div id="preview" class="searchable">
# with preview = file.preview
# include 'jpreview_file.html'
# endwith
</div>
# endif
<div id="anydiff">
<form action="${href.diff()}" method="get">
<div class="buttons">
<input type="hidden" name="new_path"
value="${'/' + pathjoin(reponame, path)}" />
<input type="hidden" name="old_path"
value="${'/' + pathjoin(reponame, path)}" />
<input type="hidden" name="new_rev"
value="${stickyrev|d('', true)}" />
<input type="hidden" name="old_rev"
value="${stickyrev|d('', true)}" />
<input type="submit" value="${_("View changes...")}"
title="${_("Select paths and revs for Diff")}" />
</div>
</form>
</div>
<div id="help">
# trans href = href.wiki('TracBrowser')
<strong>Note:</strong> See <a href="${href}">TracBrowser</a> for help
on using the repository browser.
# endtrans
</div>
</div>
${ super() }
# endblock content
</body>
</html>