Show More
|
1 | NO CONTENT: new file 100644, binary diff hidden |
|
1 | NO CONTENT: new file 100644, binary diff hidden |
@@ -1,85 +1,95 b'' | |||
|
1 | 1 | """Helper functions |
|
2 | 2 | |
|
3 | 3 | Consists of functions to typically be used within templates, but also |
|
4 | 4 | available to Controllers. This module is available to both as 'h'. |
|
5 | 5 | """ |
|
6 | 6 | from pylons import url |
|
7 | 7 | from pylons.i18n.translation import _, ungettext |
|
8 | 8 | from webhelpers.html import (literal, HTML, escape) |
|
9 | 9 | from webhelpers.html.builder import make_tag |
|
10 | 10 | from webhelpers.html.tools import (auto_link, button_to, highlight, js_obfuscate |
|
11 | 11 | , mail_to, strip_links, strip_tags, tag_re) |
|
12 | 12 | from webhelpers.html.tags import (auto_discovery_link, checkbox, css_classes, |
|
13 | 13 | end_form, file, form, hidden, image, |
|
14 | 14 | javascript_link, link_to, link_to_if, |
|
15 | 15 | link_to_unless, ol, required_legend, |
|
16 | 16 | select, stylesheet_link, |
|
17 | 17 | submit, text, password, textarea, title, |
|
18 | 18 | ul, xml_declaration) |
|
19 | 19 | from webhelpers.text import (chop_at, collapse, convert_accented_entities, |
|
20 | 20 | convert_misc_entities, lchop, plural, rchop, |
|
21 | 21 | remove_formatting, replace_whitespace, urlify) |
|
22 | 22 | |
|
23 | 23 | from webhelpers.pylonslib import Flash as _Flash |
|
24 | 24 | from webhelpers.pylonslib.secure_form import secure_form |
|
25 | 25 | |
|
26 | 26 | from pygments import highlight |
|
27 | 27 | from pygments.formatters import HtmlFormatter |
|
28 | 28 | from pygments.lexers import guess_lexer |
|
29 | 29 | from pygments.lexers import get_lexer_by_name |
|
30 | 30 | |
|
31 | 31 | #Custom helper here :) |
|
32 | 32 | class _Link(object): |
|
33 | 33 | ''' |
|
34 | 34 | Make a url based on label and url with help of url_for |
|
35 | 35 | @param label:name of link if not defined url is used |
|
36 | 36 | @param url: the url for link |
|
37 | 37 | ''' |
|
38 | 38 | |
|
39 | 39 | def __call__(self, label='', *url_, **urlargs): |
|
40 | 40 | if label is None or '': |
|
41 | 41 | label = url |
|
42 | 42 | link_fn = link_to(label, url(*url_, **urlargs)) |
|
43 | 43 | return link_fn |
|
44 | 44 | |
|
45 | 45 | |
|
46 | 46 | class _GetError(object): |
|
47 | 47 | |
|
48 | 48 | def __call__(self, field_name, form_errors): |
|
49 | 49 | tmpl = """<span class="error_msg">%s</span>""" |
|
50 | 50 | if form_errors and form_errors.has_key(field_name): |
|
51 | 51 | return literal(tmpl % form_errors.get(field_name)) |
|
52 | 52 | |
|
53 | 53 | class _FileSizeFormat(object): |
|
54 | 54 | """ |
|
55 | 55 | Formats the value like a 'human-readable' file size (i.e. 13 KB, 4.1 MB, |
|
56 | 56 | 102 bytes, etc). |
|
57 | 57 | """ |
|
58 | 58 | def __call__(self, bytes): |
|
59 | 59 | try: |
|
60 | 60 | bytes = float(bytes) |
|
61 | 61 | except TypeError: |
|
62 | 62 | return u"0 bytes" |
|
63 | 63 | |
|
64 | 64 | if bytes < 1024: |
|
65 | 65 | return ungettext("%(size)d byte", "%(size)d bytes", bytes) % {'size': bytes} |
|
66 | 66 | if bytes < 1024 * 1024: |
|
67 | 67 | return _("%.1f KB") % (bytes / 1024) |
|
68 | 68 | if bytes < 1024 * 1024 * 1024: |
|
69 | 69 | return _("%.1f MB") % (bytes / (1024 * 1024)) |
|
70 | 70 | return _("%.1f GB") % (bytes / (1024 * 1024 * 1024)) |
|
71 | 71 | |
|
72 | class _FilesBreadCrumbs(object): | |
|
72 | 73 | |
|
74 | def __call__(self, repo_name, rev, paths): | |
|
75 | url_l = [link_to(repo_name, url('files_home', repo_name=repo_name, f_path=''))] | |
|
76 | paths_l = paths.split('/') | |
|
77 | ||
|
78 | for cnt, p in enumerate(paths_l, 1): | |
|
79 | if p != '': | |
|
80 | url_l.append(link_to(p, url('files_home', repo_name=repo_name, f_path='/'.join(paths_l[:cnt])))) | |
|
81 | ||
|
82 | return literal(' / '.join(url_l)) | |
|
73 | 83 | |
|
74 | 84 | def pygmentize(code, **kwargs): |
|
75 | 85 | ''' |
|
76 | 86 | Filter for chunks of html to replace code tags with pygmented code |
|
77 | 87 | ''' |
|
78 | 88 | return literal(highlight(code, guess_lexer(code), HtmlFormatter(**kwargs))) |
|
79 | 89 | |
|
80 | 90 | |
|
81 | ||
|
91 | files_breadcrumbs = _FilesBreadCrumbs() | |
|
82 | 92 | filesizeformat = _FileSizeFormat() |
|
83 | 93 | link = _Link() |
|
84 | 94 | flash = _Flash() |
|
85 | 95 | get_error = _GetError() |
@@ -1,491 +1,529 b'' | |||
|
1 | 1 | /*** Initial Settings ***/ |
|
2 | 2 | * { |
|
3 | 3 | margin: 0; |
|
4 | 4 | padding: 0; |
|
5 | 5 | font-weight: normal; |
|
6 | 6 | font-style: normal; |
|
7 | 7 | } |
|
8 | 8 | |
|
9 | 9 | html { |
|
10 | 10 | font-size: 100%; |
|
11 | 11 | font-family: sans-serif; |
|
12 | 12 | } |
|
13 | 13 | |
|
14 | 14 | body { |
|
15 | 15 | font-size: 77%; |
|
16 | 16 | margin: 15px 50px; |
|
17 |
background: # |
|
|
17 | background: #DBD4C6; | |
|
18 | 18 | } |
|
19 | 19 | |
|
20 | 20 | a { |
|
21 | 21 | color:#0000cc; |
|
22 | 22 | text-decoration: none; |
|
23 | 23 | } |
|
24 | 24 | /*** end of Initial Settings ***/ |
|
25 | 25 | |
|
26 | 26 | |
|
27 | 27 | /** common settings **/ |
|
28 | 28 | div#container { |
|
29 | 29 | background: #FFFFFF; |
|
30 | 30 | position: relative; |
|
31 | 31 | color: #666; |
|
32 | 32 | } |
|
33 | 33 | |
|
34 | 34 | div.page-header { |
|
35 | 35 | padding: 50px 20px 0; |
|
36 |
background: # |
|
|
36 | background: #556cb5 top left repeat-x; | |
|
37 | 37 | position: relative; |
|
38 | 38 | } |
|
39 | 39 | div.page-header h1 { |
|
40 | 40 | margin: 10px 0 30px; |
|
41 | 41 | font-size: 1.8em; |
|
42 | 42 | font-weight: bold; |
|
43 | 43 | font-family: osaka,'MS P Gothic', Georgia, serif; |
|
44 | 44 | letter-spacing: 1px; |
|
45 | 45 | color: #DDD; |
|
46 | 46 | } |
|
47 | 47 | div.page-header h1 a { |
|
48 | 48 | font-weight: bold; |
|
49 | 49 | color: #FFF; |
|
50 | 50 | } |
|
51 | 51 | div.page-header a { |
|
52 | 52 | text-decoration: none; |
|
53 | 53 | } |
|
54 | 54 | |
|
55 | 55 | div.page-header form { |
|
56 | 56 | position: absolute; |
|
57 | 57 | margin-bottom: 2px; |
|
58 | 58 | bottom: 0; |
|
59 | 59 | right: 20px; |
|
60 | 60 | } |
|
61 | 61 | div.page-header form label { |
|
62 | 62 | color: #DDD; |
|
63 | 63 | } |
|
64 | 64 | div.page-header form input { |
|
65 | 65 | padding: 2px; |
|
66 | 66 | border: solid 1px #DDD; |
|
67 | 67 | } |
|
68 | 68 | div.page-header form dl { |
|
69 | 69 | overflow: hidden; |
|
70 | 70 | } |
|
71 | 71 | div.page-header form dl dt { |
|
72 | 72 | font-size: 1.2em; |
|
73 | 73 | } |
|
74 | 74 | div.page-header form dl dt, |
|
75 | 75 | div.page-header form dl dd { |
|
76 | 76 | margin: 0 0 0 5px; |
|
77 | 77 | float: left; |
|
78 | 78 | height: 24px; |
|
79 | 79 | line-height: 20px; |
|
80 | 80 | } |
|
81 | 81 | |
|
82 | 82 | ul.page-nav { |
|
83 | 83 | margin: 10px 0 0 0; |
|
84 | 84 | list-style-type: none; |
|
85 | 85 | overflow: hidden; |
|
86 | 86 | width: 800px; |
|
87 | 87 | } |
|
88 | 88 | ul.page-nav li { |
|
89 | 89 | margin: 0 2px 0 0; |
|
90 | 90 | float: left; |
|
91 | 91 | width: 80px; |
|
92 | 92 | height: 24px; |
|
93 | 93 | font-size: 1.1em; |
|
94 | 94 | line-height: 24px; |
|
95 | 95 | text-align: center; |
|
96 | 96 | } |
|
97 | 97 | ul.page-nav li.current { |
|
98 | 98 | background: #FFF; |
|
99 | 99 | } |
|
100 | 100 | ul.page-nav li a { |
|
101 | 101 | height: 24px; |
|
102 | 102 | color: #666; |
|
103 | 103 | background: #DDD; |
|
104 | 104 | display: block; |
|
105 | 105 | text-decoration: none; |
|
106 | 106 | } |
|
107 | 107 | ul.page-nav li a:hover { |
|
108 | 108 | color:#333; |
|
109 | 109 | background: #FFF; |
|
110 | 110 | } |
|
111 | 111 | |
|
112 | 112 | ul.submenu { |
|
113 | 113 | margin: 10px 0 -10px 20px; |
|
114 | 114 | list-style-type: none; |
|
115 | 115 | } |
|
116 | 116 | ul.submenu li { |
|
117 | 117 | margin: 0 10px 0 0; |
|
118 | 118 | font-size: 1.2em; |
|
119 | 119 | display: inline; |
|
120 | 120 | } |
|
121 | 121 | |
|
122 | 122 | h2 { |
|
123 | 123 | margin: 20px 0 10px; |
|
124 | 124 | height: 30px; |
|
125 | 125 | line-height: 30px; |
|
126 | 126 | text-indent: 20px; |
|
127 | 127 | background: #FFF; |
|
128 | 128 | font-size: 1.2em; |
|
129 | 129 | border-top: dotted 1px #D5E1E6; |
|
130 | 130 | font-weight: bold; |
|
131 | 131 | } |
|
132 | 132 | h2.no-link { |
|
133 | 133 | color:#006699; |
|
134 | 134 | } |
|
135 | 135 | h2.no-border { |
|
136 | 136 | color: #FFF; |
|
137 | 137 | background: #006699; |
|
138 | 138 | border: 0; |
|
139 | 139 | } |
|
140 | 140 | h2 a { |
|
141 | 141 | font-weight:bold; |
|
142 | 142 | color:#006699; |
|
143 | 143 | } |
|
144 | 144 | |
|
145 | 145 | div.page-path { |
|
146 | 146 | text-align: right; |
|
147 | 147 | padding: 20px 30px 10px 0; |
|
148 | 148 | border:solid #d9d8d1; |
|
149 | 149 | border-width:0px 0px 1px; |
|
150 | 150 | font-size: 1.2em; |
|
151 | 151 | } |
|
152 | 152 | |
|
153 | 153 | div.page-footer { |
|
154 | 154 | margin: 50px 0 0; |
|
155 | 155 | position: relative; |
|
156 | 156 | } |
|
157 | 157 | div.page-footer p { |
|
158 | 158 | position: relative; |
|
159 | 159 | left: 20px; |
|
160 | 160 | bottom: 5px; |
|
161 | 161 | font-size: 1.2em; |
|
162 | 162 | } |
|
163 | 163 | |
|
164 | 164 | ul.rss-logo { |
|
165 | 165 | position: absolute; |
|
166 | 166 | top: -10px; |
|
167 | 167 | right: 20px; |
|
168 | 168 | height: 20px; |
|
169 | 169 | list-style-type: none; |
|
170 | 170 | } |
|
171 | 171 | ul.rss-logo li { |
|
172 | 172 | display: inline; |
|
173 | 173 | } |
|
174 | 174 | ul.rss-logo li a { |
|
175 | 175 | padding: 3px 6px; |
|
176 | 176 | line-height: 10px; |
|
177 | 177 | border:1px solid; |
|
178 | 178 | border-color:#fcc7a5 #7d3302 #3e1a01 #ff954e; |
|
179 | 179 | color:#ffffff; |
|
180 | 180 | background-color:#ff6600; |
|
181 | 181 | font-weight:bold; |
|
182 | 182 | font-family:sans-serif; |
|
183 | 183 | font-size:10px; |
|
184 | 184 | text-align:center; |
|
185 | 185 | text-decoration:none; |
|
186 | 186 | } |
|
187 | 187 | div.rss-logo li a:hover { |
|
188 | 188 | background-color:#ee5500; |
|
189 | 189 | } |
|
190 | 190 | |
|
191 | 191 | p.normal { |
|
192 | 192 | margin: 20px 0 20px 30px; |
|
193 | 193 | font-size: 1.2em; |
|
194 | 194 | } |
|
195 | 195 | |
|
196 | 196 | table { |
|
197 |
margin: |
|
|
198 | width: 95%; | |
|
197 | margin: 0 0 0 0; | |
|
199 | 198 | border-collapse: collapse; |
|
200 | 199 | } |
|
200 | /* | |
|
201 | 201 | table tr td { |
|
202 | 202 | font-size: 1.1em; |
|
203 | 203 |
|
|
204 | 204 | table tr td.nowrap { |
|
205 | 205 | white-space: nowrap; |
|
206 | 206 |
|
|
207 | /* | |
|
208 | table tr.parity0:hover, | |
|
209 | table tr.parity1:hover { | |
|
207 | */ | |
|
208 | table tr.parity0:hover,table tr.parity1:hover { | |
|
210 | 209 | background: #D5E1E6; |
|
211 | 210 | } |
|
212 | */ | |
|
211 | ||
|
213 | 212 | table tr.parity0 { |
|
214 |
background: # |
|
|
213 | background: #EAEAE9; | |
|
215 | 214 | } |
|
216 | 215 | table tr.parity1 { |
|
217 | 216 | background: #FFFFFF; |
|
218 | 217 | } |
|
219 | 218 | table tr td { |
|
220 |
padding: |
|
|
219 | padding: 3px 3px; | |
|
221 | 220 | } |
|
222 | 221 | table.annotated tr td { |
|
223 |
padding: 0px |
|
|
222 | padding: 0px 3px; | |
|
224 | 223 | } |
|
225 | 224 | |
|
226 | 225 | span.logtags span { |
|
227 | 226 | padding: 2px 6px; |
|
228 | 227 | font-weight: normal; |
|
229 | 228 | font-size: 11px; |
|
230 | 229 | border: 1px solid; |
|
231 | 230 | background-color: #ffaaff; |
|
232 | 231 | border-color: #ffccff #ff00ee #ff00ee #ffccff; |
|
233 | 232 | } |
|
234 | 233 | span.logtags span.tagtag { |
|
235 | 234 | background-color: #ffffaa; |
|
236 | 235 | border-color: #ffffcc #ffee00 #ffee00 #ffffcc; |
|
237 | 236 | } |
|
238 | 237 | span.logtags span.branchtag { |
|
239 | 238 | background-color: #aaffaa; |
|
240 | 239 | border-color: #ccffcc #00cc33 #00cc33 #ccffcc; |
|
241 | 240 | } |
|
242 | 241 | span.logtags span.inbranchtag { |
|
243 | 242 | background-color: #d5dde6; |
|
244 | 243 | border-color: #e3ecf4 #9398f4 #9398f4 #e3ecf4; |
|
245 | 244 | } |
|
246 | 245 | |
|
247 | 246 | div.diff pre { |
|
248 | 247 | margin: 10px 0 0 0; |
|
249 | 248 | } |
|
250 | 249 | div.diff pre span { |
|
251 | 250 | font-family: monospace; |
|
252 | 251 | white-space: pre; |
|
253 | 252 | font-size: 1.2em; |
|
254 | 253 | padding: 3px 0; |
|
255 | 254 | } |
|
256 | 255 | td.source { |
|
257 | 256 | white-space: pre; |
|
258 | 257 | font-family: monospace; |
|
259 | 258 | margin: 10px 30px 0; |
|
260 | 259 | font-size: 1.2em; |
|
261 | 260 | font-family: monospace; |
|
262 | 261 | } |
|
263 | 262 | div.source div.parity0, |
|
264 | 263 | div.source div.parity1 { |
|
265 | 264 | padding: 1px; |
|
266 | 265 | font-size: 1.2em; |
|
267 | 266 | } |
|
268 | 267 | div.source div.parity0 { |
|
269 | 268 | background: #F1F6F7; |
|
270 | 269 | } |
|
271 | 270 | div.source div.parity1 { |
|
272 | 271 | background: #FFFFFF; |
|
273 | 272 | } |
|
274 | 273 | div.parity0:hover, |
|
275 | 274 | div.parity1:hover { |
|
276 | 275 | background: #D5E1E6; |
|
277 | 276 | } |
|
278 | 277 | .linenr { |
|
279 | 278 | color: #999; |
|
280 | 279 | text-align: right; |
|
281 | 280 | } |
|
282 | 281 | .lineno { |
|
283 | 282 | text-align: right; |
|
284 | 283 | } |
|
285 | 284 | .lineno a { |
|
286 | 285 | color: #999; |
|
287 | 286 | } |
|
288 | 287 | td.linenr { |
|
289 | 288 | width: 60px; |
|
290 | 289 | } |
|
291 | 290 | |
|
292 | 291 | div#powered-by { |
|
293 | 292 | position: absolute; |
|
294 | 293 | width: 75px; |
|
295 | 294 | top: 15px; |
|
296 | 295 | right: 20px; |
|
297 | 296 | font-size: 1.2em; |
|
298 | 297 | } |
|
299 | 298 | div#powered-by a { |
|
300 | 299 | color: #EEE; |
|
301 | 300 | text-decoration: none; |
|
302 | 301 | } |
|
303 | 302 | div#powered-by a:hover { |
|
304 | 303 | text-decoration: underline; |
|
305 | 304 | } |
|
306 | 305 | /* |
|
307 | 306 | div#monoblue-corner-top-left { |
|
308 | 307 | position: absolute; |
|
309 | 308 | top: 0; |
|
310 | 309 | left: 0; |
|
311 | 310 | width: 10px; |
|
312 | 311 | height: 10px; |
|
313 | 312 | background: url(./monoblue-corner.png) top left no-repeat !important; |
|
314 | 313 | background: none; |
|
315 | 314 | } |
|
316 | 315 | div#monoblue-corner-top-right { |
|
317 | 316 | position: absolute; |
|
318 | 317 | top: 0; |
|
319 | 318 | right: 0; |
|
320 | 319 | width: 10px; |
|
321 | 320 | height: 10px; |
|
322 | 321 | background: url(./monoblue-corner.png) top right no-repeat !important; |
|
323 | 322 | background: none; |
|
324 | 323 | } |
|
325 | 324 | div#monoblue-corner-bottom-left { |
|
326 | 325 | position: absolute; |
|
327 | 326 | bottom: 0; |
|
328 | 327 | left: 0; |
|
329 | 328 | width: 10px; |
|
330 | 329 | height: 10px; |
|
331 | 330 | background: url(./monoblue-corner.png) bottom left no-repeat !important; |
|
332 | 331 | background: none; |
|
333 | 332 | } |
|
334 | 333 | div#monoblue-corner-bottom-right { |
|
335 | 334 | position: absolute; |
|
336 | 335 | bottom: 0; |
|
337 | 336 | right: 0; |
|
338 | 337 | width: 10px; |
|
339 | 338 | height: 10px; |
|
340 | 339 | background: url(./monoblue-corner.png) bottom right no-repeat !important; |
|
341 | 340 | background: none; |
|
342 | 341 | } |
|
343 | 342 | */ |
|
344 | 343 | /** end of common settings **/ |
|
345 | 344 | |
|
346 | 345 | /** summary **/ |
|
347 | 346 | dl.overview { |
|
348 | 347 | margin: 0 0 0 30px; |
|
349 | 348 | font-size: 1.1em; |
|
350 | 349 | overflow: hidden; |
|
351 | 350 | } |
|
352 | 351 | dl.overview dt, |
|
353 | 352 | dl.overview dd { |
|
354 | 353 | margin: 5px 0; |
|
355 | 354 | float: left; |
|
356 | 355 | } |
|
357 | 356 | dl.overview dt { |
|
358 | 357 | clear: left; |
|
359 | 358 | font-weight: bold; |
|
360 | 359 | width: 150px; |
|
361 | 360 | } |
|
362 | 361 | /** end of summary **/ |
|
363 | 362 | |
|
364 | 363 | /** chagelog **/ |
|
365 | 364 | h3.changelog { |
|
366 | 365 | margin: 20px 0 5px 30px; |
|
367 | 366 | padding: 0 0 2px; |
|
368 | 367 | font-size: 1.4em; |
|
369 | 368 | border-bottom: dotted 1px #D5E1E6; |
|
370 | 369 | } |
|
371 | 370 | ul.changelog-entry { |
|
372 | 371 | margin: 0 0 10px 30px; |
|
373 | 372 | list-style-type: none; |
|
374 | 373 | position: relative; |
|
375 | 374 | } |
|
376 | 375 | ul.changelog-entry li span.revdate { |
|
377 | 376 | font-size: 1.1em; |
|
378 | 377 | } |
|
379 | 378 | ul.changelog-entry li.age { |
|
380 | 379 | position: absolute; |
|
381 | 380 | top: -25px; |
|
382 | 381 | right: 10px; |
|
383 | 382 | font-size: 1.4em; |
|
384 | 383 | color: #CCC; |
|
385 | 384 | font-weight: bold; |
|
386 | 385 | font-style: italic; |
|
387 | 386 | } |
|
388 | 387 | ul.changelog-entry li span.name { |
|
389 | 388 | font-size: 1.2em; |
|
390 | 389 | font-weight: bold; |
|
391 | 390 | } |
|
392 | 391 | ul.changelog-entry li.description { |
|
393 | 392 | margin: 10px 0 0; |
|
394 | 393 | font-size: 1.1em; |
|
395 | 394 | } |
|
396 | 395 | /** end of changelog **/ |
|
397 | 396 | |
|
398 | 397 | /** file **/ |
|
399 | 398 | p.files { |
|
400 | 399 | margin: 0 0 0 20px; |
|
401 | 400 | font-size: 2.0em; |
|
402 | 401 | font-weight: bold; |
|
403 | 402 | } |
|
404 | 403 | /** end of file **/ |
|
405 | 404 | |
|
406 | 405 | /** changeset **/ |
|
407 | 406 | h3.changeset { |
|
408 | 407 | margin: 20px 0 5px 20px; |
|
409 | 408 | padding: 0 0 2px; |
|
410 | 409 | font-size: 1.6em; |
|
411 | 410 | border-bottom: dotted 1px #D5E1E6; |
|
412 | 411 | } |
|
413 | 412 | p.changeset-age { |
|
414 | 413 | position: relative; |
|
415 | 414 | } |
|
416 | 415 | p.changeset-age span { |
|
417 | 416 | position: absolute; |
|
418 | 417 | top: -25px; |
|
419 | 418 | right: 10px; |
|
420 | 419 | font-size: 1.4em; |
|
421 | 420 | color: #CCC; |
|
422 | 421 | font-weight: bold; |
|
423 | 422 | font-style: italic; |
|
424 | 423 | } |
|
425 | 424 | p.description { |
|
426 | 425 | margin: 10px 30px 0 30px; |
|
427 | 426 | padding: 10px; |
|
428 | 427 | border: solid 1px #CCC; |
|
429 | 428 | font-size: 1.2em; |
|
430 | 429 | } |
|
431 | 430 | /** end of changeset **/ |
|
432 | 431 | |
|
433 | 432 | /** canvas **/ |
|
434 | 433 | div#wrapper { |
|
435 | 434 | position: relative; |
|
436 | 435 | font-size: 1.2em; |
|
437 | 436 | } |
|
438 | 437 | |
|
439 | 438 | canvas { |
|
440 | 439 | position: absolute; |
|
441 | 440 | z-index: 5; |
|
442 | 441 | top: -0.7em; |
|
443 | 442 | } |
|
444 | 443 | |
|
445 | 444 | ul#nodebgs li.parity0 { |
|
446 | 445 | background: #F1F6F7; |
|
447 | 446 | } |
|
448 | 447 | |
|
449 | 448 | ul#nodebgs li.parity1 { |
|
450 | 449 | background: #FFFFFF; |
|
451 | 450 | } |
|
452 | 451 | |
|
453 | 452 | ul#graphnodes { |
|
454 | 453 | position: absolute; |
|
455 | 454 | z-index: 10; |
|
456 | 455 | top: 7px; |
|
457 | 456 | list-style: none inside none; |
|
458 | 457 | } |
|
459 | 458 | |
|
460 | 459 | ul#nodebgs { |
|
461 | 460 | list-style: none inside none; |
|
462 | 461 | } |
|
463 | 462 | |
|
464 | 463 | ul#graphnodes li, ul#nodebgs li { |
|
465 | 464 | height: 39px; |
|
466 | 465 | } |
|
467 | 466 | |
|
468 | 467 | ul#graphnodes li .info { |
|
469 | 468 | display: block; |
|
470 | 469 | position: relative; |
|
471 | 470 | } |
|
472 | 471 | /** end of canvas **/ |
|
473 | 472 | |
|
473 | table.code-browser{ | |
|
474 | ||
|
475 | } | |
|
476 | table.code-browser thead th { | |
|
477 | background-color:#EEEEEE; | |
|
478 | border:1px solid #999999; | |
|
479 | height:20px; | |
|
480 | font-size: 1.1em; | |
|
481 | font-weight: bold; | |
|
482 | } | |
|
483 | table.code-browser tbody td { | |
|
484 | border:1px solid #999999; | |
|
485 | height:20px; | |
|
486 | } | |
|
487 | .info-table { | |
|
488 | background:none repeat scroll 0 0 #FAFAFA; | |
|
489 | border-bottom:1px solid #DDDDDD; | |
|
490 | width:100%; | |
|
491 | } | |
|
492 | .rss_logo{ | |
|
493 | background-image:url("/images/feed.png"); | |
|
494 | background-repeat:no-repeat; | |
|
495 | display:block; | |
|
496 | height:16px; | |
|
497 | padding-left:20px; | |
|
498 | padding-top:0px; | |
|
499 | text-align:left; | |
|
500 | ||
|
501 | } | |
|
502 | .atom_logo{ | |
|
503 | background-image:url("/images/atom.png"); | |
|
504 | background-repeat:no-repeat; | |
|
505 | display:block; | |
|
506 | height:16px; | |
|
507 | padding-left:20px; | |
|
508 | padding-top:0px; | |
|
509 | text-align:left; | |
|
510 | ||
|
511 | } | |
|
474 | 512 | .browser-file { |
|
475 | 513 | background-image:url("/images/file.png"); |
|
476 | 514 | background-repeat:no-repeat; |
|
477 | 515 | display:block; |
|
478 | 516 | height:16px; |
|
479 | 517 | padding-left:20px; |
|
480 | 518 | padding-top:5px; |
|
481 | 519 | text-align:left; |
|
482 | 520 | } |
|
483 | 521 | .browser-dir { |
|
484 | 522 | background-image:url("/images/folder.png"); |
|
485 | 523 | background-repeat:no-repeat; |
|
486 | 524 | display:block; |
|
487 | 525 | height:16px; |
|
488 | 526 | padding-left:20px; |
|
489 | 527 | padding-top:5px; |
|
490 | 528 | text-align:left; |
|
491 | 529 | } No newline at end of file |
@@ -1,92 +1,92 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|
3 | 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|
4 | 4 | <head> |
|
5 | 5 | <link rel="icon" href="/images/hgicon.png" type="image/png" /> |
|
6 | 6 | <meta name="robots" content="index, nofollow"/> |
|
7 | 7 | <title>${next.title()}</title> |
|
8 | 8 | ${self.css()} |
|
9 | 9 | ${self.js()} |
|
10 | 10 | </head> |
|
11 | 11 | |
|
12 | 12 | <body> |
|
13 | 13 | <div id="container"> |
|
14 | 14 | <div class="page-header"> |
|
15 | 15 | <h1> |
|
16 | 16 | ${next.breadcrumbs()} |
|
17 | 17 | </h1> |
|
18 | 18 | <ul class="page-nav"> |
|
19 | 19 | ${self.page_nav()} |
|
20 | 20 | </ul> |
|
21 | 21 | </div> |
|
22 | 22 | ${next.main()} |
|
23 | 23 | <div class="page-footer"> |
|
24 | 24 | Mercurial App © 2010 |
|
25 | 25 | </div> |
|
26 | 26 | |
|
27 | 27 | <div id="powered-by"> |
|
28 | 28 | <p> |
|
29 | 29 | <a href="http://mercurial.selenic.com/" title="Mercurial"> |
|
30 | 30 | <img src="/images/hglogo.png" width="75" height="90" alt="mercurial"/></a> |
|
31 | 31 | </p> |
|
32 | 32 | </div> |
|
33 | 33 | |
|
34 | 34 | <div id="corner-top-left"></div> |
|
35 | 35 | <div id="corner-top-right"></div> |
|
36 | 36 | <div id="corner-bottom-left"></div> |
|
37 | 37 | <div id="corner-bottom-right"></div> |
|
38 | 38 | |
|
39 | 39 | </div> |
|
40 | 40 | </body> |
|
41 | 41 | </html> |
|
42 | 42 | |
|
43 | 43 | <%def name="page_nav()"> |
|
44 | 44 | |
|
45 | 45 | ${self.menu()} |
|
46 | 46 | |
|
47 | 47 | </%def> |
|
48 | 48 | |
|
49 | 49 | |
|
50 | 50 | <%def name="menu(current)"> |
|
51 | 51 | <ul class="page-nav"> |
|
52 | 52 | |
|
53 | 53 | <li |
|
54 | 54 | %if current=='summary': |
|
55 | 55 | class='current' |
|
56 | 56 | %endif |
|
57 | 57 | >${h.link_to_unless(current=='summary',_('summary'),h.url('summary_home',repo_name=c.repo_name))}</li> |
|
58 | 58 | <li |
|
59 | 59 | %if current=='changelog': |
|
60 | 60 | class='current' |
|
61 | 61 | %endif |
|
62 | 62 | >${h.link_to_unless(current=='changelog',_('changelog'),h.url('changelog_home',repo_name=c.repo_name))}</li> |
|
63 | 63 | <li |
|
64 | 64 | %if current=='branches': |
|
65 | 65 | class='current' |
|
66 | 66 | %endif |
|
67 | 67 | >${h.link_to_unless(current=='branches',_('branches'),h.url('branches_home',repo_name=c.repo_name))}</li> |
|
68 | 68 | <li |
|
69 | 69 | %if current=='tags': |
|
70 | 70 | class='current' |
|
71 | 71 | %endif |
|
72 | 72 | >${h.link_to_unless(current=='tags',_('tags'),h.url('tags_home',repo_name=c.repo_name))}</li> |
|
73 | 73 | <li |
|
74 | 74 | %if current=='graph': |
|
75 | 75 | class='current' |
|
76 | 76 | %endif |
|
77 | 77 | >${h.link_to_unless(current=='graph',_('graph'),h.url('graph_home',repo_name=c.repo_name))}</li> |
|
78 | 78 | <li |
|
79 | 79 | %if current=='files': |
|
80 | 80 | class='current' |
|
81 | 81 | %endif |
|
82 | 82 | >${h.link_to_unless(current=='files',_('files'),h.url('files_home',repo_name=c.repo_name))}</li> |
|
83 | 83 | </ul> |
|
84 | 84 | </%def> |
|
85 | 85 | |
|
86 | 86 | <%def name="css()"> |
|
87 |
<link rel="stylesheet" href="/css/ |
|
|
87 | <link rel="stylesheet" href="/css/monoblue_custom.css" type="text/css" /> | |
|
88 | 88 | </%def> |
|
89 | 89 | |
|
90 | 90 | <%def name="js()"> |
|
91 | 91 | <script type="text/javascript" src="/js/yui/utilities/utilities.js"></script> |
|
92 | 92 | </%def> No newline at end of file |
@@ -1,95 +1,120 b'' | |||
|
1 | 1 | <%inherit file="base/base.html"/> |
|
2 | 2 | |
|
3 | 3 | <%def name="title()"> |
|
4 | 4 | ${_('Repository managment')} |
|
5 | 5 | </%def> |
|
6 | 6 | <%def name="breadcrumbs()"> |
|
7 | 7 | ${h.link_to(u'Home',h.url('/'))} |
|
8 | 8 | / |
|
9 | 9 | ${h.link_to(c.repo_name,h.url('files_home',repo_name=c.repo_name))} |
|
10 | 10 | / |
|
11 | 11 | ${_('files')} |
|
12 | 12 | </%def> |
|
13 | 13 | <%def name="page_nav()"> |
|
14 | 14 | <form action="log"> |
|
15 | 15 | <dl class="search"> |
|
16 | 16 | <dt><label>Search: </label></dt> |
|
17 | 17 | <dd><input type="text" name="rev" /></dd> |
|
18 | 18 | </dl> |
|
19 | 19 | </form> |
|
20 | 20 | |
|
21 | 21 | ${self.menu('files')} |
|
22 | 22 | </%def> |
|
23 | 23 | <%def name="css()"> |
|
24 |
<link rel="stylesheet" href="/css/ |
|
|
24 | <link rel="stylesheet" href="/css/monoblue_custom.css" type="text/css" /> | |
|
25 | 25 | <link rel="stylesheet" href="/css/pygments.css" type="text/css" /> |
|
26 | 26 | </%def> |
|
27 | 27 | <%def name="main()"> |
|
28 | 28 | |
|
29 | 29 | <h2 class="no-link no-border">${_('Files')}</h2> |
|
30 | 30 | <div id="files_data"> |
|
31 |
<h2>${_('File')}: ${c.repo_name |
|
|
31 | <h2>${_('File')}: ${h.files_breadcrumbs(c.repo_name,c.cur_rev,c.files_list.path)}</h2> | |
|
32 | 32 | %if c.files_list.is_dir(): |
|
33 | 33 | <table class="code-browser"> |
|
34 | 34 | <thead> |
|
35 | 35 | <tr> |
|
36 | 36 | <th class="width-50 lefted">${_('Name')}</th> |
|
37 | 37 | <th class="width-10 righted">${_('Size')}</th> |
|
38 | 38 | <th class="width-10 righted">${_('Revision')}</th> |
|
39 | 39 | <th class="width-15 righted">${_('Last modified')}</th> |
|
40 | 40 | <th class="width-15 righted">${_('Last commiter')}</th> |
|
41 | 41 | </tr> |
|
42 | 42 | </thead> |
|
43 | 43 | <tr> |
|
44 | 44 | % if c.files_list.parent: |
|
45 | <td colspan="5" class="browser-dir"> | |
|
46 | ${h.link_to('..',h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.files_list.parent))} | |
|
45 | <td> | |
|
46 | ${h.link_to('..',h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.files_list.parent),class_="browser-dir")} | |
|
47 | 47 | </td> |
|
48 | <td></td> | |
|
49 | <td></td> | |
|
50 | <td></td> | |
|
51 | <td></td> | |
|
48 | 52 | %endif |
|
49 | 53 | </tr> |
|
50 | 54 | <%def name="file_class(node)"> |
|
51 | 55 | %if node.is_file(): |
|
52 | browser-file | |
|
56 | <%return "browser-file" %> | |
|
53 | 57 | %else: |
|
54 | browser-dir | |
|
58 | <%return "browser-dir"%> | |
|
55 | 59 | %endif |
|
56 | 60 | </%def> |
|
57 | 61 | |
|
58 | 62 | |
|
59 | 63 | %for cnt,node in enumerate(c.files_list): |
|
60 | 64 | <tr class="parity${cnt%2}"> |
|
61 | 65 | |
|
62 |
<td |
|
|
63 |
${h.link_to(node.name,h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=node.path),class_= |
|
|
66 | <td> | |
|
67 | ${h.link_to(node.name,h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=node.path),class_=file_class(node))} | |
|
64 | 68 | </td> |
|
65 | 69 | <td> |
|
66 | 70 | %if node.is_file(): |
|
67 | 71 | ${h.filesizeformat(node.size)} |
|
68 | 72 | %endif |
|
69 | 73 | </td> |
|
70 | 74 | <td> |
|
71 | 75 | %if node.is_file(): |
|
72 | 76 | ${node.last_changeset.revision} |
|
73 | 77 | %endif |
|
74 | 78 | </td> |
|
75 | 79 | <td> |
|
76 | 80 | %if node.is_file(): |
|
77 | 81 | ${node.last_changeset.date} |
|
78 | 82 | %endif |
|
79 | 83 | </td> |
|
80 | 84 | <td> |
|
81 | 85 | %if node.is_file(): |
|
82 | 86 | ${node.last_changeset.author} |
|
83 | 87 | %endif |
|
84 | 88 | |
|
85 | 89 | </td> |
|
86 | 90 | </tr> |
|
87 | 91 | %endfor |
|
88 | 92 | </table> |
|
89 | 93 | %else: |
|
94 | <table class="info-table"> | |
|
95 | <tr> | |
|
96 | <td>r70:17ecc1c97401</td> | |
|
97 | <td>374 loc</td> | |
|
98 | <td>12.5 KB</td> | |
|
99 | <td> | |
|
100 | <a href="/marcinkuzminski/vcs/history/vcs/backends/hg.py">history</a> / | |
|
101 | <a href="/marcinkuzminski/vcs/annotate/17ecc1c97401/vcs/backends/hg.py">annotate</a> / | |
|
102 | <a href="/marcinkuzminski/vcs/raw/17ecc1c97401/vcs/backends/hg.py">raw</a> / | |
|
103 | <form class="source-view-form" method="get" action="/marcinkuzminski/vcs/diff/vcs/backends/hg.py"> | |
|
104 | ||
|
105 | <input type="hidden" value="17ecc1c97401" name="diff2"> | |
|
106 | <select class="smaller" name="diff1"> | |
|
107 | <option>history</option> | |
|
108 | </select> | |
|
109 | <input type="submit" class="smaller" value="diff"> | |
|
110 | ||
|
111 | </form> | |
|
112 | </td> | |
|
113 | </tr> | |
|
114 | </table> | |
|
90 | 115 | <div id="body" class="codeblock"> |
|
91 | 116 | ${h.pygmentize(c.files_list.content,linenos=True,anchorlinenos=True,cssclass="code-highlight")} |
|
92 | 117 | </div> |
|
93 | 118 | %endif |
|
94 | 119 | </div> |
|
95 | 120 | </%def> No newline at end of file |
@@ -1,60 +1,61 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%! |
|
3 | 3 | from pylons_app.lib import filters |
|
4 | 4 | %> |
|
5 | 5 | <%inherit file="base/base.html"/> |
|
6 | 6 | <%def name="title()"> |
|
7 | 7 | ${c.repos_prefix} Mercurial Repositories |
|
8 | 8 | </%def> |
|
9 | 9 | <%def name="breadcrumbs()"> |
|
10 | 10 | ${c.repos_prefix} Mercurial Repositories |
|
11 | 11 | </%def> |
|
12 | 12 | <%def name="page_nav()"> |
|
13 | 13 | <li class="current">${_('Home')}</li> |
|
14 | 14 | <li>${h.link_to(u'Admin',h.url('admin_home'))}</li> |
|
15 | 15 | </%def> |
|
16 | 16 | <%def name="main()"> |
|
17 | 17 | <%def name="get_sort(name)"> |
|
18 | 18 | <%name_slug = name.lower().replace(' ','_') %> |
|
19 | 19 | %if name_slug == c.cs_slug: |
|
20 | 20 | <span style="font-weight: bold;color:#006699">${name}</span> |
|
21 | 21 | %else: |
|
22 | 22 | <span style="font-weight: bold">${name}</span> |
|
23 | 23 | %endif |
|
24 | 24 | |
|
25 | 25 | <a href="?sort=${name_slug}">↓</a> |
|
26 | 26 | <a href="?sort=-${name_slug}">↑</a> |
|
27 | 27 | |
|
28 | 28 | </%def> |
|
29 | 29 | <table> |
|
30 | 30 | <tr> |
|
31 | 31 | <td>${get_sort(_('Name'))}</td> |
|
32 | 32 | <td>${get_sort(_('Description'))}</td> |
|
33 | 33 | <td>${get_sort(_('Last change'))}</td> |
|
34 | 34 | <td>${get_sort(_('Tip'))}</td> |
|
35 | 35 | <td>${get_sort(_('Contact'))}</td> |
|
36 | 36 | <td></td> |
|
37 | 37 | <td></td> |
|
38 | <td></td> | |
|
38 | 39 | </tr> |
|
39 | 40 | %for cnt,repo in enumerate(c.repos_list): |
|
40 | 41 | <tr class="parity${cnt%2}"> |
|
41 | 42 | <td>${h.link(repo['name'],h.url('summary_home',repo_name=repo['name']))}</td> |
|
42 | 43 | <td>${repo['description']}</td> |
|
43 | 44 | <td>${repo['last_change']|n,filters.age}</td> |
|
44 | 45 | <td>r${repo['rev']}:<a href="/${repo['name']}/rev/${repo['tip']}/">${repo['tip']}</a></td> |
|
45 | 46 | <td>${repo['contact']}</td> |
|
46 | 47 | <td class="indexlinks"> |
|
47 | 48 | %for archive in repo['repo_archives']: |
|
48 | 49 | <a href="/${repo['name']}/archive/${archive['node']}${archive['extension']}">${archive['type']}</a> |
|
49 | 50 | %endfor |
|
50 | 51 | </td> |
|
51 | 52 | <td> |
|
52 | <div class="rss_logo"> | |
|
53 | <a href="/${repo['name']}/rss-log">RSS</a> | |
|
54 | <a href="/${repo['name']}/atom-log">Atom</a> | |
|
55 | </div> | |
|
53 | <a class="rss_logo" href="/${repo['name']}/rss-log">RSS</a> | |
|
54 | </td> | |
|
55 | <td> | |
|
56 | <a class="atom_logo" href="/${repo['name']}/atom-log">Atom</a> | |
|
56 | 57 |
</td> |
|
57 | 58 | </tr> |
|
58 | 59 | %endfor |
|
59 | 60 | </table> |
|
60 | 61 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now