comparison mercurial/templates/spartan/graph.tmpl @ 9999:f91e5630ce7e

setup: install translation files as package data Remove the `install_package_data' subclass of `install_data' and use the `package_data' functionality provided by distutils instead. As package data must be located within the package directory, the data files are now generated in the build directory. To simplify the functionality of this change, the top-level `doc' and `templates' directories have been moved into the `mercurial' package directory.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Tue, 01 Dec 2009 16:06:10 +0100
parents templates/spartan/graph.tmpl@5c1aabc58004
children 8d5de52431f2
comparison
equal deleted inserted replaced
9998:4a3c388f8c69 9999:f91e5630ce7e
1 {header}
2 <title>{repo|escape}: graph</title>
3 <link rel="alternate" type="application/atom+xml"
4 href="{url}atom-tags" title="Atom feed for {repo|escape}: tags">
5 <link rel="alternate" type="application/rss+xml"
6 href="{url}rss-tags" title="RSS feed for {repo|escape}: tags">
7 <!--[if IE]><script type="text/javascript" src="{staticurl}excanvas.js"></script><![endif]-->
8 </head>
9 <body>
10
11 <div class="buttons">
12 <a href="{url}log{sessionvars%urlparameter}">changelog</a>
13 <a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a>
14 <a href="{url}tags{sessionvars%urlparameter}">tags</a>
15 <a href="{url}branches{sessionvars%urlparameter}">branches</a>
16 <a href="{url}file/{node|short}/{sessionvars%urlparameter}">files</a>
17 </div>
18
19 <h2>graph</h2>
20
21 <form action="{url}log">
22 {sessionvars%hiddenformentry}
23 <p>
24 <label for="search1">search:</label>
25 <input name="rev" id="search1" type="text" size="30">
26 navigate: <small class="navigate">{changenav%navgraphentry}</small>
27 </p>
28 </form>
29
30 <noscript>The revision graph only works with JavaScript-enabled browsers.</noscript>
31
32 <div id="wrapper">
33 <ul id="nodebgs"></ul>
34 <canvas id="graph" width="224" height="{canvasheight}"></canvas>
35 <ul id="graphnodes"></ul>
36 </div>
37
38 <script type="text/javascript" src="{staticurl}graph.js"></script>
39 <script type="text/javascript">
40 <!-- hide script content
41
42 var data = {jsdata|json};
43 var graph = new Graph();
44 graph.scale({bg_height});
45
46 graph.edge = function(x0, y0, x1, y1, color) {
47
48 this.setColor(color, 0.0, 0.65);
49 this.ctx.beginPath();
50 this.ctx.moveTo(x0, y0);
51 this.ctx.lineTo(x1, y1);
52 this.ctx.stroke();
53
54 }
55
56 var revlink = '<li style="_STYLE"><span class="desc">';
57 revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>';
58 revlink += '</span><span class="info">_DATE ago, by _USER</span></li>';
59
60 graph.vertex = function(x, y, color, parity, cur) {
61
62 this.ctx.beginPath();
63 color = this.setColor(color, 0.25, 0.75);
64 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
65 this.ctx.fill();
66
67 var bg = '<li class="bg parity' + parity + '"></li>';
68 var left = (this.columns + 1) * this.bg_height;
69 var nstyle = 'padding-left: ' + left + 'px;';
70 var item = revlink.replace(/_STYLE/, nstyle);
71 item = item.replace(/_PARITY/, 'parity' + parity);
72 item = item.replace(/_NODEID/, cur[0]);
73 item = item.replace(/_NODEID/, cur[0]);
74 item = item.replace(/_DESC/, cur[3]);
75 item = item.replace(/_USER/, cur[4]);
76 item = item.replace(/_DATE/, cur[5]);
77
78 return [bg, item];
79
80 }
81
82 graph.render(data);
83
84 // stop hiding script -->
85 </script>
86
87 <form action="{url}log">
88 {sessionvars%hiddenformentry}
89 <p>
90 <label for="search1">search:</label>
91 <input name="rev" id="search1" type="text" size="30">
92 navigate: <small class="navigate">{changenav%navgraphentry}</small>
93 </p>
94 </form>
95
96 {footer}