Mercurial > hg
annotate mercurial/templates/monoblue/graph.tmpl @ 18258:bebb05a7e249
hgweb: add a "URL breadcrumb" to the index and repository pages
The purpose of this change is to make it much easier to navigate up the
repository tree when the hg web server is used to serve more than one
repository.
A "URL breadcrumb" is a path where each of the path items can be clicked to go
to the corresponding path page.
This lets you go up the folder hierarchy very quickly. For example, when showing
the list of repositories in http://myserver/myteams/myprojects, the following
"breadcrumb" will be shown:
Mercurial > myteams > myprojects
Clicking on "myprojects" reloads the page. Clicking on "myteams" goes up one
folder. Clicking on the leftmost "Mercurial" goes to the server root.
This "breadcrumb" also appears on all repository pages. For example on the
summary page of the repository at http://myserver/myteams/myprojects/myrepo the
following will be shown:
Mercurial > myteams > myprojects > myrepo / summary
This change has been applied to all templates that already had a link to the
main repository page (i.e. gitweb, monoblue, paper and coal) plus to the index
page of the spartan template.
In order to make the breadcumb links stand out the some of the template styles
have been customized.
author | Angel Ezquerra <angel.ezquerra at gmail.com> |
---|---|
date | Wed, 28 Nov 2012 20:21:26 +0100 |
parents | ffe3630cb243 |
children | 9409aeaafdc1 |
rev | line source |
---|---|
8430
8b47efdf40ee
monoblue: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8355
diff
changeset
|
1 {header} |
8b47efdf40ee
monoblue: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8355
diff
changeset
|
2 <title>{repo|escape}: graph</title> |
8b47efdf40ee
monoblue: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8355
diff
changeset
|
3 <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/> |
8b47efdf40ee
monoblue: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8355
diff
changeset
|
4 <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/> |
8b47efdf40ee
monoblue: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8355
diff
changeset
|
5 <!--[if IE]><script type="text/javascript" src="{staticurl}excanvas.js"></script><![endif]--> |
7111 | 6 </head> |
7 | |
8 <body> | |
9 <div id="container"> | |
10 <div class="page-header"> | |
18258
bebb05a7e249
hgweb: add a "URL breadcrumb" to the index and repository pages
Angel Ezquerra <angel.ezquerra at gmail.com>
parents:
17580
diff
changeset
|
11 <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / graph</h1> |
7111 | 12 |
13 <form action="{url}log"> | |
14 {sessionvars%hiddenformentry} | |
15 <dl class="search"> | |
16 <dt><label>Search: </label></dt> | |
17 <dd><input type="text" name="rev" /></dd> | |
18 </dl> | |
19 </form> | |
20 | |
21 <ul class="page-nav"> | |
22 <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li> | |
23 <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li> | |
24 <li><a href="{url}changelog{sessionvars%urlparameter}">changelog</a></li> | |
25 <li class="current">graph</li> | |
26 <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li> | |
13860
b5b84dd43613
hgweb: add separate bookmarks listing to monoblue theme (based on 38c9837b1f75)
Yuya Nishihara <yuya@tcha.org>
parents:
13794
diff
changeset
|
27 <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li> |
8355
5ba798f339c8
monoblue: add branches page
Sune Foldager <cryo@cyanite.org>
parents:
8236
diff
changeset
|
28 <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li> |
8430
8b47efdf40ee
monoblue: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8355
diff
changeset
|
29 <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li> |
12666
ead4e21f49f1
web: add a help view for getting hg help output
Augie Fackler <durin42@gmail.com>
parents:
10856
diff
changeset
|
30 <li><a href="{url}help{sessionvars%urlparameter}">help</a></li> |
7111 | 31 </ul> |
32 </div> | |
33 | |
34 <h2 class="no-link no-border">graph</h2> | |
35 | |
36 <div id="noscript">The revision graph only works with JavaScript-enabled browsers.</div> | |
37 <div id="wrapper"> | |
38 <ul id="nodebgs"></ul> | |
13610
7359cb753a54
templates: widen the graph canvas (issue2683)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
12666
diff
changeset
|
39 <canvas id="graph" width="480" height="{canvasheight}"></canvas> |
7111 | 40 <ul id="graphnodes"></ul> |
41 </div> | |
42 | |
43 <script> | |
44 <!-- hide script content | |
45 | |
46 document.getElementById('noscript').style.display = 'none'; | |
47 | |
48 var data = {jsdata|json}; | |
49 var graph = new Graph(); | |
50 graph.scale({bg_height}); | |
51 | |
10856
b07bd417115b
templates: escape javascript braces
Matt Mackall <mpm@selenic.com>
parents:
10575
diff
changeset
|
52 graph.vertex = function(x, y, color, parity, cur) \{ |
7111 | 53 |
54 this.ctx.beginPath(); | |
55 color = this.setColor(color, 0.25, 0.75); | |
56 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true); | |
57 this.ctx.fill(); | |
58 | |
59 var bg = '<li class="bg parity' + parity + '"></li>'; | |
17580
ffe3630cb243
hgweb: fix incorrect graph padding calculation (issue3626)
Tim Delaney <timothy.c.delaney@gmail.com>
parents:
17421
diff
changeset
|
60 var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size; |
7111 | 61 var nstyle = 'padding-left: ' + left + 'px;'; |
62 | |
7408
f031a12dfc31
coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents:
7111
diff
changeset
|
63 var tagspan = ''; |
13794
5c18a0bca26f
hgweb: add bookmark labels to monoblue theme (based on 270f57d35525)
Yuya Nishihara <yuya@tcha.org>
parents:
13610
diff
changeset
|
64 if (cur[7].length || cur[8].length || (cur[6][0] != 'default' || cur[6][1])) \{ |
7408
f031a12dfc31
coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents:
7111
diff
changeset
|
65 tagspan = '<span class="logtags">'; |
10856
b07bd417115b
templates: escape javascript braces
Matt Mackall <mpm@selenic.com>
parents:
10575
diff
changeset
|
66 if (cur[6][1]) \{ |
7408
f031a12dfc31
coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents:
7111
diff
changeset
|
67 tagspan += '<span class="branchtag" title="' + cur[6][0] + '">'; |
f031a12dfc31
coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents:
7111
diff
changeset
|
68 tagspan += cur[6][0] + '</span> '; |
10856
b07bd417115b
templates: escape javascript braces
Matt Mackall <mpm@selenic.com>
parents:
10575
diff
changeset
|
69 } else if (!cur[6][1] && cur[6][0] != 'default') \{ |
7408
f031a12dfc31
coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents:
7111
diff
changeset
|
70 tagspan += '<span class="inbranchtag" title="' + cur[6][0] + '">'; |
f031a12dfc31
coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents:
7111
diff
changeset
|
71 tagspan += cur[6][0] + '</span> '; |
f031a12dfc31
coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents:
7111
diff
changeset
|
72 } |
10856
b07bd417115b
templates: escape javascript braces
Matt Mackall <mpm@selenic.com>
parents:
10575
diff
changeset
|
73 if (cur[7].length) \{ |
b07bd417115b
templates: escape javascript braces
Matt Mackall <mpm@selenic.com>
parents:
10575
diff
changeset
|
74 for (var t in cur[7]) \{ |
7408
f031a12dfc31
coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents:
7111
diff
changeset
|
75 var tag = cur[7][t]; |
f031a12dfc31
coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents:
7111
diff
changeset
|
76 tagspan += '<span class="tagtag">' + tag + '</span> '; |
f031a12dfc31
coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents:
7111
diff
changeset
|
77 } |
f031a12dfc31
coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents:
7111
diff
changeset
|
78 } |
13794
5c18a0bca26f
hgweb: add bookmark labels to monoblue theme (based on 270f57d35525)
Yuya Nishihara <yuya@tcha.org>
parents:
13610
diff
changeset
|
79 if (cur[8].length) \{ |
5c18a0bca26f
hgweb: add bookmark labels to monoblue theme (based on 270f57d35525)
Yuya Nishihara <yuya@tcha.org>
parents:
13610
diff
changeset
|
80 for (var t in cur[8]) \{ |
5c18a0bca26f
hgweb: add bookmark labels to monoblue theme (based on 270f57d35525)
Yuya Nishihara <yuya@tcha.org>
parents:
13610
diff
changeset
|
81 var bookmark = cur[8][t]; |
5c18a0bca26f
hgweb: add bookmark labels to monoblue theme (based on 270f57d35525)
Yuya Nishihara <yuya@tcha.org>
parents:
13610
diff
changeset
|
82 tagspan += '<span class="bookmarktag">' + bookmark + '</span> '; |
5c18a0bca26f
hgweb: add bookmark labels to monoblue theme (based on 270f57d35525)
Yuya Nishihara <yuya@tcha.org>
parents:
13610
diff
changeset
|
83 } |
5c18a0bca26f
hgweb: add bookmark labels to monoblue theme (based on 270f57d35525)
Yuya Nishihara <yuya@tcha.org>
parents:
13610
diff
changeset
|
84 } |
7408
f031a12dfc31
coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents:
7111
diff
changeset
|
85 tagspan += '</span>'; |
f031a12dfc31
coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents:
7111
diff
changeset
|
86 } |
f031a12dfc31
coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents:
7111
diff
changeset
|
87 |
17421
3eb85477c0d9
hgweb: avoid bad $$ processing in graph (issue3601)
Mads Kiilerich <mads@kiilerich.com>
parents:
16137
diff
changeset
|
88 var item = '<li style="' + nstyle + '"><span class="desc">'; |
3eb85477c0d9
hgweb: avoid bad $$ processing in graph (issue3601)
Mads Kiilerich <mads@kiilerich.com>
parents:
16137
diff
changeset
|
89 item += '<a href="{url}rev/' + cur[0] + '{sessionvars%urlparameter}" title="' + cur[0] + '">' + cur[3] + '</a>'; |
3eb85477c0d9
hgweb: avoid bad $$ processing in graph (issue3601)
Mads Kiilerich <mads@kiilerich.com>
parents:
16137
diff
changeset
|
90 item += '</span>' + tagspan + '<span class="info">' + cur[5] + ', by ' + cur[4] + '</span></li>'; |
3eb85477c0d9
hgweb: avoid bad $$ processing in graph (issue3601)
Mads Kiilerich <mads@kiilerich.com>
parents:
16137
diff
changeset
|
91 |
7111 | 92 return [bg, item]; |
93 | |
94 } | |
95 | |
96 graph.render(data); | |
97 | |
98 // stop hiding script --> | |
99 </script> | |
100 | |
101 <div class="page-path"> | |
7548
e8b818029ed6
monoblue: add less/more links to graph page
Pascal Quantin <pascal.quantin@gmail.com>
parents:
7408
diff
changeset
|
102 <a href="{url}graph/{rev}{lessvars%urlparameter}">less</a> |
e8b818029ed6
monoblue: add less/more links to graph page
Pascal Quantin <pascal.quantin@gmail.com>
parents:
7408
diff
changeset
|
103 <a href="{url}graph/{rev}{morevars%urlparameter}">more</a> |
10254
8d5de52431f2
hgweb: changenav: separate pages before and after the current position
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
9999
diff
changeset
|
104 | {changenav%navgraph} |
7111 | 105 </div> |
106 | |
8430
8b47efdf40ee
monoblue: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8355
diff
changeset
|
107 {footer} |