comparison pylons_app/templates/changelog/changelog.html @ 193:50a39f923f31

Added file annotation template. Bumped version to 0.6.8. Changelog and changeset are now cleaned with js, it's still very beta.
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 22 May 2010 02:00:39 +0200
parents 787689980bcd
children 671931f082c3
comparison
equal deleted inserted replaced
192:f191f99f59c9 193:50a39f923f31
1 <%!
2 from pylons_app.lib import filters
3 %>
1 <%inherit file="/base/base.html"/> 4 <%inherit file="/base/base.html"/>
2 5
3 <%def name="title()"> 6 <%def name="title()">
4 ${_('Repository managment')} 7 ${_('Changelog - %s') % c.repo_name}
5 </%def> 8 </%def>
6 <%def name="breadcrumbs()"> 9 <%def name="breadcrumbs()">
7 ${h.link_to(u'Home',h.url('/'))} 10 ${h.link_to(u'Home',h.url('/'))}
8 / 11 /
9 ${h.link_to(c.repo_name,h.url('changelog_home',repo_name=c.repo_name))} 12 ${h.link_to(c.repo_name,h.url('changelog_home',repo_name=c.repo_name))}
10 / 13 /
11 ${_('changelog')} 14 ${_('changelog')}
12 </%def> 15 </%def>
13 <%def name="page_nav()"> 16 <%def name="page_nav()">
14 <form action="log"> 17 ${self.menu('changelog')}
15 <dl class="search">
16 <dt><label>Search: </label></dt>
17 <dd><input type="text" name="rev" /></dd>
18 </dl>
19 </form>
20
21 ${self.menu('changelog')}
22 </%def> 18 </%def>
23 19
24 <%def name="main()"> 20 <%def name="main()">
25 21
26 <h2 class="no-link no-border">${_('Changelog')} - ${_('showing ')} ${c.size} ${_('revisions')}</h2> 22 <h2 class="no-link no-border">${_('Changelog')} - ${_('showing ')} ${c.size} ${_('revisions')}</h2>
27 <noscript>${_('The revision graph only works with JavaScript-enabled browsers.')}</noscript> 23 <noscript>${_('The revision graph only works with JavaScript-enabled browsers.')}</noscript>
28 <div> 24
29 ${h.form(h.url.current(),method='get')} 25 <div id="graph">
30 ${_('Show')}: ${h.text('size',size=5,value=c.size)} ${_('revisions')} 26 ##<div id="graph_nodes" style="height:1000px">
31 ${h.submit('','set')} 27 ## <canvas id="graph" width="160"></canvas>
32 ${h.end_form()} 28 ##</div>
33 </div> 29 <div id="graph_content">
34 <div id="wrapper" style="height:${c.canvasheight}px"> 30 <div class="container_header">
35 <div style="float:left;height:${c.canvasheight}px"> 31 ${h.form(h.url.current(),method='get')}
36 <canvas id="graph" width="224" height="${c.canvasheight}"></canvas> 32 ${_('Show')}: ${h.text('size',size=5,value=c.size)} ${_('revisions')}
37 </div> 33 ${h.submit('','set')}
38 <div style="float:left;height:${c.canvasheight}px"> 34 ${h.end_form()}
39 <ul id="graphnodes"></ul> 35 </div>
36 %for cnt,cs in enumerate(c.pagination):
37 <div class="container">
38 <div class="left">
39 <div class="date">${_('commit')} ${cs.revision}: ${cs.raw_id}@${cs.date}</div>
40 <div class="author">${cs.author}</div>
41 <div id="chg_${cnt}" class="message">
42 ${h.link_to(cs.message,
43 h.url('changeset_home',repo_name=c.repo_name,revision=cs._short),
44 title=cs.message)}
45 </div>
46 <span class="logtags">
47 <span class="branchtag">${cs.branch}</span>
48 %for tag in cs.tags:
49 <span class="tagtag">${tag}</span>
50 %endfor
51 </span>
52 </div>
53 <div class="right">
54 <span class="removed" title="${_('removed')}">${len(cs.removed)}</span>
55 <span class="changed" title="${_('changed')}">${len(cs.changed)}</span>
56 <span class="added" title="${_('added')}">${len(cs.added)}</span>
57 </div>
58 </div>
59
60 %endfor
40 </div> 61 </div>
41 </div> 62 </div>
42 63
43 <script type="text/javascript" src="/js/graph.js"></script> 64 ##<script type="text/javascript" src="/js/graph2.js"></script>
44 <script> 65 ##<script type="text/javascript" src="http://bitbucket-assets.s3.amazonaws.com/js/lib/bundle.160310Mar.js"></script>
45 <!-- hide script content 66 ##
67 ##<script>
68 ##<!-- hide script content
69 ##
70 ##var jsdata = ${c.jsdata|n};
71 ##var r = new BranchRenderer();
72 ##r.render(jsdata);
46 73
47 var data = ${c.jsdata|n}; 74 ##// stop hiding script -->
48 var graph = new Graph(); 75 ##</script>
49 graph.scale(39);
50 76
51 graph.edge = function(x0, y0, x1, y1, color) {
52
53 this.setColor(color, 0.0, 0.65);
54 this.ctx.beginPath();
55 this.ctx.moveTo(x0, y0);
56 this.ctx.lineTo(x1, y1);
57 this.ctx.stroke();
58
59 }
60
61 var revlink = '<li style="_STYLE"><span class="desc">';
62 revlink += '<a class="list" href="/${c.repo_name}/changeset/_NODEID" title="_NODEID"><b>_DESC</b></a>';
63 revlink += '</span> _TAGS';
64 revlink += '<span class="info">_DATE, by _USER</span></li>';
65
66 graph.vertex = function(x, y, color, parity, cur) {
67
68 this.ctx.beginPath();
69 color = this.setColor(color, 0.25, 0.75);
70 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true);
71 this.ctx.fill();
72
73 var bg = '<li class="bg parity' + parity + '"></li>';
74 var left = (this.columns + 1) * this.bg_height;
75 var nstyle = 'padding-left: ' + left + 'px;';
76 var item = revlink.replace(/_STYLE/, nstyle);
77 item = item.replace(/_PARITY/, 'parity' + parity);
78 item = item.replace(/_NODEID/, cur[0]);
79 item = item.replace(/_NODEID/, cur[0]);
80 item = item.replace(/_DESC/, cur[3]);
81 item = item.replace(/_USER/, cur[4]);
82 item = item.replace(/_DATE/, cur[5]);
83
84 var tagspan = '';
85 if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) {
86 tagspan = '<span class="logtags">';
87 if (cur[6][1]) {
88 tagspan += '<span class="branchtag" title="' + cur[6][0] + '">';
89 tagspan += cur[6][0] + '</span> ';
90 } else if (!cur[6][1] && cur[6][0] != 'default') {
91 tagspan += '<span class="inbranchtag" title="' + cur[6][0] + '">';
92 tagspan += cur[6][0] + '</span> ';
93 }
94 if (cur[7].length) {
95 for (var t in cur[7]) {
96 var tag = cur[7][t];
97 tagspan += '<span class="tagtag">' + tag + '</span> ';
98 }
99 }
100 tagspan += '</span>';
101 }
102
103 item = item.replace(/_TAGS/, tagspan);
104 return [bg, item];
105
106 }
107
108 graph.render(data);
109
110 // stop hiding script -->
111 </script>
112 <div> 77 <div>
113 <h2>${c.pagination.pager('$link_previous ~2~ $link_next')}</h2> 78 <h2>${c.pagination.pager('$link_previous ~2~ $link_next')}</h2>
114 </div> 79 </div>
115 </%def> 80 </%def>