slitaz-dev-tools view slitaz-mercurial-style/templates/slitaz/graph.tmpl @ rev 170

hg style: update header link and style
author Christophe Lincoln <pankso@slitaz.org>
date Tue Apr 10 22:47:01 2012 +0200 (2012-04-10)
parents 4bea43b9ed45
children ae38bd81aa6d
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 <div id="logo"></div>
14 <div id="network">
15 <a href="http://www.slitaz.org/">Home</a>
16 <a href="http://scn.slitaz.org/">Community</a>
17 <a href="http://doc.slitaz.org/">Doc</a>
18 <a href="http://forum.slitaz.org/">Forum</a>
19 <a href="http://slitaz.pro/">Pro</a>
20 <a href="http://bugs.slitaz.org">Bugs</a>
21 <a href="http://hg.slitaz.org/">Hg</a>
22 <a href="http://cook.slitaz.org/">Cook</a>
23 </div>
24 <h1><a href="http://hg.slitaz.org/">SliTaz Repositories</a></h1>
25 </div>
27 <!-- Block -->
28 <div id="block">
29 <!-- Navigation -->
30 <div id="block_nav">
31 <h4>Navigation</h4>
32 <div class="right_box">
33 <ul>
34 <li><a href="{url}rev/{node|short}{sessionvars%urlparameter}">Changeset</a></li>
35 <li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">Browse</a></li>
36 </ul>
37 </div>
38 <div class="left_box">
39 <ul>
40 <li><a href="{url}summary{sessionvars%urlparameter}">Summary</a></li>
41 <li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">Changelog</a></li>
42 <li>Graph</li>
43 <li><a href="{url}tags{sessionvars%urlparameter}">Tags</a></li>
44 <li><a href="{url}branches{sessionvars%urlparameter}">Branches</a></li>
45 </ul>
46 </div>
47 </div>
48 <!-- Information/image -->
49 <div id="block_info">
50 <h4>Project: {repo|escape}</h4>
51 <p>
52 Clone project: hg clone http://hg.slitaz.org/{repo|escape}
53 </p>
54 <p>
55 Revision graph
56 </p>
57 <h4>Search</h4>
58 <form class="search" action="{url}log">
59 {sessionvars%hiddenformentry}
60 <p><input name="rev" id="search1" type="text" /></p>
61 <!-- <div id="hint">find changesets by author, revision,
62 files, or words in the commit message</div> -->
63 </form>
64 </div>
65 </div>
67 <!-- Content -->
68 <div id="content">
70 <h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a> graph</h2>
72 <div class="navigate">
73 <a href="{url}graph/{rev}{lessvars%urlparameter}">less</a>
74 <a href="{url}graph/{rev}{morevars%urlparameter}">more</a>
75 | rev {rev}: {changenav%navgraph}
76 </div>
78 <noscript><p>The revision graph only works with JavaScript-enabled browsers.</p></noscript>
80 <div id="wrapper">
81 <ul id="nodebgs"></ul>
82 <canvas id="graph" width="224" height="{canvasheight}"></canvas>
83 <ul id="graphnodes"></ul>
84 </div>
86 <script type="text/javascript" src="{staticurl}graph.js"></script>
87 <script type="text/javascript">
88 <!-- hide script content
90 var data = {jsdata|json};
91 var graph = new Graph();
92 graph.scale({bg_height});
94 graph.edge = function(x0, y0, x1, y1, color) \{
96 this.setColor(color, 0.0, 0.65);
97 this.ctx.beginPath();
98 this.ctx.moveTo(x0, y0);
99 this.ctx.lineTo(x1, y1);
100 this.ctx.stroke();
102 }
104 var revlink = '<li style="_STYLE"><span class="desc">';
105 revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>';
106 revlink += '</span>_TAGS<span class="info">_DATE ago, by _USER</span></li>';
108 graph.vertex = function(x, y, color, parity, cur) \{
110 this.ctx.beginPath();
111 color = this.setColor(color, 0.25, 0.75);
112 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
113 this.ctx.fill();
115 var bg = '<li class="bg parity' + parity + '"></li>';
116 var left = (this.columns + 1) * this.bg_height;
117 var nstyle = 'padding-left: ' + left + 'px;';
118 var item = revlink.replace(/_STYLE/, nstyle);
119 item = item.replace(/_PARITY/, 'parity' + parity);
120 item = item.replace(/_NODEID/, cur[0]);
121 item = item.replace(/_NODEID/, cur[0]);
122 item = item.replace(/_DESC/, cur[3]);
123 item = item.replace(/_USER/, cur[4]);
124 item = item.replace(/_DATE/, cur[5]);
126 var tagspan = '';
127 if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) \{
128 tagspan = '<span class="logtags">';
129 if (cur[6][1]) \{
130 tagspan += '<span class="branchhead" title="' + cur[6][0] + '">';
131 tagspan += cur[6][0] + '</span> ';
132 } else if (!cur[6][1] && cur[6][0] != 'default') \{
133 tagspan += '<span class="branchname" title="' + cur[6][0] + '">';
134 tagspan += cur[6][0] + '</span> ';
135 }
136 if (cur[7].length) \{
137 for (var t in cur[7]) \{
138 var tag = cur[7][t];
139 tagspan += '<span class="tag">' + tag + '</span> ';
140 }
141 }
142 tagspan += '</span>';
143 }
145 item = item.replace(/_TAGS/, tagspan);
146 return [bg, item];
148 }
150 graph.render(data);
152 // stop hiding script -->
153 </script>
155 <div class="navigate">
156 <a href="{url}graph/{rev}{lessvars%urlparameter}">less</a>
157 <a href="{url}graph/{rev}{morevars%urlparameter}">more</a>
158 | rev {rev}: {changenav%navgraph}
159 </div>
161 <!-- End of content -->
162 </div>
164 {footer}