##// END OF EJS Templates
hgweb: make stripes in graph with CSS
Alexander Plavin -
r19453:ece3b329 default
parent child Browse files
Show More
@@ -1,129 +1,129
1 1 {header}
2 2 <title>{repo|escape}: revision graph</title>
3 3 <link rel="alternate" type="application/atom+xml"
4 4 href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}: log" />
5 5 <link rel="alternate" type="application/rss+xml"
6 6 href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}: log" />
7 7 <!--[if IE]><script type="text/javascript" src="{staticurl|urlescape}excanvas.js"></script><![endif]-->
8 8 </head>
9 9 <body>
10 10
11 11 <div class="container">
12 12 <div class="menu">
13 13 <div class="logo">
14 14 <a href="{logourl}">
15 15 <img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
16 16 </div>
17 17 <ul>
18 18 <li><a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
19 19 <li class="active">graph</li>
20 20 <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
21 21 <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
22 22 <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
23 23 </ul>
24 24 <ul>
25 25 <li><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
26 26 <li><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
27 27 </ul>
28 28 <ul>
29 29 <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
30 30 </ul>
31 31 <p>
32 32 <div class="atom-logo">
33 33 <a href="{url|urlescape}atom-log" title="subscribe to atom feed">
34 34 <img class="atom-logo" src="{staticurl|urlescape}feed-icon-14x14.png" alt="atom feed">
35 35 </a>
36 36 </div>
37 37 </div>
38 38
39 39 <div class="main">
40 40 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
41 41 <h3>graph</h3>
42 42
43 43 <form class="search" action="{url|urlescape}log">
44 44 {sessionvars%hiddenformentry}
45 45 <p><input name="rev" id="search1" type="text" size="30" /></p>
46 46 <div id="hint">find changesets by author, revision,
47 47 files, or words in the commit message</div>
48 48 </form>
49 49
50 50 <div class="navigate">
51 51 <a href="{url|urlescape}graph/{rev}{lessvars%urlparameter}">less</a>
52 52 <a href="{url|urlescape}graph/{rev}{morevars%urlparameter}">more</a>
53 53 | rev {rev}: {changenav%navgraph}
54 54 </div>
55 55
56 56 <noscript><p>The revision graph only works with JavaScript-enabled browsers.</p></noscript>
57 57
58 58 <div id="wrapper">
59 <ul id="nodebgs"></ul>
59 <ul id="nodebgs" class="stripes2"></ul>
60 60 <canvas id="graph" width="480" height="{canvasheight}"></canvas>
61 61 <ul id="graphnodes"></ul>
62 62 </div>
63 63
64 64 <script type="text/javascript">
65 65 <!-- hide script content
66 66
67 67 var data = {jsdata|json};
68 68 var graph = new Graph();
69 69 graph.scale({bg_height});
70 70
71 71 graph.vertex = function(x, y, color, parity, cur) \{
72 72
73 73 this.ctx.beginPath();
74 74 color = this.setColor(color, 0.25, 0.75);
75 75 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
76 76 this.ctx.fill();
77 77
78 var bg = '<li class="bg parity' + parity + '"></li>';
78 var bg = '<li class="bg"></li>';
79 79 var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
80 80 var nstyle = 'padding-left: ' + left + 'px;';
81 81
82 82 var tagspan = '';
83 83 if (cur[7].length || cur[8].length || (cur[6][0] != 'default' || cur[6][1])) \{
84 84 tagspan = '<span class="logtags">';
85 85 if (cur[6][1]) \{
86 86 tagspan += '<span class="branchhead" title="' + cur[6][0] + '">';
87 87 tagspan += cur[6][0] + '</span> ';
88 88 } else if (!cur[6][1] && cur[6][0] != 'default') \{
89 89 tagspan += '<span class="branchname" title="' + cur[6][0] + '">';
90 90 tagspan += cur[6][0] + '</span> ';
91 91 }
92 92 if (cur[7].length) \{
93 93 for (var t in cur[7]) \{
94 94 var tag = cur[7][t];
95 95 tagspan += '<span class="tag">' + tag + '</span> ';
96 96 }
97 97 }
98 98 if (cur[8].length) \{
99 99 for (var b in cur[8]) \{
100 100 var bookmark = cur[8][b];
101 101 tagspan += '<span class="tag">' + bookmark + '</span> ';
102 102 }
103 103 }
104 104 tagspan += '</span>';
105 105 }
106 106
107 107 var item = '<li style="' + nstyle + '"><span class="desc">';
108 108 item += '<a href="{url|urlescape}rev/' + cur[0] + '{sessionvars%urlparameter}" title="' + cur[0] + '">' + cur[3] + '</a>';
109 109 item += '</span>' + tagspan + '<span class="info">' + cur[5] + ', by ' + cur[4] + '</span></li>';
110 110
111 111 return [bg, item];
112 112
113 113 }
114 114
115 115 graph.render(data);
116 116
117 117 // stop hiding script -->
118 118 </script>
119 119
120 120 <div class="navigate">
121 121 <a href="{url|urlescape}graph/{rev}{lessvars%urlparameter}">less</a>
122 122 <a href="{url|urlescape}graph/{rev}{morevars%urlparameter}">more</a>
123 123 | rev {rev}: {changenav%navgraph}
124 124 </div>
125 125
126 126 </div>
127 127 </div>
128 128
129 129 {footer}
@@ -1,417 +1,417
1 1 $ "$TESTDIR/hghave" serve || exit 80
2 2
3 3 Some tests for hgweb in an empty repository
4 4
5 5 $ hg init test
6 6 $ cd test
7 7 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
8 8 $ cat hg.pid >> $DAEMON_PIDS
9 9 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'shortlog')
10 10 200 Script output follows
11 11
12 12 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
13 13 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
14 14 <head>
15 15 <link rel="icon" href="/static/hgicon.png" type="image/png" />
16 16 <meta name="robots" content="index, nofollow" />
17 17 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
18 18 <script type="text/javascript" src="/static/mercurial.js"></script>
19 19
20 20 <title>test: log</title>
21 21 <link rel="alternate" type="application/atom+xml"
22 22 href="/atom-log" title="Atom feed for test" />
23 23 <link rel="alternate" type="application/rss+xml"
24 24 href="/rss-log" title="RSS feed for test" />
25 25 </head>
26 26 <body>
27 27
28 28 <div class="container">
29 29 <div class="menu">
30 30 <div class="logo">
31 31 <a href="http://mercurial.selenic.com/">
32 32 <img src="/static/hglogo.png" alt="mercurial" /></a>
33 33 </div>
34 34 <ul>
35 35 <li class="active">log</li>
36 36 <li><a href="/graph/000000000000">graph</a></li>
37 37 <li><a href="/tags">tags</a></li>
38 38 <li><a href="/bookmarks">bookmarks</a></li>
39 39 <li><a href="/branches">branches</a></li>
40 40 </ul>
41 41 <ul>
42 42 <li><a href="/rev/000000000000">changeset</a></li>
43 43 <li><a href="/file/000000000000">browse</a></li>
44 44 </ul>
45 45 <ul>
46 46
47 47 </ul>
48 48 <ul>
49 49 <li><a href="/help">help</a></li>
50 50 </ul>
51 51 <p>
52 52 <div class="atom-logo">
53 53 <a href="/atom-log" title="subscribe to atom feed">
54 54 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="atom feed">
55 55 </a>
56 56 </div>
57 57 </div>
58 58
59 59 <div class="main">
60 60 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
61 61 <h3>log</h3>
62 62
63 63 <form class="search" action="/log">
64 64
65 65 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
66 66 <div id="hint">find changesets by author, revision,
67 67 files, or words in the commit message</div>
68 68 </form>
69 69
70 70 <div class="navigate">
71 71 <a href="/shortlog/-1?revcount=30">less</a>
72 72 <a href="/shortlog/-1?revcount=120">more</a>
73 73 | rev -1:
74 74 </div>
75 75
76 76 <table class="bigtable">
77 77 <tr>
78 78 <th class="age">age</th>
79 79 <th class="author">author</th>
80 80 <th class="description">description</th>
81 81 </tr>
82 82 <tbody class="stripes2">
83 83
84 84 </tbody>
85 85 </table>
86 86
87 87 <div class="navigate">
88 88 <a href="/shortlog/-1?revcount=30">less</a>
89 89 <a href="/shortlog/-1?revcount=120">more</a>
90 90 | rev -1:
91 91 </div>
92 92
93 93 </div>
94 94 </div>
95 95
96 96 <script type="text/javascript">process_dates()</script>
97 97
98 98
99 99 </body>
100 100 </html>
101 101
102 102 $ echo babar
103 103 babar
104 104 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'log')
105 105 200 Script output follows
106 106
107 107 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
108 108 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
109 109 <head>
110 110 <link rel="icon" href="/static/hgicon.png" type="image/png" />
111 111 <meta name="robots" content="index, nofollow" />
112 112 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
113 113 <script type="text/javascript" src="/static/mercurial.js"></script>
114 114
115 115 <title>test: log</title>
116 116 <link rel="alternate" type="application/atom+xml"
117 117 href="/atom-log" title="Atom feed for test" />
118 118 <link rel="alternate" type="application/rss+xml"
119 119 href="/rss-log" title="RSS feed for test" />
120 120 </head>
121 121 <body>
122 122
123 123 <div class="container">
124 124 <div class="menu">
125 125 <div class="logo">
126 126 <a href="http://mercurial.selenic.com/">
127 127 <img src="/static/hglogo.png" alt="mercurial" /></a>
128 128 </div>
129 129 <ul>
130 130 <li class="active">log</li>
131 131 <li><a href="/graph/000000000000">graph</a></li>
132 132 <li><a href="/tags">tags</a></li>
133 133 <li><a href="/bookmarks">bookmarks</a></li>
134 134 <li><a href="/branches">branches</a></li>
135 135 </ul>
136 136 <ul>
137 137 <li><a href="/rev/000000000000">changeset</a></li>
138 138 <li><a href="/file/000000000000">browse</a></li>
139 139 </ul>
140 140 <ul>
141 141
142 142 </ul>
143 143 <ul>
144 144 <li><a href="/help">help</a></li>
145 145 </ul>
146 146 <p>
147 147 <div class="atom-logo">
148 148 <a href="/atom-log" title="subscribe to atom feed">
149 149 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="atom feed">
150 150 </a>
151 151 </div>
152 152 </div>
153 153
154 154 <div class="main">
155 155 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
156 156 <h3>log</h3>
157 157
158 158 <form class="search" action="/log">
159 159
160 160 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
161 161 <div id="hint">find changesets by author, revision,
162 162 files, or words in the commit message</div>
163 163 </form>
164 164
165 165 <div class="navigate">
166 166 <a href="/shortlog/-1?revcount=5">less</a>
167 167 <a href="/shortlog/-1?revcount=20">more</a>
168 168 | rev -1:
169 169 </div>
170 170
171 171 <table class="bigtable">
172 172 <tr>
173 173 <th class="age">age</th>
174 174 <th class="author">author</th>
175 175 <th class="description">description</th>
176 176 </tr>
177 177 <tbody class="stripes2">
178 178
179 179 </tbody>
180 180 </table>
181 181
182 182 <div class="navigate">
183 183 <a href="/shortlog/-1?revcount=5">less</a>
184 184 <a href="/shortlog/-1?revcount=20">more</a>
185 185 | rev -1:
186 186 </div>
187 187
188 188 </div>
189 189 </div>
190 190
191 191 <script type="text/javascript">process_dates()</script>
192 192
193 193
194 194 </body>
195 195 </html>
196 196
197 197 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'graph')
198 198 200 Script output follows
199 199
200 200 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
201 201 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
202 202 <head>
203 203 <link rel="icon" href="/static/hgicon.png" type="image/png" />
204 204 <meta name="robots" content="index, nofollow" />
205 205 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
206 206 <script type="text/javascript" src="/static/mercurial.js"></script>
207 207
208 208 <title>test: revision graph</title>
209 209 <link rel="alternate" type="application/atom+xml"
210 210 href="/atom-log" title="Atom feed for test: log" />
211 211 <link rel="alternate" type="application/rss+xml"
212 212 href="/rss-log" title="RSS feed for test: log" />
213 213 <!--[if IE]><script type="text/javascript" src="/static/excanvas.js"></script><![endif]-->
214 214 </head>
215 215 <body>
216 216
217 217 <div class="container">
218 218 <div class="menu">
219 219 <div class="logo">
220 220 <a href="http://mercurial.selenic.com/">
221 221 <img src="/static/hglogo.png" alt="mercurial" /></a>
222 222 </div>
223 223 <ul>
224 224 <li><a href="/shortlog/000000000000">log</a></li>
225 225 <li class="active">graph</li>
226 226 <li><a href="/tags">tags</a></li>
227 227 <li><a href="/bookmarks">bookmarks</a></li>
228 228 <li><a href="/branches">branches</a></li>
229 229 </ul>
230 230 <ul>
231 231 <li><a href="/rev/000000000000">changeset</a></li>
232 232 <li><a href="/file/000000000000">browse</a></li>
233 233 </ul>
234 234 <ul>
235 235 <li><a href="/help">help</a></li>
236 236 </ul>
237 237 <p>
238 238 <div class="atom-logo">
239 239 <a href="/atom-log" title="subscribe to atom feed">
240 240 <img class="atom-logo" src="/static/feed-icon-14x14.png" alt="atom feed">
241 241 </a>
242 242 </div>
243 243 </div>
244 244
245 245 <div class="main">
246 246 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
247 247 <h3>graph</h3>
248 248
249 249 <form class="search" action="/log">
250 250
251 251 <p><input name="rev" id="search1" type="text" size="30" /></p>
252 252 <div id="hint">find changesets by author, revision,
253 253 files, or words in the commit message</div>
254 254 </form>
255 255
256 256 <div class="navigate">
257 257 <a href="/graph/-1?revcount=30">less</a>
258 258 <a href="/graph/-1?revcount=120">more</a>
259 259 | rev -1:
260 260 </div>
261 261
262 262 <noscript><p>The revision graph only works with JavaScript-enabled browsers.</p></noscript>
263 263
264 264 <div id="wrapper">
265 <ul id="nodebgs"></ul>
265 <ul id="nodebgs" class="stripes2"></ul>
266 266 <canvas id="graph" width="480" height="12"></canvas>
267 267 <ul id="graphnodes"></ul>
268 268 </div>
269 269
270 270 <script type="text/javascript">
271 271 <!-- hide script content
272 272
273 273 var data = [];
274 274 var graph = new Graph();
275 275 graph.scale(39);
276 276
277 277 graph.vertex = function(x, y, color, parity, cur) {
278 278
279 279 this.ctx.beginPath();
280 280 color = this.setColor(color, 0.25, 0.75);
281 281 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
282 282 this.ctx.fill();
283 283
284 var bg = '<li class="bg parity' + parity + '"></li>';
284 var bg = '<li class="bg"></li>';
285 285 var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
286 286 var nstyle = 'padding-left: ' + left + 'px;';
287 287
288 288 var tagspan = '';
289 289 if (cur[7].length || cur[8].length || (cur[6][0] != 'default' || cur[6][1])) {
290 290 tagspan = '<span class="logtags">';
291 291 if (cur[6][1]) {
292 292 tagspan += '<span class="branchhead" title="' + cur[6][0] + '">';
293 293 tagspan += cur[6][0] + '</span> ';
294 294 } else if (!cur[6][1] && cur[6][0] != 'default') {
295 295 tagspan += '<span class="branchname" title="' + cur[6][0] + '">';
296 296 tagspan += cur[6][0] + '</span> ';
297 297 }
298 298 if (cur[7].length) {
299 299 for (var t in cur[7]) {
300 300 var tag = cur[7][t];
301 301 tagspan += '<span class="tag">' + tag + '</span> ';
302 302 }
303 303 }
304 304 if (cur[8].length) {
305 305 for (var b in cur[8]) {
306 306 var bookmark = cur[8][b];
307 307 tagspan += '<span class="tag">' + bookmark + '</span> ';
308 308 }
309 309 }
310 310 tagspan += '</span>';
311 311 }
312 312
313 313 var item = '<li style="' + nstyle + '"><span class="desc">';
314 314 item += '<a href="/rev/' + cur[0] + '" title="' + cur[0] + '">' + cur[3] + '</a>';
315 315 item += '</span>' + tagspan + '<span class="info">' + cur[5] + ', by ' + cur[4] + '</span></li>';
316 316
317 317 return [bg, item];
318 318
319 319 }
320 320
321 321 graph.render(data);
322 322
323 323 // stop hiding script -->
324 324 </script>
325 325
326 326 <div class="navigate">
327 327 <a href="/graph/-1?revcount=30">less</a>
328 328 <a href="/graph/-1?revcount=120">more</a>
329 329 | rev -1:
330 330 </div>
331 331
332 332 </div>
333 333 </div>
334 334
335 335 <script type="text/javascript">process_dates()</script>
336 336
337 337
338 338 </body>
339 339 </html>
340 340
341 341 $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file')
342 342 200 Script output follows
343 343
344 344 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
345 345 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
346 346 <head>
347 347 <link rel="icon" href="/static/hgicon.png" type="image/png" />
348 348 <meta name="robots" content="index, nofollow" />
349 349 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
350 350 <script type="text/javascript" src="/static/mercurial.js"></script>
351 351
352 352 <title>test: 000000000000 /</title>
353 353 </head>
354 354 <body>
355 355
356 356 <div class="container">
357 357 <div class="menu">
358 358 <div class="logo">
359 359 <a href="http://mercurial.selenic.com/">
360 360 <img src="/static/hglogo.png" alt="mercurial" /></a>
361 361 </div>
362 362 <ul>
363 363 <li><a href="/shortlog/000000000000">log</a></li>
364 364 <li><a href="/graph/000000000000">graph</a></li>
365 365 <li><a href="/tags">tags</a></li>
366 366 <li><a href="/bookmarks">bookmarks</a></li>
367 367 <li><a href="/branches">branches</a></li>
368 368 </ul>
369 369 <ul>
370 370 <li><a href="/rev/000000000000">changeset</a></li>
371 371 <li class="active">browse</li>
372 372 </ul>
373 373 <ul>
374 374
375 375 </ul>
376 376 <ul>
377 377 <li><a href="/help">help</a></li>
378 378 </ul>
379 379 </div>
380 380
381 381 <div class="main">
382 382 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
383 383 <h3>directory / @ -1:000000000000 <span class="tag">tip</span> </h3>
384 384
385 385 <form class="search" action="/log">
386 386
387 387 <p><input name="rev" id="search1" type="text" size="30" /></p>
388 388 <div id="hint">find changesets by author, revision,
389 389 files, or words in the commit message</div>
390 390 </form>
391 391
392 392 <table class="bigtable">
393 393 <tr>
394 394 <th class="name">name</th>
395 395 <th class="size">size</th>
396 396 <th class="permissions">permissions</th>
397 397 </tr>
398 398 <tbody class="stripes2">
399 399 <tr class="fileline">
400 400 <td class="name"><a href="/file/000000000000/">[up]</a></td>
401 401 <td class="size"></td>
402 402 <td class="permissions">drwxr-xr-x</td>
403 403 </tr>
404 404
405 405
406 406 </tbody>
407 407 </table>
408 408 </div>
409 409 </div>
410 410 <script type="text/javascript">process_dates()</script>
411 411
412 412
413 413 </body>
414 414 </html>
415 415
416 416
417 417 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now