Show More
@@ -1,230 +1,230 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | <%inherit file="/base/base.html"/> |
|
3 | <%inherit file="/base/base.html"/> | |
4 |
|
4 | |||
5 | <%def name="title()"> |
|
5 | <%def name="title()"> | |
6 | ${c.repo_name} ${_('Changelog')} - ${c.rhodecode_name} |
|
6 | ${c.repo_name} ${_('Changelog')} - ${c.rhodecode_name} | |
7 | </%def> |
|
7 | </%def> | |
8 |
|
8 | |||
9 | <%def name="breadcrumbs_links()"> |
|
9 | <%def name="breadcrumbs_links()"> | |
10 | ${h.link_to(u'Home',h.url('/'))} |
|
10 | ${h.link_to(u'Home',h.url('/'))} | |
11 | » |
|
11 | » | |
12 | ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))} |
|
12 | ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))} | |
13 | » |
|
13 | » | |
14 | ${_('Changelog')} - ${_('showing ')} ${c.size if c.size <= c.total_cs else c.total_cs} ${_('out of')} ${c.total_cs} ${_('revisions')} |
|
14 | ${_('Changelog')} - ${_('showing ')} ${c.size if c.size <= c.total_cs else c.total_cs} ${_('out of')} ${c.total_cs} ${_('revisions')} | |
15 | </%def> |
|
15 | </%def> | |
16 |
|
16 | |||
17 | <%def name="page_nav()"> |
|
17 | <%def name="page_nav()"> | |
18 | ${self.menu('changelog')} |
|
18 | ${self.menu('changelog')} | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%def name="main()"> |
|
21 | <%def name="main()"> | |
22 | <div class="box"> |
|
22 | <div class="box"> | |
23 | <!-- box / title --> |
|
23 | <!-- box / title --> | |
24 | <div class="title"> |
|
24 | <div class="title"> | |
25 | ${self.breadcrumbs()} |
|
25 | ${self.breadcrumbs()} | |
26 | </div> |
|
26 | </div> | |
27 | <div class="table"> |
|
27 | <div class="table"> | |
28 | % if c.pagination: |
|
28 | % if c.pagination: | |
29 | <div id="graph"> |
|
29 | <div id="graph"> | |
30 | <div id="graph_nodes"> |
|
30 | <div id="graph_nodes"> | |
31 | <canvas id="graph_canvas"></canvas> |
|
31 | <canvas id="graph_canvas"></canvas> | |
32 | </div> |
|
32 | </div> | |
33 | <div id="graph_content"> |
|
33 | <div id="graph_content"> | |
34 | <div class="container_header"> |
|
34 | <div class="container_header"> | |
35 | ${h.form(h.url.current(),method='get')} |
|
35 | ${h.form(h.url.current(),method='get')} | |
36 | <div class="info_box" style="float:left"> |
|
36 | <div class="info_box" style="float:left"> | |
37 | ${h.submit('set',_('Show'),class_="ui-btn")} |
|
37 | ${h.submit('set',_('Show'),class_="ui-btn")} | |
38 | ${h.text('size',size=1,value=c.size)} |
|
38 | ${h.text('size',size=1,value=c.size)} | |
39 | ${_('revisions')} |
|
39 | ${_('revisions')} | |
40 | </div> |
|
40 | </div> | |
41 | ${h.end_form()} |
|
41 | ${h.end_form()} | |
42 | <div id="rev_range_container" style="display:none"></div> |
|
42 | <div id="rev_range_container" style="display:none"></div> | |
43 | <div style="float:right">${h.select('branch_filter',c.branch_name,c.branch_filters)}</div> |
|
43 | <div style="float:right">${h.select('branch_filter',c.branch_name,c.branch_filters)}</div> | |
44 | </div> |
|
44 | </div> | |
45 |
|
45 | |||
46 | %for cnt,cs in enumerate(c.pagination): |
|
46 | %for cnt,cs in enumerate(c.pagination): | |
47 | <div id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}"> |
|
47 | <div id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}"> | |
48 | <div class="left"> |
|
48 | <div class="left"> | |
49 | <div> |
|
49 | <div> | |
50 | ${h.checkbox(cs.short_id,class_="changeset_range")} |
|
50 | ${h.checkbox(cs.short_id,class_="changeset_range")} | |
51 | <span class="tooltip" title="${h.age(cs.date)}"><a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"><span class="changeset_id">${cs.revision}:<span class="changeset_hash">${h.short_id(cs.raw_id)}</span></span></a></span> |
|
51 | <span class="tooltip" title="${h.age(cs.date)}"><a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"><span class="changeset_id">${cs.revision}:<span class="changeset_hash">${h.short_id(cs.raw_id)}</span></span></a></span> | |
52 | </div> |
|
52 | </div> | |
53 | <div class="author"> |
|
53 | <div class="author"> | |
54 | <div class="gravatar"> |
|
54 | <div class="gravatar"> | |
55 | <img alt="gravatar" src="${h.gravatar_url(h.email(cs.author),16)}"/> |
|
55 | <img alt="gravatar" src="${h.gravatar_url(h.email(cs.author),16)}"/> | |
56 | </div> |
|
56 | </div> | |
57 | <div title="${cs.author}" class="user">${h.person(cs.author)}</div> |
|
57 | <div title="${cs.author}" class="user">${h.person(cs.author)}</div> | |
58 | </div> |
|
58 | </div> | |
59 | <div class="date">${cs.date}</div> |
|
59 | <div class="date">${cs.date}</div> | |
60 | </div> |
|
60 | </div> | |
61 | <div class="mid"> |
|
61 | <div class="mid"> | |
62 | <div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div> |
|
62 | <div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div> | |
63 | <div class="expand"><span class="expandtext">↓ ${_('show more')} ↓</span></div> |
|
63 | <div class="expand"><span class="expandtext">↓ ${_('show more')} ↓</span></div> | |
64 | </div> |
|
64 | </div> | |
65 | <div class="right"> |
|
65 | <div class="right"> | |
66 |
<div |
|
66 | <div class="changes"> | |
67 | <div id="${cs.raw_id}" style="float:right;" class="changed_total tooltip" title="${_('Affected number of files, click to show more details')}">${len(cs.affected_files)}</div> |
|
67 | <div id="${cs.raw_id}" style="float:right;" class="changed_total tooltip" title="${_('Affected number of files, click to show more details')}">${len(cs.affected_files)}</div> | |
68 | <div class="comments-container"> |
|
68 | <div class="comments-container"> | |
69 | %if len(c.comments.get(cs.raw_id,[])) > 0: |
|
69 | %if len(c.comments.get(cs.raw_id,[])) > 0: | |
70 | <div class="comments-cnt" title="${('comments')}"> |
|
70 | <div class="comments-cnt" title="${('comments')}"> | |
71 | <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}"> |
|
71 | <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id,anchor='comment-%s' % c.comments[cs.raw_id][0].comment_id)}"> | |
72 | <div class="comments-cnt">${len(c.comments[cs.raw_id])}</div> |
|
72 | <div class="comments-cnt">${len(c.comments[cs.raw_id])}</div> | |
73 | <img src="${h.url('/images/icons/comments.png')}"> |
|
73 | <img src="${h.url('/images/icons/comments.png')}"> | |
74 | </a> |
|
74 | </a> | |
75 | </div> |
|
75 | </div> | |
76 | %endif |
|
76 | %endif | |
77 | </div> |
|
77 | </div> | |
78 | </div> |
|
78 | </div> | |
79 | %if cs.parents: |
|
79 | %if cs.parents: | |
80 | %for p_cs in reversed(cs.parents): |
|
80 | %for p_cs in reversed(cs.parents): | |
81 | <div class="parent">${_('Parent')} |
|
81 | <div class="parent">${_('Parent')} | |
82 | <span class="changeset_id">${p_cs.revision}:<span class="changeset_hash">${h.link_to(h.short_id(p_cs.raw_id), |
|
82 | <span class="changeset_id">${p_cs.revision}:<span class="changeset_hash">${h.link_to(h.short_id(p_cs.raw_id), | |
83 | h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}</span></span> |
|
83 | h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}</span></span> | |
84 | </div> |
|
84 | </div> | |
85 | %endfor |
|
85 | %endfor | |
86 | %else: |
|
86 | %else: | |
87 | <div class="parent">${_('No parents')}</div> |
|
87 | <div class="parent">${_('No parents')}</div> | |
88 | %endif |
|
88 | %endif | |
89 |
|
89 | |||
90 | <span class="logtags"> |
|
90 | <span class="logtags"> | |
91 | %if len(cs.parents)>1: |
|
91 | %if len(cs.parents)>1: | |
92 | <span class="merge">${_('merge')}</span> |
|
92 | <span class="merge">${_('merge')}</span> | |
93 | %endif |
|
93 | %endif | |
94 | %if cs.branch: |
|
94 | %if cs.branch: | |
95 | <span class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}"> |
|
95 | <span class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}"> | |
96 | ${h.link_to(h.shorter(cs.branch),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span> |
|
96 | ${h.link_to(h.shorter(cs.branch),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span> | |
97 | %endif |
|
97 | %endif | |
98 | %for tag in cs.tags: |
|
98 | %for tag in cs.tags: | |
99 | <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}"> |
|
99 | <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}"> | |
100 | ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span> |
|
100 | ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span> | |
101 | %endfor |
|
101 | %endfor | |
102 | </span> |
|
102 | </span> | |
103 | </div> |
|
103 | </div> | |
104 | </div> |
|
104 | </div> | |
105 |
|
105 | |||
106 | %endfor |
|
106 | %endfor | |
107 | <div class="pagination-wh pagination-left"> |
|
107 | <div class="pagination-wh pagination-left"> | |
108 | ${c.pagination.pager('$link_previous ~2~ $link_next')} |
|
108 | ${c.pagination.pager('$link_previous ~2~ $link_next')} | |
109 | </div> |
|
109 | </div> | |
110 | </div> |
|
110 | </div> | |
111 | </div> |
|
111 | </div> | |
112 |
|
112 | |||
113 | <script type="text/javascript" src="${h.url('/js/graph.js')}"></script> |
|
113 | <script type="text/javascript" src="${h.url('/js/graph.js')}"></script> | |
114 | <script type="text/javascript"> |
|
114 | <script type="text/javascript"> | |
115 | YAHOO.util.Event.onDOMReady(function(){ |
|
115 | YAHOO.util.Event.onDOMReady(function(){ | |
116 |
|
116 | |||
117 | //Monitor range checkboxes and build a link to changesets |
|
117 | //Monitor range checkboxes and build a link to changesets | |
118 | //ranges |
|
118 | //ranges | |
119 | var checkboxes = YUD.getElementsByClassName('changeset_range'); |
|
119 | var checkboxes = YUD.getElementsByClassName('changeset_range'); | |
120 | var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}"; |
|
120 | var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}"; | |
121 | YUE.on(checkboxes,'click',function(e){ |
|
121 | YUE.on(checkboxes,'click',function(e){ | |
122 | var checked_checkboxes = []; |
|
122 | var checked_checkboxes = []; | |
123 | for (pos in checkboxes){ |
|
123 | for (pos in checkboxes){ | |
124 | if(checkboxes[pos].checked){ |
|
124 | if(checkboxes[pos].checked){ | |
125 | checked_checkboxes.push(checkboxes[pos]); |
|
125 | checked_checkboxes.push(checkboxes[pos]); | |
126 | } |
|
126 | } | |
127 | } |
|
127 | } | |
128 | if(checked_checkboxes.length>1){ |
|
128 | if(checked_checkboxes.length>1){ | |
129 | var rev_end = checked_checkboxes[0].name; |
|
129 | var rev_end = checked_checkboxes[0].name; | |
130 | var rev_start = checked_checkboxes[checked_checkboxes.length-1].name; |
|
130 | var rev_start = checked_checkboxes[checked_checkboxes.length-1].name; | |
131 |
|
131 | |||
132 | var url = url_tmpl.replace('__REVRANGE__', |
|
132 | var url = url_tmpl.replace('__REVRANGE__', | |
133 | rev_start+'...'+rev_end); |
|
133 | rev_start+'...'+rev_end); | |
134 |
|
134 | |||
135 | var link = "<a href="+url+">${_('Show selected changes __S -> __E')}</a>" |
|
135 | var link = "<a href="+url+">${_('Show selected changes __S -> __E')}</a>" | |
136 | link = link.replace('__S',rev_start); |
|
136 | link = link.replace('__S',rev_start); | |
137 | link = link.replace('__E',rev_end); |
|
137 | link = link.replace('__E',rev_end); | |
138 | YUD.get('rev_range_container').innerHTML = link; |
|
138 | YUD.get('rev_range_container').innerHTML = link; | |
139 | YUD.setStyle('rev_range_container','display',''); |
|
139 | YUD.setStyle('rev_range_container','display',''); | |
140 | } |
|
140 | } | |
141 | else{ |
|
141 | else{ | |
142 | YUD.setStyle('rev_range_container','display','none'); |
|
142 | YUD.setStyle('rev_range_container','display','none'); | |
143 |
|
143 | |||
144 | } |
|
144 | } | |
145 | }); |
|
145 | }); | |
146 |
|
146 | |||
147 | var msgs = YUQ('.message'); |
|
147 | var msgs = YUQ('.message'); | |
148 | // get first element height |
|
148 | // get first element height | |
149 | var el = YUQ('#graph_content .container')[0]; |
|
149 | var el = YUQ('#graph_content .container')[0]; | |
150 | var row_h = el.clientHeight; |
|
150 | var row_h = el.clientHeight; | |
151 | for(var i=0;i<msgs.length;i++){ |
|
151 | for(var i=0;i<msgs.length;i++){ | |
152 | var m = msgs[i]; |
|
152 | var m = msgs[i]; | |
153 |
|
153 | |||
154 | var h = m.clientHeight; |
|
154 | var h = m.clientHeight; | |
155 | var pad = YUD.getStyle(m,'padding'); |
|
155 | var pad = YUD.getStyle(m,'padding'); | |
156 | if(h > row_h){ |
|
156 | if(h > row_h){ | |
157 | var offset = row_h - (h+12); |
|
157 | var offset = row_h - (h+12); | |
158 | YUD.setStyle(m.nextElementSibling,'display','block'); |
|
158 | YUD.setStyle(m.nextElementSibling,'display','block'); | |
159 | YUD.setStyle(m.nextElementSibling,'margin-top',offset+'px'); |
|
159 | YUD.setStyle(m.nextElementSibling,'margin-top',offset+'px'); | |
160 | }; |
|
160 | }; | |
161 | } |
|
161 | } | |
162 | YUE.on(YUQ('.expand'),'click',function(e){ |
|
162 | YUE.on(YUQ('.expand'),'click',function(e){ | |
163 | var elem = e.currentTarget.parentNode.parentNode; |
|
163 | var elem = e.currentTarget.parentNode.parentNode; | |
164 | YUD.setStyle(e.currentTarget,'display','none'); |
|
164 | YUD.setStyle(e.currentTarget,'display','none'); | |
165 | YUD.setStyle(elem,'height','auto'); |
|
165 | YUD.setStyle(elem,'height','auto'); | |
166 |
|
166 | |||
167 | //redraw the graph, max_w and jsdata are global vars |
|
167 | //redraw the graph, max_w and jsdata are global vars | |
168 | set_canvas(max_w); |
|
168 | set_canvas(max_w); | |
169 |
|
169 | |||
170 | var r = new BranchRenderer(); |
|
170 | var r = new BranchRenderer(); | |
171 | r.render(jsdata,max_w); |
|
171 | r.render(jsdata,max_w); | |
172 |
|
172 | |||
173 | }) |
|
173 | }) | |
174 |
|
174 | |||
175 | // Fetch changeset details |
|
175 | // Fetch changeset details | |
176 | YUE.on(YUD.getElementsByClassName('changed_total'),'click',function(e){ |
|
176 | YUE.on(YUD.getElementsByClassName('changed_total'),'click',function(e){ | |
177 | var id = e.currentTarget.id |
|
177 | var id = e.currentTarget.id | |
178 | var url = "${h.url('changelog_details',repo_name=c.repo_name,cs='__CS__')}" |
|
178 | var url = "${h.url('changelog_details',repo_name=c.repo_name,cs='__CS__')}" | |
179 | var url = url.replace('__CS__',id); |
|
179 | var url = url.replace('__CS__',id); | |
180 |
ypjax(url,id |
|
180 | ypjax(url,id,function(){tooltip_activate()}); | |
181 | }); |
|
181 | }); | |
182 |
|
182 | |||
183 | // change branch filter |
|
183 | // change branch filter | |
184 | YUE.on(YUD.get('branch_filter'),'change',function(e){ |
|
184 | YUE.on(YUD.get('branch_filter'),'change',function(e){ | |
185 | var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value; |
|
185 | var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value; | |
186 | var url_main = "${h.url('changelog_home',repo_name=c.repo_name)}"; |
|
186 | var url_main = "${h.url('changelog_home',repo_name=c.repo_name)}"; | |
187 | var url = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}"; |
|
187 | var url = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}"; | |
188 | var url = url.replace('__BRANCH__',selected_branch); |
|
188 | var url = url.replace('__BRANCH__',selected_branch); | |
189 | if(selected_branch != ''){ |
|
189 | if(selected_branch != ''){ | |
190 | window.location = url; |
|
190 | window.location = url; | |
191 | }else{ |
|
191 | }else{ | |
192 | window.location = url_main; |
|
192 | window.location = url_main; | |
193 | } |
|
193 | } | |
194 |
|
194 | |||
195 | }); |
|
195 | }); | |
196 |
|
196 | |||
197 | function set_canvas(heads) { |
|
197 | function set_canvas(heads) { | |
198 | var c = document.getElementById('graph_nodes'); |
|
198 | var c = document.getElementById('graph_nodes'); | |
199 | var t = document.getElementById('graph_content'); |
|
199 | var t = document.getElementById('graph_content'); | |
200 | canvas = document.getElementById('graph_canvas'); |
|
200 | canvas = document.getElementById('graph_canvas'); | |
201 | var div_h = t.clientHeight; |
|
201 | var div_h = t.clientHeight; | |
202 | c.style.height=div_h+'px'; |
|
202 | c.style.height=div_h+'px'; | |
203 | canvas.setAttribute('height',div_h); |
|
203 | canvas.setAttribute('height',div_h); | |
204 | c.style.height=max_w+'px'; |
|
204 | c.style.height=max_w+'px'; | |
205 | canvas.setAttribute('width',max_w); |
|
205 | canvas.setAttribute('width',max_w); | |
206 | }; |
|
206 | }; | |
207 | var heads = 1; |
|
207 | var heads = 1; | |
208 | var max_heads = 0; |
|
208 | var max_heads = 0; | |
209 | var jsdata = ${c.jsdata|n}; |
|
209 | var jsdata = ${c.jsdata|n}; | |
210 |
|
210 | |||
211 | for( var i=0;i<jsdata.length;i++){ |
|
211 | for( var i=0;i<jsdata.length;i++){ | |
212 | var m = Math.max.apply(Math, jsdata[i][1]); |
|
212 | var m = Math.max.apply(Math, jsdata[i][1]); | |
213 | if (m>max_heads){ |
|
213 | if (m>max_heads){ | |
214 | max_heads = m; |
|
214 | max_heads = m; | |
215 | } |
|
215 | } | |
216 | } |
|
216 | } | |
217 | var max_w = Math.max(100,max_heads*25); |
|
217 | var max_w = Math.max(100,max_heads*25); | |
218 | set_canvas(max_w); |
|
218 | set_canvas(max_w); | |
219 |
|
219 | |||
220 | var r = new BranchRenderer(); |
|
220 | var r = new BranchRenderer(); | |
221 | r.render(jsdata,max_w); |
|
221 | r.render(jsdata,max_w); | |
222 |
|
222 | |||
223 | }); |
|
223 | }); | |
224 | </script> |
|
224 | </script> | |
225 | %else: |
|
225 | %else: | |
226 | ${_('There are no changes yet')} |
|
226 | ${_('There are no changes yet')} | |
227 | %endif |
|
227 | %endif | |
228 | </div> |
|
228 | </div> | |
229 | </div> |
|
229 | </div> | |
230 | </%def> |
|
230 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now