Show More
@@ -1,209 +1,205 | |||||
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 ${'tablerow1' if cnt%2==0 else 'tablerow2'}"> |
|
47 | <div id="chg_${cnt+1}" class="container ${'tablerow1' if cnt%2==0 else 'tablerow2'}"> | |
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="${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="${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> |
|
59 | </div> | |
60 | <div class="mid"> |
|
60 | <div class="mid"> | |
61 | <div class="message">${h.link_to(h.wrap_paragraphs(cs.message),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div> |
|
61 | <div class="message">${h.link_to(h.wrap_paragraphs(cs.message),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div> | |
62 | </div> |
|
62 | </div> | |
63 | <div class="right"> |
|
63 | <div class="right"> | |
64 | <div id="${cs.raw_id}_changes_info" class="changes"> |
|
64 | <div id="${cs.raw_id}_changes_info" class="changes"> | |
65 | <span id="${cs.raw_id}" class="changed_total tooltip" title="${_('Affected number of files, click to show more details')}">${len(cs.affected_files)}</span> |
|
65 | <span id="${cs.raw_id}" class="changed_total tooltip" title="${_('Affected number of files, click to show more details')}">${len(cs.affected_files)}</span> | |
66 | </div> |
|
66 | </div> | |
67 | %if cs.parents: |
|
67 | %if cs.parents: | |
68 | %for p_cs in reversed(cs.parents): |
|
68 | %for p_cs in reversed(cs.parents): | |
69 | <div class="parent">${_('Parent')} |
|
69 | <div class="parent">${_('Parent')} | |
70 | <span class="changeset_id">${p_cs.revision}:<span class="changeset_hash">${h.link_to(h.short_id(p_cs.raw_id), |
|
70 | <span class="changeset_id">${p_cs.revision}:<span class="changeset_hash">${h.link_to(h.short_id(p_cs.raw_id), | |
71 | h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}</span></span> |
|
71 | h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}</span></span> | |
72 | </div> |
|
72 | </div> | |
73 | %endfor |
|
73 | %endfor | |
74 | %else: |
|
74 | %else: | |
75 | <div class="parent">${_('No parents')}</div> |
|
75 | <div class="parent">${_('No parents')}</div> | |
76 | %endif |
|
76 | %endif | |
77 |
|
77 | |||
78 | <span class="logtags"> |
|
78 | <span class="logtags"> | |
79 | %if len(cs.parents)>1: |
|
79 | %if len(cs.parents)>1: | |
80 | <span class="merge">${_('merge')}</span> |
|
80 | <span class="merge">${_('merge')}</span> | |
81 | %endif |
|
81 | %endif | |
82 | %if cs.branch: |
|
82 | %if cs.branch: | |
83 | <span class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}"> |
|
83 | <span class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}"> | |
84 | ${h.link_to(cs.branch,h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span> |
|
84 | ${h.link_to(cs.branch,h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span> | |
85 | %endif |
|
85 | %endif | |
86 | %for tag in cs.tags: |
|
86 | %for tag in cs.tags: | |
87 | <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}"> |
|
87 | <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}"> | |
88 | ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span> |
|
88 | ${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span> | |
89 | %endfor |
|
89 | %endfor | |
90 | </span> |
|
90 | </span> | |
91 | </div> |
|
91 | </div> | |
92 | </div> |
|
92 | </div> | |
93 |
|
93 | |||
94 | %endfor |
|
94 | %endfor | |
95 | <div class="pagination-wh pagination-left"> |
|
95 | <div class="pagination-wh pagination-left"> | |
96 | ${c.pagination.pager('$link_previous ~2~ $link_next')} |
|
96 | ${c.pagination.pager('$link_previous ~2~ $link_next')} | |
97 | </div> |
|
97 | </div> | |
98 | </div> |
|
98 | </div> | |
99 | </div> |
|
99 | </div> | |
100 |
|
100 | |||
101 | <script type="text/javascript" src="${h.url('/js/graph.js')}"></script> |
|
101 | <script type="text/javascript" src="${h.url('/js/graph.js')}"></script> | |
102 | <script type="text/javascript"> |
|
102 | <script type="text/javascript"> | |
103 | YAHOO.util.Event.onDOMReady(function(){ |
|
103 | YAHOO.util.Event.onDOMReady(function(){ | |
104 |
|
104 | |||
105 | //Monitor range checkboxes and build a link to changesets |
|
105 | //Monitor range checkboxes and build a link to changesets | |
106 | //ranges |
|
106 | //ranges | |
107 | var checkboxes = YUD.getElementsByClassName('changeset_range'); |
|
107 | var checkboxes = YUD.getElementsByClassName('changeset_range'); | |
108 | var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}"; |
|
108 | var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}"; | |
109 | YUE.on(checkboxes,'click',function(e){ |
|
109 | YUE.on(checkboxes,'click',function(e){ | |
110 | var checked_checkboxes = []; |
|
110 | var checked_checkboxes = []; | |
111 | for (pos in checkboxes){ |
|
111 | for (pos in checkboxes){ | |
112 | if(checkboxes[pos].checked){ |
|
112 | if(checkboxes[pos].checked){ | |
113 | checked_checkboxes.push(checkboxes[pos]); |
|
113 | checked_checkboxes.push(checkboxes[pos]); | |
114 | } |
|
114 | } | |
115 | } |
|
115 | } | |
116 | if(checked_checkboxes.length>1){ |
|
116 | if(checked_checkboxes.length>1){ | |
117 | var rev_end = checked_checkboxes[0].name; |
|
117 | var rev_end = checked_checkboxes[0].name; | |
118 | var rev_start = checked_checkboxes[checked_checkboxes.length-1].name; |
|
118 | var rev_start = checked_checkboxes[checked_checkboxes.length-1].name; | |
119 |
|
119 | |||
120 | var url = url_tmpl.replace('__REVRANGE__', |
|
120 | var url = url_tmpl.replace('__REVRANGE__', | |
121 | rev_start+'...'+rev_end); |
|
121 | rev_start+'...'+rev_end); | |
122 |
|
122 | |||
123 | var link = "<a href="+url+">${_('Show selected changes __S -> __E')}</a>" |
|
123 | var link = "<a href="+url+">${_('Show selected changes __S -> __E')}</a>" | |
124 | link = link.replace('__S',rev_start); |
|
124 | link = link.replace('__S',rev_start); | |
125 | link = link.replace('__E',rev_end); |
|
125 | link = link.replace('__E',rev_end); | |
126 | YUD.get('rev_range_container').innerHTML = link; |
|
126 | YUD.get('rev_range_container').innerHTML = link; | |
127 | YUD.setStyle('rev_range_container','display',''); |
|
127 | YUD.setStyle('rev_range_container','display',''); | |
128 | } |
|
128 | } | |
129 | else{ |
|
129 | else{ | |
130 | YUD.setStyle('rev_range_container','display','none'); |
|
130 | YUD.setStyle('rev_range_container','display','none'); | |
131 |
|
131 | |||
132 | } |
|
132 | } | |
133 | }); |
|
133 | }); | |
134 |
|
134 | |||
135 | // Fetch changeset details |
|
135 | // Fetch changeset details | |
136 | YUE.on(YUD.getElementsByClassName('changed_total'),'click',function(e){ |
|
136 | YUE.on(YUD.getElementsByClassName('changed_total'),'click',function(e){ | |
137 | var id = e.currentTarget.id |
|
137 | var id = e.currentTarget.id | |
138 | var url = "${h.url('changelog_details',repo_name=c.repo_name,cs='__CS__')}" |
|
138 | var url = "${h.url('changelog_details',repo_name=c.repo_name,cs='__CS__')}" | |
139 | var url = url.replace('__CS__',id); |
|
139 | var url = url.replace('__CS__',id); | |
140 | ypjax(url,id+'_changes_info',function(){tooltip_activate()}); |
|
140 | ypjax(url,id+'_changes_info',function(){tooltip_activate()}); | |
141 | }); |
|
141 | }); | |
142 |
|
142 | |||
143 | // change branch filter |
|
143 | // change branch filter | |
144 | YUE.on(YUD.get('branch_filter'),'change',function(e){ |
|
144 | YUE.on(YUD.get('branch_filter'),'change',function(e){ | |
145 | var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value; |
|
145 | var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value; | |
146 | console.log(selected_branch); |
|
146 | console.log(selected_branch); | |
147 | var url_main = "${h.url('changelog_home',repo_name=c.repo_name)}"; |
|
147 | var url_main = "${h.url('changelog_home',repo_name=c.repo_name)}"; | |
148 | var url = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}"; |
|
148 | var url = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}"; | |
149 | var url = url.replace('__BRANCH__',selected_branch); |
|
149 | var url = url.replace('__BRANCH__',selected_branch); | |
150 | if(selected_branch != ''){ |
|
150 | if(selected_branch != ''){ | |
151 | window.location = url; |
|
151 | window.location = url; | |
152 | }else{ |
|
152 | }else{ | |
153 | window.location = url_main; |
|
153 | window.location = url_main; | |
154 | } |
|
154 | } | |
155 |
|
155 | |||
156 | }); |
|
156 | }); | |
157 |
|
157 | |||
158 | // Expand long messages on click |
|
158 | // Expand long messages on click | |
159 | var messages = YUD.getElementsByClassName('message'); |
|
159 | var messages = YUD.getElementsByClassName('message'); | |
160 | for (idx in messages) { |
|
160 | for (idx in messages) { | |
161 | var msg = messages[idx]; |
|
161 | var msg = messages[idx]; | |
162 | // would the message be clipped? |
|
162 | // would the message be clipped? | |
163 | if (msg.scrollHeight > msg.parentNode.parentNode.offsetHeight) |
|
163 | if (msg.scrollHeight > msg.parentNode.parentNode.offsetHeight) | |
164 | { |
|
164 | { | |
165 | msg.style.cursor = 's-resize'; |
|
165 | msg.style.cursor = 's-resize'; | |
166 | msg.onclick = function() { |
|
166 | msg.onclick = function() { | |
167 | this.parentNode.parentNode.style.height = 'auto'; |
|
167 | this.parentNode.parentNode.style.height = 'auto'; | |
168 | repaint_graph(); |
|
|||
169 | } |
|
168 | } | |
170 | } |
|
169 | } | |
171 | } |
|
170 | } | |
172 |
|
171 | |||
173 |
function set_canvas( |
|
172 | function set_canvas(heads) { | |
174 | var c = document.getElementById('graph_nodes'); |
|
173 | var c = document.getElementById('graph_nodes'); | |
175 | var t = document.getElementById('graph_content'); |
|
174 | var t = document.getElementById('graph_content'); | |
176 | canvas = document.getElementById('graph_canvas'); |
|
175 | canvas = document.getElementById('graph_canvas'); | |
177 | var div_h = t.clientHeight; |
|
176 | var div_h = t.clientHeight; | |
178 | c.style.height=div_h+'px'; |
|
177 | c.style.height=div_h+'px'; | |
179 | canvas.setAttribute('height',div_h); |
|
178 | canvas.setAttribute('height',div_h); | |
180 | c.style.height=max_w+'px'; |
|
179 | c.style.height=max_w+'px'; | |
181 | canvas.setAttribute('width',max_w); |
|
180 | canvas.setAttribute('width',max_w); | |
182 | }; |
|
181 | }; | |
183 | function calc_max_w(jsdata) { |
|
182 | var heads = 1; | |
184 |
|
|
183 | var max_heads = 0; | |
185 | var max_heads = 0; |
|
184 | var jsdata = ${c.jsdata|n}; | |
186 | for( var i=0;i<jsdata.length;i++){ |
|
185 | ||
187 | var m = Math.max.apply(Math, jsdata[i][1]); |
|
186 | for( var i=0;i<jsdata.length;i++){ | |
188 | if (m>max_heads){ |
|
187 | var m = Math.max.apply(Math, jsdata[i][1]); | |
189 |
|
|
188 | if (m>max_heads){ | |
190 | } |
|
189 | max_heads = m; | |
191 |
|
|
190 | } | |
192 | return Math.max(100,max_heads*25); |
|
|||
193 | } |
|
191 | } | |
194 | function repaint_graph() { |
|
192 | var max_w = Math.max(100,max_heads*25); | |
195 | var jsdata = ${c.jsdata|n}; |
|
193 | set_canvas(max_w); | |
196 | var max_w = calc_max_w(jsdata); |
|
194 | ||
197 | set_canvas(max_w); |
|
195 | var r = new BranchRenderer(); | |
198 | var r = new BranchRenderer(); |
|
196 | r.render(jsdata,max_w); | |
199 | r.render(jsdata,max_w); |
|
197 | ||
200 | } |
|
|||
201 | repaint_graph (); |
|
|||
202 | }); |
|
198 | }); | |
203 | </script> |
|
199 | </script> | |
204 | %else: |
|
200 | %else: | |
205 | ${_('There are no changes yet')} |
|
201 | ${_('There are no changes yet')} | |
206 | %endif |
|
202 | %endif | |
207 | </div> |
|
203 | </div> | |
208 | </div> |
|
204 | </div> | |
209 | </%def> No newline at end of file |
|
205 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now