slitaz-dev-tools diff slitaz-mercurial-style/templates/slitaz/graph.tmpl @ rev 14
Add slitaz-mercurial-style.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Thu Feb 24 07:39:10 2011 +0000 (2011-02-24) |
parents | |
children | 9fd89b8d6ce2 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/slitaz-mercurial-style/templates/slitaz/graph.tmpl Thu Feb 24 07:39:10 2011 +0000 1.3 @@ -0,0 +1,150 @@ 1.4 +{header} 1.5 +<title>{repo|escape}: revision graph</title> 1.6 +<link rel="alternate" type="application/atom+xml" 1.7 + href="{url}atom-log" title="Atom feed for {repo|escape}: log" /> 1.8 +<link rel="alternate" type="application/rss+xml" 1.9 + href="{url}rss-log" title="RSS feed for {repo|escape}: log" /> 1.10 +<!--[if IE]><script type="text/javascript" src="{staticurl}excanvas.js"></script><![endif]--> 1.11 +</head> 1.12 +<body> 1.13 + 1.14 +<!-- Header --> 1.15 +<div id="header"> 1.16 + <a href="http://hg.slitaz.org/"><img id="logo" 1.17 + src="{staticurl}logo.png" 1.18 + title="hg.slitaz.org" alt="hg.slitaz.org" /></a> 1.19 + <p id="titre">#!/Hg/repos</p> 1.20 +</div> 1.21 + 1.22 +<!-- Content --> 1.23 +<div id="content-full"> 1.24 + 1.25 +<!-- Block begin --> 1.26 +<div class="block"> 1.27 + <!-- Nav block begin --> 1.28 + <div id="block_nav"> 1.29 + <h3><img src="{staticurl}network.png" alt="png" />Navigation</h3> 1.30 + <ul> 1.31 + <li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li> 1.32 + <li class="active">graph</li> 1.33 + <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li> 1.34 + <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li> 1.35 + <li><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li> 1.36 + <li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li> 1.37 + </ul> 1.38 + <!-- Nav block end --> 1.39 + </div> 1.40 + <!-- Top block begin --> 1.41 + <div id="block_top"> 1.42 + <h1>Project: {repo|escape}</h1> 1.43 + <p> 1.44 + This web interface lets you follow in real time all improvements, 1.45 + fixes and other changes made by SliTaz GNU/Linux contributors. 1.46 + </p> 1.47 + <h3>Search</h3> 1.48 + <form class="search" action="{url}log"> 1.49 + {sessionvars%hiddenformentry} 1.50 + <p><input name="rev" id="search1" type="text" /></p> 1.51 + <div id="hint">find changesets by author, revision, 1.52 + files, or words in the commit message</div> 1.53 + </form> 1.54 + <!-- Top block end --> 1.55 + </div> 1.56 +<!-- Block end --> 1.57 +</div> 1.58 + 1.59 +<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a> graph</h2> 1.60 + 1.61 +<div class="navigate"> 1.62 +<a href="{url}graph/{rev}{lessvars%urlparameter}">less</a> 1.63 +<a href="{url}graph/{rev}{morevars%urlparameter}">more</a> 1.64 +| rev {rev}: {changenav%navgraphentry} 1.65 +</div> 1.66 + 1.67 +<noscript><p>The revision graph only works with JavaScript-enabled browsers.</p></noscript> 1.68 + 1.69 +<div id="wrapper"> 1.70 +<ul id="nodebgs"></ul> 1.71 +<canvas id="graph" width="224" height="{canvasheight}"></canvas> 1.72 +<ul id="graphnodes"></ul> 1.73 +</div> 1.74 + 1.75 +<script type="text/javascript" src="{staticurl}graph.js"></script> 1.76 +<script type="text/javascript"> 1.77 +<!-- hide script content 1.78 + 1.79 +var data = {jsdata|json}; 1.80 +var graph = new Graph(); 1.81 +graph.scale({bg_height}); 1.82 + 1.83 +graph.edge = function(x0, y0, x1, y1, color) { 1.84 + 1.85 + this.setColor(color, 0.0, 0.65); 1.86 + this.ctx.beginPath(); 1.87 + this.ctx.moveTo(x0, y0); 1.88 + this.ctx.lineTo(x1, y1); 1.89 + this.ctx.stroke(); 1.90 + 1.91 +} 1.92 + 1.93 +var revlink = '<li style="_STYLE"><span class="desc">'; 1.94 +revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>'; 1.95 +revlink += '</span>_TAGS<span class="info">_DATE ago, by _USER</span></li>'; 1.96 + 1.97 +graph.vertex = function(x, y, color, parity, cur) { 1.98 + 1.99 + this.ctx.beginPath(); 1.100 + color = this.setColor(color, 0.25, 0.75); 1.101 + this.ctx.arc(x, y, radius, 0, Math.PI * 2, true); 1.102 + this.ctx.fill(); 1.103 + 1.104 + var bg = '<li class="bg parity' + parity + '"></li>'; 1.105 + var left = (this.columns + 1) * this.bg_height; 1.106 + var nstyle = 'padding-left: ' + left + 'px;'; 1.107 + var item = revlink.replace(/_STYLE/, nstyle); 1.108 + item = item.replace(/_PARITY/, 'parity' + parity); 1.109 + item = item.replace(/_NODEID/, cur[0]); 1.110 + item = item.replace(/_NODEID/, cur[0]); 1.111 + item = item.replace(/_DESC/, cur[3]); 1.112 + item = item.replace(/_USER/, cur[4]); 1.113 + item = item.replace(/_DATE/, cur[5]); 1.114 + 1.115 + var tagspan = ''; 1.116 + if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) { 1.117 + tagspan = '<span class="logtags">'; 1.118 + if (cur[6][1]) { 1.119 + tagspan += '<span class="branchhead" title="' + cur[6][0] + '">'; 1.120 + tagspan += cur[6][0] + '</span> '; 1.121 + } else if (!cur[6][1] && cur[6][0] != 'default') { 1.122 + tagspan += '<span class="branchname" title="' + cur[6][0] + '">'; 1.123 + tagspan += cur[6][0] + '</span> '; 1.124 + } 1.125 + if (cur[7].length) { 1.126 + for (var t in cur[7]) { 1.127 + var tag = cur[7][t]; 1.128 + tagspan += '<span class="tag">' + tag + '</span> '; 1.129 + } 1.130 + } 1.131 + tagspan += '</span>'; 1.132 + } 1.133 + 1.134 + item = item.replace(/_TAGS/, tagspan); 1.135 + return [bg, item]; 1.136 + 1.137 +} 1.138 + 1.139 +graph.render(data); 1.140 + 1.141 +// stop hiding script --> 1.142 +</script> 1.143 + 1.144 +<div class="navigate"> 1.145 +<a href="{url}graph/{rev}{lessvars%urlparameter}">less</a> 1.146 +<a href="{url}graph/{rev}{morevars%urlparameter}">more</a> 1.147 +| rev {rev}: {changenav%navgraphentry} 1.148 +</div> 1.149 + 1.150 +<!-- End of content --> 1.151 +</div> 1.152 + 1.153 +{footer}