Mercurial > kallithea
annotate pylons_app/templates/monoblue_custom/graph.tmpl @ 96:f24b9a2934cf
added is mercurial method in utils,
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 24 Apr 2010 18:20:59 +0200 |
parents | 2963f2894a7a |
children |
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 <title>{repo|escape}: graph</title> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
4 <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
5 <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
6 <!--[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
|
7 </head> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
8 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
9 <body> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
10 <div id="container"> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
11 <div class="page-header"> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
12 <h1><a href="/">Home</a> / <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
|
13 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
14 <form action="{url}log"> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
15 {sessionvars%hiddenformentry} |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
16 <dl class="search"> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
17 <dt><label>Search: </label></dt> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
18 <dd><input type="text" name="rev" /></dd> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
19 </dl> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
20 </form> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
21 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
22 <ul class="page-nav"> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
23 <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
|
24 <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
|
25 <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
|
26 <li class="current">graph</li> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
27 <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
|
28 <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
29 <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
|
30 </ul> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
31 </div> |
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 <h2 class="no-link no-border">graph</h2> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
34 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
35 <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
|
36 <div id="wrapper"> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
37 <ul id="nodebgs"></ul> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
38 <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
|
39 <ul id="graphnodes"></ul> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
40 </div> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
41 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
42 <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
|
43 <script> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
44 <!-- hide script content |
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 document.getElementById('noscript').style.display = 'none'; |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
47 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
48 var data = {jsdata|json}; |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
49 var graph = new Graph(); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
50 graph.scale({bg_height}); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
51 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
52 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
|
53 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
54 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
|
55 this.ctx.beginPath(); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
56 this.ctx.moveTo(x0, y0); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
57 this.ctx.lineTo(x1, y1); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
58 this.ctx.stroke(); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
59 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
60 } |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
61 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
62 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
|
63 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
|
64 revlink += '</span>_TAGS<span class="info">_DATE, by _USER</span></li>'; |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
65 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
66 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
|
67 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
68 this.ctx.beginPath(); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
69 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
|
70 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
|
71 this.ctx.fill(); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
72 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
73 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
|
74 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
|
75 var nstyle = 'padding-left: ' + left + 'px;'; |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
76 var item = revlink.replace(/_STYLE/, nstyle); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
77 item = item.replace(/_PARITY/, 'parity' + parity); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
78 item = item.replace(/_NODEID/, cur[0]); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
79 item = item.replace(/_NODEID/, cur[0]); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
80 item = item.replace(/_DESC/, cur[3]); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
81 item = item.replace(/_USER/, cur[4]); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
82 item = item.replace(/_DATE/, cur[5]); |
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 var tagspan = ''; |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
85 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
|
86 tagspan = '<span class="logtags">'; |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
87 if (cur[6][1]) { |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
88 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
|
89 tagspan += cur[6][0] + '</span> '; |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
90 } 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
|
91 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
|
92 tagspan += cur[6][0] + '</span> '; |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
93 } |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
94 if (cur[7].length) { |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
95 for (var t in cur[7]) { |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
96 var tag = cur[7][t]; |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
97 tagspan += '<span class="tagtag">' + tag + '</span> '; |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
98 } |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
99 } |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
100 tagspan += '</span>'; |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
101 } |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
102 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
103 item = item.replace(/_TAGS/, tagspan); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
104 return [bg, item]; |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
105 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
106 } |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
107 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
108 graph.render(data); |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
109 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
110 // stop hiding script --> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
111 </script> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
112 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
113 <div class="page-path"> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
114 <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
|
115 <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
|
116 | {changenav%navgraphentry} |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
117 </div> |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
118 |
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
diff
changeset
|
119 {footer} |