Show More
@@ -1,287 +1,291 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 | ${_('%s Changelog') % c.repo_name} - ${c.rhodecode_name} |
|
6 | ${_('%s Changelog') % c.repo_name} - ${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.repo_link(c.rhodecode_db_repo.groups_and_repo)} |
|
12 | ${h.repo_link(c.rhodecode_db_repo.groups_and_repo)} | |
13 | » |
|
13 | » | |
14 | <% size = c.size if c.size <= c.total_cs else c.total_cs %> |
|
14 | <% size = c.size if c.size <= c.total_cs else c.total_cs %> | |
15 | ${_('changelog')} - ${ungettext('showing %d out of %d revision', 'showing %d out of %d revisions', size) % (size, c.total_cs)} |
|
15 | ${_('changelog')} - ${ungettext('showing %d out of %d revision', 'showing %d out of %d revisions', size) % (size, c.total_cs)} | |
16 | </%def> |
|
16 | </%def> | |
17 |
|
17 | |||
18 | <%def name="page_nav()"> |
|
18 | <%def name="page_nav()"> | |
19 | ${self.menu('changelog')} |
|
19 | ${self.menu('changelog')} | |
20 | </%def> |
|
20 | </%def> | |
21 |
|
21 | |||
22 | <%def name="main()"> |
|
22 | <%def name="main()"> | |
23 | ${self.context_bar('changelog')} |
|
23 | ${self.context_bar('changelog')} | |
24 | <div class="box"> |
|
24 | <div class="box"> | |
25 | <!-- box / title --> |
|
25 | <!-- box / title --> | |
26 | <div class="title"> |
|
26 | <div class="title"> | |
27 | ${self.breadcrumbs()} |
|
27 | ${self.breadcrumbs()} | |
28 | </div> |
|
28 | </div> | |
29 | <div class="table"> |
|
29 | <div class="table"> | |
30 | % if c.pagination: |
|
30 | % if c.pagination: | |
31 | <div id="graph"> |
|
31 | <div id="graph"> | |
32 | <div id="graph_nodes"> |
|
32 | <div id="graph_nodes"> | |
33 | <canvas id="graph_canvas"></canvas> |
|
33 | <canvas id="graph_canvas"></canvas> | |
34 | </div> |
|
34 | </div> | |
35 | <div id="graph_content"> |
|
35 | <div id="graph_content"> | |
36 | <div class="info_box" style="clear: both;padding: 10px 6px;text-align: right;"> |
|
36 | <div class="info_box" style="clear: both;padding: 10px 6px;text-align: right;"> | |
37 | <a href="#" class="ui-btn small" id="rev_range_container" style="display:none"></a> |
|
37 | <a href="#" class="ui-btn small" id="rev_range_container" style="display:none"></a> | |
38 | <a href="#" class="ui-btn small" id="rev_range_clear" style="display:none">${_('Clear selection')}</a> |
|
38 | <a href="#" class="ui-btn small" id="rev_range_clear" style="display:none">${_('Clear selection')}</a> | |
39 |
|
39 | |||
40 | %if c.rhodecode_db_repo.fork: |
|
40 | %if c.rhodecode_db_repo.fork: | |
41 | <a title="${_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name)}" href="${h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,org_ref_type='branch',org_ref='default',other_repo=c.repo_name,other_ref_type='branch',other_ref=request.GET.get('branch') or 'default')}" class="ui-btn small">${_('Compare fork with parent')}</a> |
|
41 | <a title="${_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name)}" href="${h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,org_ref_type='branch',org_ref='default',other_repo=c.repo_name,other_ref_type='branch',other_ref=request.GET.get('branch') or 'default')}" class="ui-btn small">${_('Compare fork with parent')}</a> | |
42 | %endif |
|
42 | %endif | |
43 | %if h.is_hg(c.rhodecode_repo): |
|
43 | %if h.is_hg(c.rhodecode_repo): | |
44 | <a id="open_new_pr" href="${h.url('pullrequest_form',repo_name=c.repo_name)}" class="ui-btn small">${_('Open new pull request')}</a> |
|
44 | <a id="open_new_pr" href="${h.url('pullrequest_form',repo_name=c.repo_name)}" class="ui-btn small">${_('Open new pull request')}</a> | |
45 | %endif |
|
45 | %endif | |
46 | </div> |
|
46 | </div> | |
47 | <div class="container_header"> |
|
47 | <div class="container_header"> | |
48 | ${h.form(h.url.current(),method='get')} |
|
48 | ${h.form(h.url.current(),method='get')} | |
49 | <div class="info_box" style="float:left"> |
|
49 | <div class="info_box" style="float:left"> | |
50 | ${h.submit('set',_('Show'),class_="ui-btn")} |
|
50 | ${h.submit('set',_('Show'),class_="ui-btn")} | |
51 | ${h.text('size',size=1,value=c.size)} |
|
51 | ${h.text('size',size=1,value=c.size)} | |
52 | ${_('revisions')} |
|
52 | ${_('revisions')} | |
53 | </div> |
|
53 | </div> | |
54 | ${h.end_form()} |
|
54 | ${h.end_form()} | |
55 | <div style="float:right">${h.select('branch_filter',c.branch_name,c.branch_filters)}</div> |
|
55 | <div style="float:right">${h.select('branch_filter',c.branch_name,c.branch_filters)}</div> | |
56 | </div> |
|
56 | </div> | |
57 |
|
57 | |||
58 | %for cnt,cs in enumerate(c.pagination): |
|
58 | %for cnt,cs in enumerate(c.pagination): | |
59 | <div id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}"> |
|
59 | <div id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}"> | |
60 | <div class="left"> |
|
60 | <div class="left"> | |
61 | <div> |
|
61 | <div> | |
62 | ${h.checkbox(cs.raw_id,class_="changeset_range")} |
|
62 | ${h.checkbox(cs.raw_id,class_="changeset_range")} | |
63 | <span class="tooltip" title="${h.tooltip(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> |
|
63 | <span class="tooltip" title="${h.tooltip(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> | |
64 | </div> |
|
64 | </div> | |
65 | <div class="author"> |
|
65 | <div class="author"> | |
66 | <div class="gravatar"> |
|
66 | <div class="gravatar"> | |
67 | <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(cs.author),16)}"/> |
|
67 | <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(cs.author),16)}"/> | |
68 | </div> |
|
68 | </div> | |
69 | <div title="${cs.author}" class="user">${h.shorter(h.person(cs.author),22)}</div> |
|
69 | <div title="${cs.author}" class="user">${h.shorter(h.person(cs.author),22)}</div> | |
70 | </div> |
|
70 | </div> | |
71 | <div class="date">${h.fmt_date(cs.date)}</div> |
|
71 | <div class="date">${h.fmt_date(cs.date)}</div> | |
72 | </div> |
|
72 | </div> | |
73 | <div class="mid"> |
|
73 | <div class="mid"> | |
74 | <div class="message">${h.urlify_commit(cs.message, c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div> |
|
74 | <div class="message">${h.urlify_commit(cs.message, c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div> | |
75 | <div class="expand"><span class="expandtext">↓ ${_('Show more')} ↓</span></div> |
|
75 | <div class="expand"><span class="expandtext">↓ ${_('Show more')} ↓</span></div> | |
76 | </div> |
|
76 | </div> | |
77 | <div class="right"> |
|
77 | <div class="right"> | |
78 | <div class="changes"> |
|
78 | <div class="changes"> | |
79 | <div id="changed_total_${cs.raw_id}" style="float:right;" class="changed_total tooltip" title="${h.tooltip(_('Affected number of files, click to show more details'))}">${len(cs.affected_files)}</div> |
|
79 | <div id="changed_total_${cs.raw_id}" style="float:right;" class="changed_total tooltip" title="${h.tooltip(_('Affected number of files, click to show more details'))}">${len(cs.affected_files)}</div> | |
80 | <div class="comments-container"> |
|
80 | <div class="comments-container"> | |
81 | %if len(c.comments.get(cs.raw_id,[])) > 0: |
|
81 | %if len(c.comments.get(cs.raw_id,[])) > 0: | |
82 | <div class="comments-cnt" title="${('comments')}"> |
|
82 | <div class="comments-cnt" title="${('comments')}"> | |
83 | <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)}"> |
|
83 | <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)}"> | |
84 | <div class="comments-cnt">${len(c.comments[cs.raw_id])}</div> |
|
84 | <div class="comments-cnt">${len(c.comments[cs.raw_id])}</div> | |
85 | <img src="${h.url('/images/icons/comments.png')}"> |
|
85 | <img src="${h.url('/images/icons/comments.png')}"> | |
86 | </a> |
|
86 | </a> | |
87 | </div> |
|
87 | </div> | |
88 | %endif |
|
88 | %endif | |
89 | </div> |
|
89 | </div> | |
90 | <div class="changeset-status-container"> |
|
90 | <div class="changeset-status-container"> | |
91 | %if c.statuses.get(cs.raw_id): |
|
91 | %if c.statuses.get(cs.raw_id): | |
92 | <div title="${_('Changeset status')}" class="changeset-status-lbl">${c.statuses.get(cs.raw_id)[1]}</div> |
|
92 | <div title="${_('Changeset status')}" class="changeset-status-lbl">${c.statuses.get(cs.raw_id)[1]}</div> | |
93 | <div class="changeset-status-ico"> |
|
93 | <div class="changeset-status-ico"> | |
94 | %if c.statuses.get(cs.raw_id)[2]: |
|
94 | %if c.statuses.get(cs.raw_id)[2]: | |
95 | <a class="tooltip" title="${_('Click to open associated pull request #%s' % c.statuses.get(cs.raw_id)[2])}" href="${h.url('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}"><img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" /></a> |
|
95 | <a class="tooltip" title="${_('Click to open associated pull request #%s' % c.statuses.get(cs.raw_id)[2])}" href="${h.url('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}"><img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" /></a> | |
96 | %else: |
|
96 | %else: | |
97 | <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" /> |
|
97 | <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" /> | |
98 | %endif |
|
98 | %endif | |
99 | </div> |
|
99 | </div> | |
100 | %endif |
|
100 | %endif | |
101 | </div> |
|
101 | </div> | |
102 | </div> |
|
102 | </div> | |
103 | %if cs.parents: |
|
103 | %if cs.parents: | |
104 | %for p_cs in reversed(cs.parents): |
|
104 | %for p_cs in reversed(cs.parents): | |
105 | <div class="parent">${_('Parent')} |
|
105 | <div class="parent">${_('Parent')} | |
106 | <span class="changeset_id">${p_cs.revision}:<span class="changeset_hash">${h.link_to(h.short_id(p_cs.raw_id), |
|
106 | <span class="changeset_id">${p_cs.revision}:<span class="changeset_hash">${h.link_to(h.short_id(p_cs.raw_id), | |
107 | h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}</span></span> |
|
107 | h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}</span></span> | |
108 | </div> |
|
108 | </div> | |
109 | %endfor |
|
109 | %endfor | |
110 | %else: |
|
110 | %else: | |
111 | <div class="parent">${_('No parents')}</div> |
|
111 | <div class="parent">${_('No parents')}</div> | |
112 | %endif |
|
112 | %endif | |
113 |
|
113 | |||
114 | <span class="logtags"> |
|
114 | <span class="logtags"> | |
115 | %if len(cs.parents)>1: |
|
115 | %if len(cs.parents)>1: | |
116 | <span class="merge">${_('merge')}</span> |
|
116 | <span class="merge">${_('merge')}</span> | |
117 | %endif |
|
117 | %endif | |
118 | %if cs.branch: |
|
118 | %if cs.branch: | |
119 | <span class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}"> |
|
119 | <span class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}"> | |
120 | ${h.link_to(h.shorter(cs.branch),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} |
|
120 | ${h.link_to(h.shorter(cs.branch),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} | |
121 | </span> |
|
121 | </span> | |
122 | %endif |
|
122 | %endif | |
123 | %if h.is_hg(c.rhodecode_repo): |
|
123 | %if h.is_hg(c.rhodecode_repo): | |
124 | %for book in cs.bookmarks: |
|
124 | %for book in cs.bookmarks: | |
125 | <span class="bookbook" title="${'%s %s' % (_('bookmark'),book)}"> |
|
125 | <span class="bookbook" title="${'%s %s' % (_('bookmark'),book)}"> | |
126 | ${h.link_to(h.shorter(book),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} |
|
126 | ${h.link_to(h.shorter(book),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} | |
127 | </span> |
|
127 | </span> | |
128 | %endfor |
|
128 | %endfor | |
129 | %endif |
|
129 | %endif | |
130 | %for tag in cs.tags: |
|
130 | %for tag in cs.tags: | |
131 | <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}"> |
|
131 | <span class="tagtag" title="${'%s %s' % (_('tag'),tag)}"> | |
132 | ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span> |
|
132 | ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}</span> | |
133 | %endfor |
|
133 | %endfor | |
134 | </span> |
|
134 | </span> | |
135 | </div> |
|
135 | </div> | |
136 | </div> |
|
136 | </div> | |
137 |
|
137 | |||
138 | %endfor |
|
138 | %endfor | |
139 | <div class="pagination-wh pagination-left"> |
|
139 | <div class="pagination-wh pagination-left"> | |
140 | ${c.pagination.pager('$link_previous ~2~ $link_next')} |
|
140 | ${c.pagination.pager('$link_previous ~2~ $link_next')} | |
141 | </div> |
|
141 | </div> | |
142 | </div> |
|
142 | </div> | |
143 | </div> |
|
143 | </div> | |
144 |
|
144 | |||
145 | <script type="text/javascript" src="${h.url('/js/graph.js')}"></script> |
|
145 | <script type="text/javascript" src="${h.url('/js/graph.js')}"></script> | |
146 | <script type="text/javascript"> |
|
146 | <script type="text/javascript"> | |
147 | YAHOO.util.Event.onDOMReady(function(){ |
|
147 | YAHOO.util.Event.onDOMReady(function(){ | |
148 |
|
148 | |||
149 | //Monitor range checkboxes and build a link to changesets |
|
149 | //Monitor range checkboxes and build a link to changesets | |
150 | //ranges |
|
150 | //ranges | |
151 | var checkboxes = YUD.getElementsByClassName('changeset_range'); |
|
151 | var checkboxes = YUD.getElementsByClassName('changeset_range'); | |
152 | var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}"; |
|
152 | var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}"; | |
153 | var pr_tmpl = "${h.url('pullrequest_home',repo_name=c.repo_name)}"; |
|
153 | var pr_tmpl = "${h.url('pullrequest_home',repo_name=c.repo_name)}"; | |
154 | YUE.on(checkboxes,'click',function(e){ |
|
154 | ||
|
155 | var checkbox_checker = function(e){ | |||
155 | var clicked_cb = e.currentTarget; |
|
156 | var clicked_cb = e.currentTarget; | |
156 | var checked_checkboxes = []; |
|
157 | var checked_checkboxes = []; | |
157 | for (pos in checkboxes){ |
|
158 | for (pos in checkboxes){ | |
158 | if(checkboxes[pos].checked){ |
|
159 | if(checkboxes[pos].checked){ | |
159 | checked_checkboxes.push(checkboxes[pos]); |
|
160 | checked_checkboxes.push(checkboxes[pos]); | |
160 | } |
|
161 | } | |
161 | } |
|
162 | } | |
162 | if(YUD.get('open_new_pr')){ |
|
163 | if(YUD.get('open_new_pr')){ | |
163 | if(checked_checkboxes.length>0){ |
|
164 | if(checked_checkboxes.length>0){ | |
164 | // modify open pull request to show we have selected cs |
|
165 | // modify open pull request to show we have selected cs | |
165 | YUD.get('open_new_pr').innerHTML = _TM['Open new pull request for selected changesets']; |
|
166 | YUD.get('open_new_pr').innerHTML = _TM['Open new pull request for selected changesets']; | |
166 | }else{ |
|
167 | }else{ | |
167 | YUD.get('open_new_pr').innerHTML = _TM['Open new pull request']; |
|
168 | YUD.get('open_new_pr').innerHTML = _TM['Open new pull request']; | |
168 | } |
|
169 | } | |
169 | } |
|
170 | } | |
170 |
|
171 | |||
171 | if(checked_checkboxes.length>0){ |
|
172 | if(checked_checkboxes.length>0){ | |
172 | var rev_end = checked_checkboxes[0].name; |
|
173 | var rev_end = checked_checkboxes[0].name; | |
173 | var rev_start = checked_checkboxes[checked_checkboxes.length-1].name; |
|
174 | var rev_start = checked_checkboxes[checked_checkboxes.length-1].name; | |
174 | var url = url_tmpl.replace('__REVRANGE__', |
|
175 | var url = url_tmpl.replace('__REVRANGE__', | |
175 | rev_start+'...'+rev_end); |
|
176 | rev_start+'...'+rev_end); | |
176 |
|
177 | |||
177 | var link = (rev_start == rev_end) |
|
178 | var link = (rev_start == rev_end) | |
178 | ? _TM['Show selected change __S'] |
|
179 | ? _TM['Show selected change __S'] | |
179 | : _TM['Show selected changes __S -> __E']; |
|
180 | : _TM['Show selected changes __S -> __E']; | |
180 |
|
181 | |||
181 | link = link.replace('__S',rev_start.substr(0,6)); |
|
182 | link = link.replace('__S',rev_start.substr(0,6)); | |
182 | link = link.replace('__E',rev_end.substr(0,6)); |
|
183 | link = link.replace('__E',rev_end.substr(0,6)); | |
183 | YUD.get('rev_range_container').href = url; |
|
184 | YUD.get('rev_range_container').href = url; | |
184 | YUD.get('rev_range_container').innerHTML = link; |
|
185 | YUD.get('rev_range_container').innerHTML = link; | |
185 | YUD.setStyle('rev_range_container','display',''); |
|
186 | YUD.setStyle('rev_range_container','display',''); | |
186 | YUD.setStyle('rev_range_clear','display',''); |
|
187 | YUD.setStyle('rev_range_clear','display',''); | |
187 |
|
188 | |||
188 | YUD.get('open_new_pr').href = pr_tmpl + '?rev_start={0}&rev_end={1}'.format(rev_start,rev_end); |
|
189 | YUD.get('open_new_pr').href = pr_tmpl + '?rev_start={0}&rev_end={1}'.format(rev_start,rev_end); | |
189 |
|
190 | |||
190 | } |
|
191 | } | |
191 | else{ |
|
192 | else{ | |
192 | YUD.setStyle('rev_range_container','display','none'); |
|
193 | YUD.setStyle('rev_range_container','display','none'); | |
193 | YUD.setStyle('rev_range_clear','display','none'); |
|
194 | YUD.setStyle('rev_range_clear','display','none'); | |
194 | } |
|
195 | } | |
195 |
} |
|
196 | }; | |
|
197 | YUE.onDOMReady(checkbox_checker); | |||
|
198 | YUE.on(checkboxes,'click', checkbox_checker); | |||
|
199 | ||||
196 | YUE.on('rev_range_clear','click',function(e){ |
|
200 | YUE.on('rev_range_clear','click',function(e){ | |
197 | for (var i=0; i<checkboxes.length; i++){ |
|
201 | for (var i=0; i<checkboxes.length; i++){ | |
198 | var cb = checkboxes[i]; |
|
202 | var cb = checkboxes[i]; | |
199 | cb.checked = false; |
|
203 | cb.checked = false; | |
200 | } |
|
204 | } | |
201 | YUE.preventDefault(e); |
|
205 | YUE.preventDefault(e); | |
202 | }) |
|
206 | }) | |
203 | var msgs = YUQ('.message'); |
|
207 | var msgs = YUQ('.message'); | |
204 | // get first element height |
|
208 | // get first element height | |
205 | var el = YUQ('#graph_content .container')[0]; |
|
209 | var el = YUQ('#graph_content .container')[0]; | |
206 | var row_h = el.clientHeight; |
|
210 | var row_h = el.clientHeight; | |
207 | for(var i=0;i<msgs.length;i++){ |
|
211 | for(var i=0;i<msgs.length;i++){ | |
208 | var m = msgs[i]; |
|
212 | var m = msgs[i]; | |
209 |
|
213 | |||
210 | var h = m.clientHeight; |
|
214 | var h = m.clientHeight; | |
211 | var pad = YUD.getStyle(m,'padding'); |
|
215 | var pad = YUD.getStyle(m,'padding'); | |
212 | if(h > row_h){ |
|
216 | if(h > row_h){ | |
213 | var offset = row_h - (h+12); |
|
217 | var offset = row_h - (h+12); | |
214 | YUD.setStyle(m.nextElementSibling,'display','block'); |
|
218 | YUD.setStyle(m.nextElementSibling,'display','block'); | |
215 | YUD.setStyle(m.nextElementSibling,'margin-top',offset+'px'); |
|
219 | YUD.setStyle(m.nextElementSibling,'margin-top',offset+'px'); | |
216 | }; |
|
220 | }; | |
217 | } |
|
221 | } | |
218 | YUE.on(YUQ('.expand'),'click',function(e){ |
|
222 | YUE.on(YUQ('.expand'),'click',function(e){ | |
219 | var elem = e.currentTarget.parentNode.parentNode; |
|
223 | var elem = e.currentTarget.parentNode.parentNode; | |
220 | YUD.setStyle(e.currentTarget,'display','none'); |
|
224 | YUD.setStyle(e.currentTarget,'display','none'); | |
221 | YUD.setStyle(elem,'height','auto'); |
|
225 | YUD.setStyle(elem,'height','auto'); | |
222 |
|
226 | |||
223 | //redraw the graph, line_count and jsdata are global vars |
|
227 | //redraw the graph, line_count and jsdata are global vars | |
224 | set_canvas(100); |
|
228 | set_canvas(100); | |
225 |
|
229 | |||
226 | var r = new BranchRenderer(); |
|
230 | var r = new BranchRenderer(); | |
227 | r.render(jsdata,100,line_count); |
|
231 | r.render(jsdata,100,line_count); | |
228 |
|
232 | |||
229 | }) |
|
233 | }) | |
230 |
|
234 | |||
231 | // Fetch changeset details |
|
235 | // Fetch changeset details | |
232 | YUE.on(YUD.getElementsByClassName('changed_total'),'click',function(e){ |
|
236 | YUE.on(YUD.getElementsByClassName('changed_total'),'click',function(e){ | |
233 | var id = e.currentTarget.id; |
|
237 | var id = e.currentTarget.id; | |
234 | var url = "${h.url('changelog_details',repo_name=c.repo_name,cs='__CS__')}"; |
|
238 | var url = "${h.url('changelog_details',repo_name=c.repo_name,cs='__CS__')}"; | |
235 | var url = url.replace('__CS__',id.replace('changed_total_','')); |
|
239 | var url = url.replace('__CS__',id.replace('changed_total_','')); | |
236 | ypjax(url,id,function(){tooltip_activate()}); |
|
240 | ypjax(url,id,function(){tooltip_activate()}); | |
237 | }); |
|
241 | }); | |
238 |
|
242 | |||
239 | // change branch filter |
|
243 | // change branch filter | |
240 | YUE.on(YUD.get('branch_filter'),'change',function(e){ |
|
244 | YUE.on(YUD.get('branch_filter'),'change',function(e){ | |
241 | var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value; |
|
245 | var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value; | |
242 | var url_main = "${h.url('changelog_home',repo_name=c.repo_name)}"; |
|
246 | var url_main = "${h.url('changelog_home',repo_name=c.repo_name)}"; | |
243 | var url = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}"; |
|
247 | var url = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}"; | |
244 | var url = url.replace('__BRANCH__',selected_branch); |
|
248 | var url = url.replace('__BRANCH__',selected_branch); | |
245 | if(selected_branch != ''){ |
|
249 | if(selected_branch != ''){ | |
246 | window.location = url; |
|
250 | window.location = url; | |
247 | }else{ |
|
251 | }else{ | |
248 | window.location = url_main; |
|
252 | window.location = url_main; | |
249 | } |
|
253 | } | |
250 |
|
254 | |||
251 | }); |
|
255 | }); | |
252 |
|
256 | |||
253 | function set_canvas(width) { |
|
257 | function set_canvas(width) { | |
254 | var c = document.getElementById('graph_nodes'); |
|
258 | var c = document.getElementById('graph_nodes'); | |
255 | var t = document.getElementById('graph_content'); |
|
259 | var t = document.getElementById('graph_content'); | |
256 | canvas = document.getElementById('graph_canvas'); |
|
260 | canvas = document.getElementById('graph_canvas'); | |
257 | var div_h = t.clientHeight; |
|
261 | var div_h = t.clientHeight; | |
258 | c.style.height=div_h+'px'; |
|
262 | c.style.height=div_h+'px'; | |
259 | canvas.setAttribute('height',div_h); |
|
263 | canvas.setAttribute('height',div_h); | |
260 | c.style.height=width+'px'; |
|
264 | c.style.height=width+'px'; | |
261 | canvas.setAttribute('width',width); |
|
265 | canvas.setAttribute('width',width); | |
262 | }; |
|
266 | }; | |
263 | var heads = 1; |
|
267 | var heads = 1; | |
264 | var line_count = 0; |
|
268 | var line_count = 0; | |
265 | var jsdata = ${c.jsdata|n}; |
|
269 | var jsdata = ${c.jsdata|n}; | |
266 |
|
270 | |||
267 | for (var i=0;i<jsdata.length;i++) { |
|
271 | for (var i=0;i<jsdata.length;i++) { | |
268 | var in_l = jsdata[i][2]; |
|
272 | var in_l = jsdata[i][2]; | |
269 | for (var j in in_l) { |
|
273 | for (var j in in_l) { | |
270 | var m = in_l[j][1]; |
|
274 | var m = in_l[j][1]; | |
271 | if (m > line_count) |
|
275 | if (m > line_count) | |
272 | line_count = m; |
|
276 | line_count = m; | |
273 | } |
|
277 | } | |
274 | } |
|
278 | } | |
275 | set_canvas(100); |
|
279 | set_canvas(100); | |
276 |
|
280 | |||
277 | var r = new BranchRenderer(); |
|
281 | var r = new BranchRenderer(); | |
278 | r.render(jsdata,100,line_count); |
|
282 | r.render(jsdata,100,line_count); | |
279 |
|
283 | |||
280 | }); |
|
284 | }); | |
281 | </script> |
|
285 | </script> | |
282 | %else: |
|
286 | %else: | |
283 | ${_('There are no changes yet')} |
|
287 | ${_('There are no changes yet')} | |
284 | %endif |
|
288 | %endif | |
285 | </div> |
|
289 | </div> | |
286 | </div> |
|
290 | </div> | |
287 | </%def> |
|
291 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now