templates/coal/graph.tmpl
author Benoit Allard <benoit@aeteurope.nl>
Tue, 25 Nov 2008 22:32:11 +0100
changeset 7408 f031a12dfc31
parent 7345 55651328dfcc
permissions -rw-r--r--
coal/paper/monoblue: show branch names in hgweb graph
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6691
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
     1
{header}
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
     2
<title>{repo|escape}: revision graph</title>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
     3
<link rel="alternate" type="application/atom+xml"
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
     4
   href="{url}atom-log" title="Atom feed for {repo|escape}: log">
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
     5
<link rel="alternate" type="application/rss+xml"
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
     6
   href="{url}rss-log" title="RSS feed for {repo|escape}: log">
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
     7
<!--[if IE]><script type="text/javascript" src="{staticurl}excanvas.js"></script><![endif]-->
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
     8
</head>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
     9
<body>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    10
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    11
<div class="container">
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    12
<div class="menu">
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    13
<div class="logo">
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    14
<a href="http://www.selenic.com/mercurial/">
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    15
<img src="{staticurl}hglogo.png" width=75 height=90 border=0 alt="mercurial"></a>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    16
</div>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    17
<ul>
6775
54ccf41761c9 coal: include current node in log, graph menu links
Brendan Cully <brendan@kublai.com>
parents: 6733
diff changeset
    18
<li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
6691
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    19
<li class="active">graph</li>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    20
<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    21
</ul>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    22
<ul>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    23
<li><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    24
<li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    25
</ul>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    26
</div>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    27
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    28
<div class="main">
7331
650e9d6988cb Keep sessionvars with repository links added in a0843c82d1a2
Thomas Arendsen Hein <thomas@intevation.de>
parents: 7327
diff changeset
    29
<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
6691
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    30
<h3>graph</h3>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    31
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    32
<form class="search" action="{url}log">
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    33
{sessionvars%hiddenformentry}
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    34
<p><input name="rev" id="search1" type="text" size="30"></p>
7327
a1758089ee35 Kill trailing whitespace in templates
Thomas Arendsen Hein <thomas@intevation.de>
parents: 7314
diff changeset
    35
<span>find changesets by author, revision,
7299
288dda59233c coal/paper: show a search tip when hovering over search box
Benoit Allard <benoit@aeteurope.nl>
parents: 7124
diff changeset
    36
files, or words in the commit message</span>
6691
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    37
</form>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    38
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    39
<div class="navigate">
7345
55651328dfcc hgweb: fix up the less/more links on the graph page
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 7333
diff changeset
    40
<a href="{url}graph/{rev}{lessvars%urlparameter}">less</a>
55651328dfcc hgweb: fix up the less/more links on the graph page
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 7333
diff changeset
    41
<a href="{url}graph/{rev}{morevars%urlparameter}">more</a>
7333
ee12d9dc5cbb hgweb: show revision number in the graph pagination
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 7331
diff changeset
    42
| rev {rev}: {changenav%navgraphentry}
6691
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    43
</div>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    44
7124
63579aa36c8e graph: replace the blinking no javascript message
Benoit Allard <benoit@aeteurope.nl>
parents: 6905
diff changeset
    45
<noscript>The revision graph only works with JavaScript-enabled browsers.</noscript>
6691
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    46
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    47
<div id="wrapper">
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    48
<ul id="nodebgs"></ul>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    49
<canvas id="graph" width="224" height="{canvasheight}"></canvas>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    50
<ul id="graphnodes"></ul>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    51
</div>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    52
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    53
<script type="text/javascript" src="{staticurl}graph.js"></script>
6905
248e54a9456e coal/paper: make output well-formed and fix css syntax error breaking rendering
Rocco Rutte <pdmef@gmx.net>
parents: 6775
diff changeset
    54
<script type="text/javascript">
6729
855851eae70f graph: improve script hiding tricks
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6728
diff changeset
    55
<!-- hide script content
6691
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    56
6733
936a9073bb73 graph: fix JavaScript issues to make it work on IE
Benoit Allard <benoit@aeteurope.nl>
parents: 6729
diff changeset
    57
