annotate mercurial/templates/compact-paper/graph.tmpl @ 36722:b2c1a35d18f2 draft default tip

WIP: hgweb: add compact-paper style DONE: - new summary page looks good-ish - shortlog is reasonable looking - tags is reasonable looking - bookmarks is reasonable looking - branches is reasonable looking - help is reasonable looking - changeset is reasonable looking TODO: - convert other pages to use the same header - graph - browse
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Wed, 21 Feb 2018 16:40:41 -0500
parents mercurial/templates/paper/graph.tmpl@59c842a3d1e1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
1 {header}
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
2 <title>{repo|escape}: revision graph</title>
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
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}: log" />
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
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}: log" />
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
7 </head>
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
8 <body>
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
9
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
10 <div class="container">
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
11 <div class="menu">
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
12 <div class="logo">
13964
616ad3f6fd33 hgweb: support alternate logo url
Steven Stallion <sstallion@gmail.com>
parents: 13610
diff changeset
13 <a href="{logourl}">
18526
9409aeaafdc1 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents: 18258
diff changeset
14 <img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
15 </div>
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
16 <ul>
25606
3bb6f5f478a7 hgweb: don't dereference symbolic revision in paper & coal style (issue2296)
Anton Shestakov <av6@dwimlabs.net>
parents: 24041
diff changeset
17 <li><a href="{url|urlescape}shortlog/{symrev}{sessionvars%urlparameter}">log</a></li>
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
18 <li class="active">graph</li>
18526
9409aeaafdc1 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents: 18258
diff changeset
19 <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
9409aeaafdc1 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents: 18258
diff changeset
20 <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
9409aeaafdc1 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents: 18258
diff changeset
21 <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
22 </ul>
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
23 <ul>
25606
3bb6f5f478a7 hgweb: don't dereference symbolic revision in paper & coal style (issue2296)
Anton Shestakov <av6@dwimlabs.net>
parents: 24041
diff changeset
24 <li><a href="{url|urlescape}rev/{symrev}{sessionvars%urlparameter}">changeset</a></li>
3bb6f5f478a7 hgweb: don't dereference symbolic revision in paper & coal style (issue2296)
Anton Shestakov <av6@dwimlabs.net>
parents: 24041
diff changeset
25 <li><a href="{url|urlescape}file/{symrev}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
26 </ul>
12666
ead4e21f49f1 web: add a help view for getting hg help output
Augie Fackler <durin42@gmail.com>
parents: 10856
diff changeset
27 <ul>
18526
9409aeaafdc1 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents: 18258
diff changeset
28 <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
12666
ead4e21f49f1 web: add a help view for getting hg help output
Augie Fackler <durin42@gmail.com>
parents: 10856
diff changeset
29 </ul>
18200
b31266671918 hgweb: add (Atom) subscribe link to the main paper template pages
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17580
diff changeset
30 <div class="atom-logo">
18526
9409aeaafdc1 hgweb: urlescape all urls, HTML escape repo/tag/branch/... names
Thomas Arendsen Hein <thomas@intevation.de>
parents: 18258
diff changeset
31 <a href="{url|urlescape}atom-log" title="subscribe to atom feed">
23830
c4f6fc4eb01e hgweb: close <img> elements
Anton Shestakov <engored@ya.ru>
parents: 23829
diff changeset
32 <img class="atom-logo" src="{staticurl|urlescape}feed-icon-14x14.png" alt="atom feed" />
18200
b31266671918 hgweb: add (Atom) subscribe link to the main paper template pages
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17580
diff changeset
33 </a>
b31266671918 hgweb: add (Atom) subscribe link to the main paper template pages
Angel Ezquerra <angel.ezquerra@gmail.com>
parents: 17580
diff changeset
34 </div>
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
35 </div>
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
36
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
37 <div class="main">
18258
bebb05a7e249 hgweb: add a "URL breadcrumb" to the index and repository pages
Angel Ezquerra <angel.ezquerra at gmail.com>
parents: 18200
diff changeset
38 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
39 <h3>graph</h3>
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
40
32758
cba4461aa0a0 hgweb: consolidate search form for paper
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30766
diff changeset
41 {searchform}
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
42
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
43 <div class="navigate">
25606
3bb6f5f478a7 hgweb: don't dereference symbolic revision in paper & coal style (issue2296)
Anton Shestakov <av6@dwimlabs.net>
parents: 24041
diff changeset
44 <a href="{url|urlescape}graph/{symrev}{lessvars%urlparameter}">less</a>
3bb6f5f478a7 hgweb: don't dereference symbolic revision in paper & coal style (issue2296)
Anton Shestakov <av6@dwimlabs.net>
parents: 24041
diff changeset
45 <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
46 | rev {rev}: {changenav%navgraph}
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
47 </div>
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
48
7725
6a888d491eaf coal/paper: switch to XHTML 1.1
Benoit Allard <benoit@aeteurope.nl>
parents: 7411
diff changeset
49 <noscript><p>The revision graph only works with JavaScript-enabled browsers.</p></noscript>
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
50
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
51 <div id="wrapper">
35407
27ab3150cd50 hgweb: calculate <canvas> width and height client-side
Anton Shestakov <av6@dwimlabs.net>
parents: 35255
diff changeset
52 <canvas id="graph"></canvas>
35529
5afe0ca59b07 paper: make actual changeset entries have backgrounds on /graph
Anton Shestakov <av6@dwimlabs.net>
parents: 35415
diff changeset
53 <ul id="graphnodes" class="stripes2">{nodes%graphentry}</ul>
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
54 </div>
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
55
30766
d7bf7d2bd5ab hgweb: support Content Security Policy
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27913
diff changeset
56 <script type="text/javascript"{if(nonce, ' nonce="{nonce}"')}>
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
57 var data = {jsdata|json};
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
58 var graph = new Graph();
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
59 graph.scale({bg_height});
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
60 graph.render(data);
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
61 </script>
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
62
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
63 <div class="navigate">
25606
3bb6f5f478a7 hgweb: don't dereference symbolic revision in paper & coal style (issue2296)
Anton Shestakov <av6@dwimlabs.net>
parents: 24041
diff changeset
64 <a href="{url|urlescape}graph/{symrev}{lessvars%urlparameter}">less</a>
3bb6f5f478a7 hgweb: don't dereference symbolic revision in paper & coal style (issue2296)
Anton Shestakov <av6@dwimlabs.net>
parents: 24041
diff changeset
65 <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
66 | rev {rev}: {changenav%navgraph}
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
67 </div>
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
68
30766
d7bf7d2bd5ab hgweb: support Content Security Policy
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27913
diff changeset
69 <script type="text/javascript"{if(nonce, ' nonce="{nonce}"')}>
19783
1c2a309bba4f paper: add infinite scrolling to graph by calling ajaxScrollInit at the page
Alexander Plavin <alexander@plav.in>
parents: 19453
diff changeset
70 ajaxScrollInit(
35409
f84b01257e06 hgweb: render next pages on /graph incrementally
Anton Shestakov <av6@dwimlabs.net>
parents: 35407
diff changeset
71 '{url|urlescape}graph/%next%{graphvars%urlparameter}',
f84b01257e06 hgweb: render next pages on /graph incrementally
Anton Shestakov <av6@dwimlabs.net>
parents: 35407
diff changeset
72 '{nextentry%"{node}"}', <!-- NEXTHASH
35654
59c842a3d1e1 hgweb: remove unused second argument of nextPageVarGet()
Anton Shestakov <av6@dwimlabs.net>
parents: 35605
diff changeset
73 function (htmlText) \{
35409
f84b01257e06 hgweb: render next pages on /graph incrementally
Anton Shestakov <av6@dwimlabs.net>
parents: 35407
diff changeset
74 var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
f84b01257e06 hgweb: render next pages on /graph incrementally
Anton Shestakov <av6@dwimlabs.net>
parents: 35407
diff changeset
75 return m ? m[1] : null;
f84b01257e06 hgweb: render next pages on /graph incrementally
Anton Shestakov <av6@dwimlabs.net>
parents: 35407
diff changeset
76 },
19783
1c2a309bba4f paper: add infinite scrolling to graph by calling ajaxScrollInit at the page
Alexander Plavin <alexander@plav.in>
parents: 19453
diff changeset
77 '#wrapper',
1c2a309bba4f paper: add infinite scrolling to graph by calling ajaxScrollInit at the page
Alexander Plavin <alexander@plav.in>
parents: 19453
diff changeset
78 '<div class="%class%" style="text-align: center;">%text%</div>',
1c2a309bba4f paper: add infinite scrolling to graph by calling ajaxScrollInit at the page
Alexander Plavin <alexander@plav.in>
parents: 19453
diff changeset
79 'graph'
1c2a309bba4f paper: add infinite scrolling to graph by calling ajaxScrollInit at the page
Alexander Plavin <alexander@plav.in>
parents: 19453
diff changeset
80 );
1c2a309bba4f paper: add infinite scrolling to graph by calling ajaxScrollInit at the page
Alexander Plavin <alexander@plav.in>
parents: 19453
diff changeset
81 </script>
1c2a309bba4f paper: add infinite scrolling to graph by calling ajaxScrollInit at the page
Alexander Plavin <alexander@plav.in>
parents: 19453
diff changeset
82
7411
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
83 </div>
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
84 </div>
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
85
b71ee3e00e81 coal/paper: move actual templates from coal to paper
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff changeset
86 {footer}