wok view slitaz-mercurial-style/stuff/templates/slitaz/graph.tmpl @ rev 4471
slitaz-mercurial-style: tiny typos
author | Paul Issott <paul@slitaz.org> |
---|---|
date | Mon Nov 09 18:34:36 2009 +0000 (2009-11-09) |
parents | |
children | 5e5a67e17e5a |
line source
1 {header}
2 <title>{repo|escape}: revision graph</title>
3 <link rel="alternate" type="application/atom+xml"
4 href="{url}atom-log" title="Atom feed for {repo|escape}: log" />
5 <link rel="alternate" type="application/rss+xml"
6 href="{url}rss-log" title="RSS feed for {repo|escape}: log" />
7 <!--[if IE]><script type="text/javascript" src="{staticurl}excanvas.js"></script><![endif]-->
8 </head>
9 <body>
11 <!-- Header -->
12 <div id="header">
13 <a href="http://hg.slitaz.org/"><img id="logo"
14 src="{staticurl}logo.png" title="www.slitaz.org" alt="www.slitaz.org"
15 style="border: 0px solid ; width: 200px; height: 74px;" /></a>
16 <p id="titre">#!/Hg/repos</p>
17 </div>
19 <div class="container">
20 <div id="nav">
22 <div class="nav_box">
23 <h4>Navigation</h4>
24 <ul>
25 <li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
26 <li class="active">graph</li>
27 <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
28 <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
29 <li><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
30 <li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
31 </ul>
32 </div>
34 <div class="nav_box">
35 <h4>Search</h4>
36 <form class="search" action="{url}log">
37 {sessionvars%hiddenformentry}
38 <p><input name="rev" id="search1" type="text" /></p>
39 <div id="hint">find changesets by author, revision,
40 files, or words in the commit message</div>
41 </form>
42 </div>
43 </div>
45 <div class="main">
46 <h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
47 <h3>graph</h3>
49 <div class="navigate">
50 <a href="{url}graph/{rev}{lessvars%urlparameter}">less</a>
51 <a href="{url}graph/{rev}{morevars%urlparameter}">more</a>
52 | rev {rev}: {changenav%navgraphentry}
53 </div>
55 <noscript><p>The revision graph only works with JavaScript-enabled browsers.</p></noscript>
57 <div id="wrapper">
58 <ul id="nodebgs"></ul>
59 <canvas id="graph" width="224" height="{canvasheight}"></canvas>
60 <ul id="graphnodes"></ul>
61 </div>
63 <script type="text/javascript" src="{staticurl}graph.js"></script>
64 <script type="text/javascript">
65 <!-- hide script content
67 var data = {jsdata|json};
68 var graph = new Graph();
69 graph.scale({bg_height});
71 graph.edge = function(x0, y0, x1, y1, color) {
73 this.setColor(color, 0.0, 0.65);
74 this.ctx.beginPath();
75 this.ctx.moveTo(x0, y0);
76 this.ctx.lineTo(x1, y1);
77 this.ctx.stroke();
79 }
81 var revlink = '<li style="_STYLE"><span class="desc">';
82 revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>';
83 revlink += '</span>_TAGS<span class="info">_DATE ago, by _USER</span></li>';
85 graph.vertex = function(x, y, color, parity, cur) {
87 this.ctx.beginPath();
88 color = this.setColor(color, 0.25, 0.75);
89 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
90 this.ctx.fill();
92 var bg = '<li class="bg parity' + parity + '"></li>';
93 var left = (this.columns + 1) * this.bg_height;
94 var nstyle = 'padding-left: ' + left + 'px;';
95 var item = revlink.replace(/_STYLE/, nstyle);
96 item = item.replace(/_PARITY/, 'parity' + parity);
97 item = item.replace(/_NODEID/, cur[0]);
98 item = item.replace(/_NODEID/, cur[0]);
99 item = item.replace(/_DESC/, cur[3]);
100 item = item.replace(/_USER/, cur[4]);
101 item = item.replace(/_DATE/, cur[5]);
103 var tagspan = '';
104 if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) {
105 tagspan = '<span class="logtags">';
106 if (cur[6][1]) {
107 tagspan += '<span class="branchhead" title="' + cur[6][0] + '">';
108 tagspan += cur[6][0] + '</span> ';
109 } else if (!cur[6][1] && cur[6][0] != 'default') {
110 tagspan += '<span class="branchname" title="' + cur[6][0] + '">';
111 tagspan += cur[6][0] + '</span> ';
112 }
113 if (cur[7].length) {
114 for (var t in cur[7]) {
115 var tag = cur[7][t];
116 tagspan += '<span class="tag">' + tag + '</span> ';
117 }
118 }
119 tagspan += '</span>';
120 }
122 item = item.replace(/_TAGS/, tagspan);
123 return [bg, item];
125 }
127 graph.render(data);
129 // stop hiding script -->
130 </script>
132 <div class="navigate">
133 <a href="{url}graph/{rev}{lessvars%urlparameter}">less</a>
134 <a href="{url}graph/{rev}{morevars%urlparameter}">more</a>
135 | rev {rev}: {changenav%navgraphentry}
136 </div>
138 </div>
139 </div>
141 {footer}