var data = {jsdata|json};
936a9073bb73 graph: fix JavaScript issues to make it work on IE
Benoit Allard <benoit@aeteurope.nl>
parents: 6729
diff changeset
    58
var graph = new Graph();
6691
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    59
graph.scale({bg_height});
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    60
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    61
graph.edge = function(x0, y0, x1, y1, color) {
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    62
	
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    63
	this.setColor(color, 0.0, 0.65);
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    64
	this.ctx.beginPath();
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    65
	this.ctx.moveTo(x0, y0);
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    66
	this.ctx.lineTo(x1, y1);
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    67
	this.ctx.stroke();
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    68
	
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    69
}
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    70
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    71
var revlink = '<li style="_STYLE"><span class="desc">';
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    72
revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>';
7408
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
    73
revlink += '</span>_TAGS<span class="info">_DATE ago, by _USER</span></li>';
6691
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    74
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    75
graph.vertex = function(x, y, color, parity, cur) {
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    76
	
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    77
	this.ctx.beginPath();
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    78
	color = this.setColor(color, 0.25, 0.75);
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    79
	this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    80
	this.ctx.fill();
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    81
	
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    82
	var bg = '<li class="bg parity' + parity + '"></li>';
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    83
	var left = (this.columns + 1) * this.bg_height;
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    84
	var nstyle = 'padding-left: ' + left + 'px;';
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    85
	var item = revlink.replace(/_STYLE/, nstyle);
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    86
	item = item.replace(/_PARITY/, 'parity' + parity);
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    87
	item = item.replace(/_NODEID/, cur[0]);
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    88
	item = item.replace(/_NODEID/, cur[0]);
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    89
	item = item.replace(/_DESC/, cur[3]);
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    90
	item = item.replace(/_USER/, cur[4]);
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
    91
	item = item.replace(/_DATE/, cur[5]);
7408
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
    92
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
    93
	var tagspan = '';
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
    94
	if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) {
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
    95
		tagspan = '<span class="logtags">';
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
    96
		if (cur[6][1]) {
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
    97
			tagspan += '<span class="branchhead" title="' + cur[6][0] + '">';
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
    98
			tagspan += cur[6][0] + '</span> ';
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
    99
		} else if (!cur[6][1] && cur[6][0] != 'default') {
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
   100
			tagspan += '<span class="branchname" title="' + cur[6][0] + '">';
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
   101
			tagspan += cur[6][0] + '</span> ';
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
   102
		}
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
   103
		if (cur[7].length) {
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
   104
			for (var t in cur[7]) {
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
   105
				var tag = cur[7][t];
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
   106
				tagspan += '<span class="tag">' + tag + '</span> ';
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
   107
			}
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
   108
		}
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
   109
		tagspan += '</span>';
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
   110
	}
6728
84294e3710b8 graph: optimize rendering by appending all nodes at once
Augie Fackler <durin42@gmail.com>
parents: 6720
diff changeset
   111
	
7408
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7345
diff changeset
   112
	item = item.replace(/_TAGS/, tagspan);
6728
84294e3710b8 graph: optimize rendering by appending all nodes at once
Augie Fackler <durin42@gmail.com>
parents: 6720
diff changeset
   113
	return [bg, item];
6691
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
   114
	
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
   115
}
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
   116
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
   117
graph.render(data);
6729
855851eae70f graph: improve script hiding tricks
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6728
diff changeset
   118
855851eae70f graph: improve script hiding tricks
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6728
diff changeset
   119
// stop hiding script -->
6691
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
   120
</script>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
   121
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
   122
<div class="navigate">
7345
55651328dfcc hgweb: fix up the less/more links on the graph page
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 7333
diff changeset
   123
<a href="{url}graph/{rev}{lessvars%urlparameter}">less</a>
55651328dfcc hgweb: fix up the less/more links on the graph page
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 7333
diff changeset
   124
<a href="{url}graph/{rev}{morevars%urlparameter}">more</a>
7333
ee12d9dc5cbb hgweb: show revision number in the graph pagination
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 7331
diff changeset
   125
| rev {rev}: {changenav%navgraphentry}
6691
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
   126
</div>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
   127
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
   128
</div>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
   129
</div>
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
   130
0dba955c2636 add graph page to hgweb
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
   131
{footer}