annotate mercurial/templates/gitweb/graph.tmpl @ 32992:816a4fa7d5f8

hgweb: use separate CSS class for navigation links in footer 2d93d2159e30 changed the styling of the "page_nav" CSS class to use flexbox to separate elements within the <div>. I didn't realize that this class was used outside of the links in the header. So this resulted in incorrectly formatting links in the footer of various pages. Fix that by introducing a new CSS class that preserves the old CSS behavior.
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 20 Jun 2017 20:53:29 -0700
parents 2d93d2159e30
children 69a865dc2ada
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8427
cebdfdcc3e42 git: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8356
diff changeset
1 {header}
cebdfdcc3e42 git: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8356
diff changeset
2 <title>{repo|escape}: Graph</title>
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
3 <link rel="alternate" type="application/atom+xml"
18526
9409aeaafdc1 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents: 18258
diff changeset
4 href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
5 <link rel="alternate" type="application/rss+xml"
18526
9409aeaafdc1 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents: 18258
diff changeset
6 href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
9409aeaafdc1 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents: 18258
diff changeset
7 <!--[if IE]><script type="text/javascript" src="{staticurl|urlescape}excanvas.js"></script><![endif]-->
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
8 </head>
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
9 <body>
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
10
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
11 <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
12 <a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
bebb05a7e249 hgweb: add a "URL breadcrumb" to the index and repository pages
Angel Ezquerra <angel.ezquerra at gmail.com>
parents: 17580
diff changeset
13 <a href="/">Mercurial</a> {pathdef%breadcrumb} / graph
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
14 </div>
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
15
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
16 <div class="page_nav">
32762
2d93d2159e30 hgweb: refresh styling of gitweb's search form
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32761
diff changeset
17 <div>
18526
9409aeaafdc1 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents: 18258
diff changeset
18 <a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
26666
e901df65b108 gitweb: don't drop current revision context on graph page
Anton Shestakov <av6@dwimlabs.net>
parents: 25605
diff changeset
19 <a href="{url|urlescape}shortlog/{symrev}{sessionvars%urlparameter}">shortlog</a> |
25605
dd89304687a3 hgweb: don't dereference symbolic revision in gitweb style
Anton Shestakov <av6@dwimlabs.net>
parents: 20254
diff changeset
20 <a href="{url|urlescape}log/{symrev}{sessionvars%urlparameter}">changelog</a> |
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
21 graph |
18526
9409aeaafdc1 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents: 18258
diff changeset
22 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
9409aeaafdc1 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents: 18258
diff changeset
23 <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
9409aeaafdc1 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents: 18258
diff changeset
24 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
25605
dd89304687a3 hgweb: don't dereference symbolic revision in gitweb style
Anton Shestakov <av6@dwimlabs.net>
parents: 20254
diff changeset
25 <a href="{url|urlescape}file/{symrev}{sessionvars%urlparameter}">files</a> |
18526
9409aeaafdc1 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents: 18258
diff changeset
26 <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
27 <br/>
25605
dd89304687a3 hgweb: don't dereference symbolic revision in gitweb style
Anton Shestakov <av6@dwimlabs.net>
parents: 20254
diff changeset
28 <a href="{url|urlescape}graph/{symrev}{lessvars%urlparameter}">less</a>
dd89304687a3 hgweb: don't dereference symbolic revision in gitweb style
Anton Shestakov <av6@dwimlabs.net>
parents: 20254
diff changeset
29 <a href="{url|urlescape}graph/{symrev}{morevars%urlparameter}">more</a>
32762
2d93d2159e30 hgweb: refresh styling of gitweb's search form
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32761
diff changeset
30 | {changenav%navgraph}
2d93d2159e30 hgweb: refresh styling of gitweb's search form
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32761
diff changeset
31 </div>
2d93d2159e30 hgweb: refresh styling of gitweb's search form
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32761
diff changeset
32 {searchform}
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
33 </div>
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
34
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
35 <div class="title">&nbsp;</div>
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
36
7124
63579aa36c8e graph: replace the blinking no javascript message
Benoit Allard <benoit@aeteurope.nl>
parents: 6733
diff changeset
37 <noscript>The revision graph only works with JavaScript-enabled browsers.</noscript>
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
38
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
39 <div id="wrapper">
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
40 <ul id="nodebgs"></ul>
27913
91ac8cb79125 templates: use canvaswidth instead of fixed width for canvas (issue2683)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26666
diff changeset
41 <canvas id="graph" width="{canvaswidth}" height="{canvasheight}"></canvas>
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
42 <ul id="graphnodes"></ul>
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
43 </div>
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
44
30766
d7bf7d2bd5ab hgweb: support Content Security Policy
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27913
diff changeset
45 <script{if(nonce, ' nonce="{nonce}"')}>
6729
855851eae70f graph: improve script hiding tricks
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6728
diff changeset
46 <!-- hide script content
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
47
6733
936a9073bb73 graph: fix JavaScript issues to make it work on IE
Benoit Allard <benoit@aeteurope.nl>
parents: 6729
diff changeset
48 var data = {jsdata|json};
936a9073bb73 graph: fix JavaScript issues to make it work on IE
Benoit Allard <benoit@aeteurope.nl>
parents: 6729
diff changeset
49 var graph = new Graph();
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
50 graph.scale({bg_height});
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
51
10856
b07bd417115b templates: escape javascript braces
Matt Mackall <mpm@selenic.com>
parents: 10278
diff changeset
52 graph.vertex = function(x, y, color, parity, cur) \{
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
53
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
54 this.ctx.beginPath();
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
55 color = this.setColor(color, 0.25, 0.75);
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
56 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
57 this.ctx.fill();
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
58
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
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;
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
61 var nstyle = 'padding-left: ' + left + 'px;';
6720
084c9f1ef2bd graph: display branch name alongside tags
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6701
diff changeset
62
084c9f1ef2bd graph: display branch name alongside tags
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6701
diff changeset
63 var tagspan = '';
13863
b602ac02f1ba hgweb: add bookmark labels to gitweb 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])) \{
6720
084c9f1ef2bd graph: display branch name alongside tags
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6701
diff changeset
65 tagspan = '<span class="logtags">';
10856
b07bd417115b templates: escape javascript braces
Matt Mackall <mpm@selenic.com>
parents: 10278
diff changeset
66 if (cur[6][1]) \{
6720
084c9f1ef2bd graph: display branch name alongside tags
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6701
diff changeset
67 tagspan += '<span class="branchtag" title="' + cur[6][0] + '">';
084c9f1ef2bd graph: display branch name alongside tags
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6701
diff changeset
68 tagspan += cur[6][0] + '</span> ';
10856
b07bd417115b templates: escape javascript braces
Matt Mackall <mpm@selenic.com>
parents: 10278
diff changeset
69 } else if (!cur[6][1] && cur[6][0] != 'default') \{
6720
084c9f1ef2bd graph: display branch name alongside tags
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6701
diff changeset
70 tagspan += '<span class="inbranchtag" title="' + cur[6][0] + '">';
084c9f1ef2bd graph: display branch name alongside tags
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6701
diff changeset
71 tagspan += cur[6][0] + '</span> ';
084c9f1ef2bd graph: display branch name alongside tags
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6701
diff changeset
72 }
10856
b07bd417115b templates: escape javascript braces
Matt Mackall <mpm@selenic.com>
parents: 10278
diff changeset
73 if (cur[7].length) \{
b07bd417115b templates: escape javascript braces
Matt Mackall <mpm@selenic.com>
parents: 10278
diff changeset
74 for (var t in cur[7]) \{
6720
084c9f1ef2bd graph: display branch name alongside tags
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6701
diff changeset
75 var tag = cur[7][t];
084c9f1ef2bd graph: display branch name alongside tags
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6701
diff changeset
76 tagspan += '<span class="tagtag">' + tag + '</span> ';
084c9f1ef2bd graph: display branch name alongside tags
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6701
diff changeset
77 }
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
78 }
13863
b602ac02f1ba hgweb: add bookmark labels to gitweb theme (based on 270f57d35525)
Yuya Nishihara <yuya@tcha.org>
parents: 13610
diff changeset
79 if (cur[8].length) \{
b602ac02f1ba hgweb: add bookmark labels to gitweb theme (based on 270f57d35525)
Yuya Nishihara <yuya@tcha.org>
parents: 13610
diff changeset
80 for (var t in cur[8]) \{
b602ac02f1ba hgweb: add bookmark labels to gitweb theme (based on 270f57d35525)
Yuya Nishihara <yuya@tcha.org>
parents: 13610
diff changeset
81 var bookmark = cur[8][t];
b602ac02f1ba hgweb: add bookmark labels to gitweb theme (based on 270f57d35525)
Yuya Nishihara <yuya@tcha.org>
parents: 13610
diff changeset
82 tagspan += '<span class="bookmarktag">' + bookmark + '</span> ';
b602ac02f1ba hgweb: add bookmark labels to gitweb theme (based on 270f57d35525)
Yuya Nishihara <yuya@tcha.org>
parents: 13610
diff changeset
83 }
b602ac02f1ba hgweb: add bookmark labels to gitweb theme (based on 270f57d35525)
Yuya Nishihara <yuya@tcha.org>
parents: 13610
diff changeset
84 }
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
85 tagspan += '</span>';
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
86 }
6720
084c9f1ef2bd graph: display branch name alongside tags
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6701
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">';
18526
9409aeaafdc1 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents: 18258
diff changeset
89 item += '<a class="list" href="{url|urlescape}rev/' + cur[0] + '{sessionvars%urlparameter}" title="' + cur[0] + '"><b>' + cur[3] + '</b></a>';
17421
3eb85477c0d9 hgweb: avoid bad $$ processing in graph (issue3601)
Mads Kiilerich <mads@kiilerich.com>
parents: 16137
diff changeset
90 item += '</span> ' + tagspan + '';
3eb85477c0d9 hgweb: avoid bad $$ processing in graph (issue3601)
Mads Kiilerich <mads@kiilerich.com>
parents: 16137
diff changeset
91 item += '<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
92
6728
84294e3710b8 graph: optimize rendering by appending all nodes at once
Augie Fackler <durin42@gmail.com>
parents: 6727
diff changeset
93 return [bg, item];
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
94
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
95 }
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
96
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
97 graph.render(data);
6729
855851eae70f graph: improve script hiding tricks
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6728
diff changeset
98
855851eae70f graph: improve script hiding tricks
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6728
diff changeset
99 // stop hiding script -->
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
100 </script>
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
101
32992
816a4fa7d5f8 hgweb: use separate CSS class for navigation links in footer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 32762
diff changeset
102 <div class="extra_nav">
25605
dd89304687a3 hgweb: don't dereference symbolic revision in gitweb style
Anton Shestakov <av6@dwimlabs.net>
parents: 20254
diff changeset
103 <a href="{url|urlescape}graph/{symrev}{lessvars%urlparameter}">less</a>
dd89304687a3 hgweb: don't dereference symbolic revision in gitweb style
Anton Shestakov <av6@dwimlabs.net>
parents: 20254
diff changeset
104 <a href="{url|urlescape}graph/{symrev}{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
105 | {changenav%navgraph}
6693
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
106 </div>
7f58dec6aeb7 hgweb: Fix up non-coal styles to support graph.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
107
30766
d7bf7d2bd5ab hgweb: support Content Security Policy
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27913
diff changeset
108 <script type="text/javascript"{if(nonce, ' nonce="{nonce}"')}>
20254
3896debf0a11 hgweb: infinite scroll support for gitweb style
Takumi IINO <trot.thunder@gmail.com>
parents: 18526
diff changeset
109 ajaxScrollInit(
3896debf0a11 hgweb: infinite scroll support for gitweb style
Takumi IINO <trot.thunder@gmail.com>
parents: 18526
diff changeset
110 '{url|urlescape}graph/{rev}?revcount=%next%&style={style}',
3896debf0a11 hgweb: infinite scroll support for gitweb style
Takumi IINO <trot.thunder@gmail.com>
parents: 18526
diff changeset
111 {revcount}+60,
3896debf0a11 hgweb: infinite scroll support for gitweb style
Takumi IINO <trot.thunder@gmail.com>
parents: 18526
diff changeset
112 function (htmlText, previousVal) \{ return previousVal + 60; },
3896debf0a11 hgweb: infinite scroll support for gitweb style
Takumi IINO <trot.thunder@gmail.com>
parents: 18526
diff changeset
113 '#wrapper',
3896debf0a11 hgweb: infinite scroll support for gitweb style
Takumi IINO <trot.thunder@gmail.com>
parents: 18526
diff changeset
114 '<div class="%class%" style="text-align: center;">%text%</div>',
3896debf0a11 hgweb: infinite scroll support for gitweb style
Takumi IINO <trot.thunder@gmail.com>
parents: 18526
diff changeset
115 'graph'
3896debf0a11 hgweb: infinite scroll support for gitweb style
Takumi IINO <trot.thunder@gmail.com>
parents: 18526
diff changeset
116 );
3896debf0a11 hgweb: infinite scroll support for gitweb style
Takumi IINO <trot.thunder@gmail.com>
parents: 18526
diff changeset
117 </script>
3896debf0a11 hgweb: infinite scroll support for gitweb style
Takumi IINO <trot.thunder@gmail.com>
parents: 18526
diff changeset
118
8427
cebdfdcc3e42 git: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8356
diff changeset
119 {footer}