mercurial/templates/monoblue/graph.tmpl
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
Tue, 01 Dec 2009 16:06:10 +0100
changeset 9999 f91e5630ce7e
parent 8430 templates/monoblue/graph.tmpl@8b47efdf40ee
child 10254 8d5de52431f2
permissions -rw-r--r--
setup: install translation files as package data Remove the `install_package_data' subclass of `install_data' and use the `package_data' functionality provided by distutils instead. As package data must be located within the package directory, the data files are now generated in the build directory. To simplify the functionality of this change, the top-level `doc' and `templates' directories have been moved into the `mercurial' package directory.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
     6
</head>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
     7
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
     8
<body>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
     9
<div id="container">
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    10
    <div class="page-header">
8430
8b47efdf40ee monoblue: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8355
diff changeset
    11
        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / graph</h1>
7111
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    12
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    13
        <form action="{url}log">
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    14
            {sessionvars%hiddenformentry}
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    15
            <dl class="search">
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    16
                <dt><label>Search: </label></dt>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    17
                <dd><input type="text" name="rev" /></dd>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    18
            </dl>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    19
        </form>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    20
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    21
        <ul class="page-nav">
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    22
            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    23
            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    24
            <li><a href="{url}changelog{sessionvars%urlparameter}">changelog</a></li>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    25
            <li class="current">graph</li>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    26
            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
8355
5ba798f339c8 monoblue: add branches page
Sune Foldager <cryo@cyanite.org>
parents: 8236
diff changeset
    27
            <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
    28
            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li>
7111
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    29
        </ul>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    30
    </div>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    31
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    32
    <h2 class="no-link no-border">graph</h2>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    33
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    34
    <div id="noscript">The revision graph only works with JavaScript-enabled browsers.</div>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    35
    <div id="wrapper">
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    36
        <ul id="nodebgs"></ul>
8430
8b47efdf40ee monoblue: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8355
diff changeset
    37
        <canvas id="graph" width="224" height="{canvasheight}"></canvas>
7111
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    38
        <ul id="graphnodes"></ul>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    39
    </div>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    40
8430
8b47efdf40ee monoblue: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8355
diff changeset
    41
    <script type="text/javascript" src="{staticurl}graph.js"></script>
7111
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    42
    <script>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    43
    <!-- hide script content
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    44
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    45
    document.getElementById('noscript').style.display = 'none';
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    46
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    47
    var data = {jsdata|json};
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    48
    var graph = new Graph();
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    49
    graph.scale({bg_height});
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    50
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    51
    graph.edge = function(x0, y0, x1, y1, color) {
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    52
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    53
        this.setColor(color, 0.0, 0.65);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    54
        this.ctx.beginPath();
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    55
        this.ctx.moveTo(x0, y0);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    56
        this.ctx.lineTo(x1, y1);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    57
        this.ctx.stroke();
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    58
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    59
    }
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    60
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    61
    var revlink = '<li style="_STYLE"><span class="desc">';
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    62
    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: 7111
diff changeset
    63
    revlink += '</span>_TAGS<span class="info">_DATE ago, by _USER</span></li>';
7111
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    64
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    65
    graph.vertex = function(x, y, color, parity, cur) {
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    66
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    67
        this.ctx.beginPath();
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    68
        color = this.setColor(color, 0.25, 0.75);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    69
        this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    70
        this.ctx.fill();
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    71
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    72
        var bg = '<li class="bg parity' + parity + '"></li>';
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    73
        var left = (this.columns + 1) * this.bg_height;
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    74
        var nstyle = 'padding-left: ' + left + 'px;';
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    75
        var item = revlink.replace(/_STYLE/, nstyle);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    76
        item = item.replace(/_PARITY/, 'parity' + parity);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    77
        item = item.replace(/_NODEID/, cur[0]);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    78
        item = item.replace(/_NODEID/, cur[0]);
8236
9f53e203a09b webcommands: move nonempty logic from JavaScript to Python
Martin Geisler <mg@lazybytes.net>
parents: 8235
diff changeset
    79
	item = item.replace(/_DESC/, cur[3]);
7111
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    80
        item = item.replace(/_USER/, cur[4]);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    81
        item = item.replace(/_DATE/, cur[5]);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
    82
7408
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7111
diff changeset
    83
        var tagspan = '';
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7111
diff changeset
    84
        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: 7111
diff changeset
    85
            tagspan = '<span class="logtags">';
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7111
diff changeset
    86
            if (cur[6][1]) {
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7111
diff changeset
    87
                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
    88
                tagspan += cur[6][0] + '</span> ';
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7111
diff changeset
    89
            } 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: 7111
diff changeset
    90
                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
    91
                tagspan += cur[6][0] + '</span> ';
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7111
diff changeset
    92
            }
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7111
diff changeset
    93
            if (cur[7].length) {
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7111
diff changeset
    94
                for (var t in cur[7]) {
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7111
diff changeset
    95
                    var tag = cur[7][t];
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7111
diff changeset
    96
                    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
    97
                }
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7111
diff changeset
    98
            }
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7111
diff changeset
    99
            tagspan += '</span>';
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7111
diff changeset
   100
        }
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7111
diff changeset
   101
f031a12dfc31 coal/paper/monoblue: show branch names in hgweb graph
Benoit Allard <benoit@aeteurope.nl>
parents: 7111
diff changeset
   102
        item = item.replace(/_TAGS/, tagspan); 
7111
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
   103
        return [bg, item];
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
   104
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
   105
    }
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
   106
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
   107
    graph.render(data);
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
   108
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
   109
    // stop hiding script -->
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
   110
    </script>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
   111
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
   112
    <div class="page-path">
7548
e8b818029ed6 monoblue: add less/more links to graph page
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7408
diff changeset
   113
        <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
   114
        <a href="{url}graph/{rev}{morevars%urlparameter}">more</a>
e8b818029ed6 monoblue: add less/more links to graph page
Pascal Quantin <pascal.quantin@gmail.com>
parents: 7408
diff changeset
   115
        | {changenav%navgraphentry}
7111
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
   116
    </div>
91b0ada2d94b added monoblue hgweb theme
Hiroshi Funai <hfunai@gmail.com>
parents:
diff changeset
   117
8430
8b47efdf40ee monoblue: use newer template syntax everywhere
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8355
diff changeset
   118
{footer}