annotate pylons_app/templates/monoblue_plain/graph.tmpl @ 44:d924b931b488

Added managment pages. + fixed routing bug done a lot in templates
author marcink
date Wed, 07 Apr 2010 16:42:11 +0200
parents 2963f2894a7a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31
2963f2894a7a Tempalting change, bugfix for serving raw files, and diffs. Now raw files are not parsed thruough mako, and diffs are mako safe (not parsed also)
Marcin Kuzminski <marcin@python-blog.com>
parents: 20
diff changeset
1 ## -*- coding: utf-8 -*-
20
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
2 {header}
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
3 <!--[if IE]><script type="text/javascript" src="{staticurl}excanvas.js"></script><![endif]-->
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
4 <div id="container">
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
5 <div class="page-header">
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
6 <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / graph</h1>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
7
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
8 <ul class="object-tools">
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
9 <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
10 <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
11 <li><a href="{url}changelog{sessionvars%urlparameter}">changelog</a></li>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
12 <li class="current"><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
13 <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
14 <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
15 </ul>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
16 </div>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
17
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
18
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
19 <div id="noscript">The revision graph only works with JavaScript-enabled browsers.</div>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
20 <div id="wrapper">
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
21 <ul id="nodebgs"></ul>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
22 <canvas id="graph" width="224" height="{canvasheight}"></canvas>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
23 <ul id="graphnodes"></ul>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
24 <div>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
25 </div>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
26
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
27 <script type="text/javascript" src="{staticurl}graph.js"></script>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
28 <script>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
29 <!-- hide script content
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
30
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
31 document.getElementById('noscript').style.display = 'none';
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
32
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
33 var data = {jsdata|json};
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
34 var graph = new Graph();
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
35 graph.scale({bg_height});
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
36
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
37 graph.edge = function(x0, y0, x1, y1, color) {
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
38
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
39 this.setColor(color, 0.0, 0.65);
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
40 this.ctx.beginPath();
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
41 this.ctx.moveTo(x0, y0);
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
42 this.ctx.lineTo(x1, y1);
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
43 this.ctx.stroke();
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
44
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
45 }
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
46
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
47 var revlink = '<li style="_STYLE"><span class="desc">';
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
48 revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>';
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
49 revlink += '</span>_TAGS<span class="info">_DATE ago, by _USER</span></li>';
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
50
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
51 graph.vertex = function(x, y, color, parity, cur) {
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
52
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
53 this.ctx.beginPath();
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
54 color = this.setColor(color, 0.25, 0.75);
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
55 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
56 this.ctx.fill();
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
57
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
58 var bg = '<li class="bg parity' + parity + '"></li>';
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
59 var left = (this.columns + 1) * this.bg_height;
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
60 var nstyle = 'padding-left: ' + left + 'px;';
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
61 var item = revlink.replace(/_STYLE/, nstyle);
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
62 item = item.replace(/_PARITY/, 'parity' + parity);
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
63 item = item.replace(/_NODEID/, cur[0]);
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
64 item = item.replace(/_NODEID/, cur[0]);
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
65 item = item.replace(/_DESC/, cur[3]);
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
66 item = item.replace(/_USER/, cur[4]);
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
67 item = item.replace(/_DATE/, cur[5]);
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
68
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
69 var tagspan = '';
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
70 if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) {
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
71 tagspan = '<span class="logtags">';
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
72 if (cur[6][1]) {
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
73 tagspan += '<span class="branchtag" title="' + cur[6][0] + '">';
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
74 tagspan += cur[6][0] + '</span> ';
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
75 } else if (!cur[6][1] && cur[6][0] != 'default') {
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
76 tagspan += '<span class="inbranchtag" title="' + cur[6][0] + '">';
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
77 tagspan += cur[6][0] + '</span> ';
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
78 }
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
79 if (cur[7].length) {
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
80 for (var t in cur[7]) {
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
81 var tag = cur[7][t];
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
82 tagspan += '<span class="tagtag">' + tag + '</span> ';
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
83 }
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
84 }
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
85 tagspan += '</span>';
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
86 }
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
87
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
88 item = item.replace(/_TAGS/, tagspan);
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
89 return [bg, item];
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
90
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
91 }
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
92
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
93 graph.render(data);
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
94
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
95 // stop hiding script -->
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
96 </script>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
97
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
98 <div class="page-path">
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
99 <a href="{url}graph/{rev}{lessvars%urlparameter}">less</a>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
100 <a href="{url}graph/{rev}{morevars%urlparameter}">more</a>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
101 | {changenav%navgraphentry}
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
102 </div>
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
103
bbaab7501c1a Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff changeset
104 {footer}