Mercurial > kallithea
annotate rhodecode/templates/changelog/changelog.html @ 3550:7abbb77b02d0 beta
Repo size - show just the size without duplicating text
bring back numeric revision into changelog
Fixed tests
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 20 Mar 2013 16:21:34 +0100 |
parents | c0a157ab9a15 |
children | 7967d00e4692 |
rev | line source |
---|---|
421
cbfb853a0a4c
fixed bug when author had " in name, thus breaking the javascript data format
Marcin Kuzminski <marcin@python-works.com>
parents:
401
diff
changeset
|
1 ## -*- coding: utf-8 -*- |
cbfb853a0a4c
fixed bug when author had " in name, thus breaking the javascript data format
Marcin Kuzminski <marcin@python-works.com>
parents:
401
diff
changeset
|
2 |
143
787689980bcd
Tempaltes changes for changelog and shortlog, changed menu generation in base
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
3 <%inherit file="/base/base.html"/> |
787689980bcd
Tempaltes changes for changelog and shortlog, changed menu generation in base
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
4 |
787689980bcd
Tempaltes changes for changelog and shortlog, changed menu generation in base
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
5 <%def name="title()"> |
2417
76d156bef5a2
Better i18n for page titles.
Vincent Duvert <vincent@duvert.net>
parents:
2416
diff
changeset
|
6 ${_('%s Changelog') % c.repo_name} - ${c.rhodecode_name} |
143
787689980bcd
Tempaltes changes for changelog and shortlog, changed menu generation in base
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
7 </%def> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
8 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
9 <%def name="breadcrumbs_links()"> |
2312
f6d57d055d1e
Improved i18n on changelog and user group administration pages.
Vincent Duvert <vincent@duvert.net>
parents:
2269
diff
changeset
|
10 <% size = c.size if c.size <= c.total_cs else c.total_cs %> |
3532 | 11 ${_('Changelog')} - ${ungettext('showing %d out of %d revision', 'showing %d out of %d revisions', size) % (size, c.total_cs)} |
143
787689980bcd
Tempaltes changes for changelog and shortlog, changed menu generation in base
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
12 </%def> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
13 |
143
787689980bcd
Tempaltes changes for changelog and shortlog, changed menu generation in base
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
14 <%def name="page_nav()"> |
3197 | 15 ${self.menu('changelog')} |
143
787689980bcd
Tempaltes changes for changelog and shortlog, changed menu generation in base
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
16 </%def> |
787689980bcd
Tempaltes changes for changelog and shortlog, changed menu generation in base
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
17 |
787689980bcd
Tempaltes changes for changelog and shortlog, changed menu generation in base
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
18 <%def name="main()"> |
3536 | 19 ${self.context_bar('changelog')} |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
20 <div class="box"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
21 <!-- box / title --> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
22 <div class="title"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
23 ${self.breadcrumbs()} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
24 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
25 <div class="table"> |
3197 | 26 % if c.pagination: |
27 <div id="graph"> | |
3485
b19b1723ff10
pullrequest: pullrequest from changelog view
Mads Kiilerich <madski@unity3d.com>
parents:
3465
diff
changeset
|
28 <div class="info_box" style="clear: both;padding: 10px 6px;min-height: 12px;text-align: right;"> |
2885
28d742d71d4e
made compare button nicer on changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
2773
diff
changeset
|
29 <a href="#" class="ui-btn small" id="rev_range_container" style="display:none"></a> |
2927
58bb350bfef8
Don't allow cherry picking changesets from the changelog using checkboxes.
Marcin Kuzminski <marcin@python-works.com>
parents:
2924
diff
changeset
|
30 <a href="#" class="ui-btn small" id="rev_range_clear" style="display:none">${_('Clear selection')}</a> |
2973
9937afa7f093
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2934
diff
changeset
|
31 |
2363
745dda7817ed
Rewrote url routes to make all validations and parsing for compare view + added compare fork button into forked repos
Marcin Kuzminski <marcin@python-works.com>
parents:
2346
diff
changeset
|
32 %if c.rhodecode_db_repo.fork: |
3486
2053053e0882
compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents:
3485
diff
changeset
|
33 <a id="compare_fork" 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',merge=1)}" class="ui-btn small">${_('Compare fork with parent')}</a> |
2363
745dda7817ed
Rewrote url routes to make all validations and parsing for compare view + added compare fork button into forked repos
Marcin Kuzminski <marcin@python-works.com>
parents:
2346
diff
changeset
|
34 %endif |
2773
1e5996308363
hide open pull request for git repos
Marcin Kuzminski <marcin@python-works.com>
parents:
2744
diff
changeset
|
35 %if h.is_hg(c.rhodecode_repo): |
3463
81ea5f73963f
changelog: fix invalid url name left over from cherry picking
Mads Kiilerich <madski@unity3d.com>
parents:
3449
diff
changeset
|
36 <a id="open_new_pr" href="${h.url('pullrequest_home',repo_name=c.repo_name)}" class="ui-btn small">${_('Open new pull request')}</a> |
2773
1e5996308363
hide open pull request for git repos
Marcin Kuzminski <marcin@python-works.com>
parents:
2744
diff
changeset
|
37 %endif |
3536 | 38 </div> |
39 <div class="container_header"> | |
40 ${h.form(h.url.current(),method='get')} | |
41 <div style="float:left"> | |
42 ${h.submit('set',_('Show'),class_="ui-btn")} | |
43 ${h.text('size',size=1,value=c.size)} | |
44 ${_('revisions')} | |
2363
745dda7817ed
Rewrote url routes to make all validations and parsing for compare view + added compare fork button into forked repos
Marcin Kuzminski <marcin@python-works.com>
parents:
2346
diff
changeset
|
45 </div> |
3536 | 46 ${h.end_form()} |
1656
833f9dec0a06
implemented #44 - branch filtering in changelog, aka branch browser
Marcin Kuzminski <marcin@python-works.com>
parents:
1463
diff
changeset
|
47 <div style="float:right">${h.select('branch_filter',c.branch_name,c.branch_filters)}</div> |
3536 | 48 </div> |
49 <div id="graph_nodes"> | |
50 <canvas id="graph_canvas"></canvas> | |
51 </div> | |
52 <div id="graph_content"> | |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
53 |
3536 | 54 <table id="changesets"> |
55 <tbody> | |
3197 | 56 %for cnt,cs in enumerate(c.pagination): |
3536 | 57 <tr id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}"> |
58 <td class="checkbox"> | |
3197 | 59 ${h.checkbox(cs.raw_id,class_="changeset_range")} |
3536 | 60 </td> |
61 <td class="author"> | |
62 <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(cs.author),16)}"/> | |
63 <span title="${cs.author}" class="user">${h.shorter(h.person(cs.author),22)}</span> | |
64 </td> | |
65 <td class="hash"> | |
3538
9bf927589f7a
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3537
diff
changeset
|
66 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"> |
3550
7abbb77b02d0
Repo size - show just the size without duplicating text
Marcin Kuzminski <marcin@python-works.com>
parents:
3544
diff
changeset
|
67 <span class="changeset_id">${cs.revision}:</span> |
3538
9bf927589f7a
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3537
diff
changeset
|
68 <span class="changeset_hash">${h.short_id(cs.raw_id)}</span> |
9bf927589f7a
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3537
diff
changeset
|
69 </a> |
3536 | 70 </td> |
71 <td class="date"> | |
72 <div class="date">${h.age(cs.date,True)}</div> | |
73 </td> | |
74 <td class="mid"> | |
3537
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
75 <div class="log-container"> |
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
76 <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> |
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
77 <div class="expand"><span class="expandtext">↓ ${_('Show more')} ↓</span></div> |
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
78 <div class="extra-container"> |
3538
9bf927589f7a
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3537
diff
changeset
|
79 %if c.comments.get(cs.raw_id,[]): |
1884
0614862a20ec
Added number of comments in changelog for each changeset
Marcin Kuzminski <marcin@python-works.com>
parents:
1882
diff
changeset
|
80 <div class="comments-container"> |
1885 | 81 <div class="comments-cnt" title="${('comments')}"> |
3538
9bf927589f7a
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3537
diff
changeset
|
82 <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)}"> |
9bf927589f7a
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3537
diff
changeset
|
83 ${len(c.comments[cs.raw_id])} |
9bf927589f7a
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3537
diff
changeset
|
84 </a> |
1885 | 85 </div> |
1884
0614862a20ec
Added number of comments in changelog for each changeset
Marcin Kuzminski <marcin@python-works.com>
parents:
1882
diff
changeset
|
86 </div> |
3537
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
87 %endif |
3541
8fae93880c30
fixed bookmarks error on git
Marcin Kuzminski <marcin@python-works.com>
parents:
3540
diff
changeset
|
88 %if h.is_hg(c.rhodecode_repo): |
3544 | 89 %for book in cs.bookmarks: |
90 <div class="bookbook" title="${'%s %s' % (_('bookmark'),book)}"> | |
91 ${h.link_to(h.shorter(book),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} | |
92 </div> | |
93 %endfor | |
3541
8fae93880c30
fixed bookmarks error on git
Marcin Kuzminski <marcin@python-works.com>
parents:
3540
diff
changeset
|
94 %endif |
3537
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
95 %for tag in cs.tags: |
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
96 <div class="tagtag" title="${'%s %s' % (_('tag'),tag)}"> |
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
97 ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} |
3197 | 98 </div> |
99 %endfor | |
3538
9bf927589f7a
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3537
diff
changeset
|
100 %if (not c.branch_name) and cs.branch: |
9bf927589f7a
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3537
diff
changeset
|
101 <div class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}"> |
9bf927589f7a
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3537
diff
changeset
|
102 ${h.link_to(h.shorter(cs.branch),h.url('changelog_home',repo_name=c.repo_name,branch=cs.branch))} |
3537
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
103 </div> |
3197 | 104 %endif |
3536 | 105 </div> |
3537
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
106 </div> |
3536 | 107 </td> |
108 </tr> | |
3197 | 109 %endfor |
3536 | 110 </tbody> |
111 </table> | |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
112 |
3536 | 113 |
3197 | 114 <div class="pagination-wh pagination-left"> |
115 ${c.pagination.pager('$link_previous ~2~ $link_next')} | |
116 </div> | |
117 </div> | |
3536 | 118 </div> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
119 |
3536 | 120 <script type="text/javascript" src="${h.url('/js/graph.js')}"></script> |
121 <script type="text/javascript"> | |
122 YAHOO.util.Event.onDOMReady(function(){ | |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
123 |
3536 | 124 //Monitor range checkboxes and build a link to changesets |
125 //ranges | |
126 var checkboxes = YUD.getElementsByClassName('changeset_range'); | |
127 var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}"; | |
128 var pr_tmpl = "${h.url('pullrequest_home',repo_name=c.repo_name)}"; | |
3464
d253f1b530c8
Bugfix: On the changelog page, its possible that some changeset is already checked out by the browser. So we check for that on page load.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3463
diff
changeset
|
129 |
d253f1b530c8
Bugfix: On the changelog page, its possible that some changeset is already checked out by the browser. So we check for that on page load.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3463
diff
changeset
|
130 var checkbox_checker = function(e){ |
3536 | 131 var checked_checkboxes = []; |
132 for (pos in checkboxes){ | |
133 if(checkboxes[pos].checked){ | |
134 checked_checkboxes.push(checkboxes[pos]); | |
977
28524453bb76
started work on #93 added rev ranges view, checkboxes in changelog to view ranges of changes
Marcin Kuzminski <marcin@python-works.com>
parents:
904
diff
changeset
|
135 } |
3536 | 136 } |
137 if(YUD.get('open_new_pr')){ | |
3519
d249fec283ae
changelog: fix page state after clearing selection
Mads Kiilerich <madski@unity3d.com>
parents:
3486
diff
changeset
|
138 if(checked_checkboxes.length>1){ |
3485
b19b1723ff10
pullrequest: pullrequest from changelog view
Mads Kiilerich <madski@unity3d.com>
parents:
3465
diff
changeset
|
139 YUD.setStyle('open_new_pr','display','none'); |
b19b1723ff10
pullrequest: pullrequest from changelog view
Mads Kiilerich <madski@unity3d.com>
parents:
3465
diff
changeset
|
140 } else { |
b19b1723ff10
pullrequest: pullrequest from changelog view
Mads Kiilerich <madski@unity3d.com>
parents:
3465
diff
changeset
|
141 YUD.setStyle('open_new_pr','display',''); |
b19b1723ff10
pullrequest: pullrequest from changelog view
Mads Kiilerich <madski@unity3d.com>
parents:
3465
diff
changeset
|
142 if(checked_checkboxes.length>0){ |
b19b1723ff10
pullrequest: pullrequest from changelog view
Mads Kiilerich <madski@unity3d.com>
parents:
3465
diff
changeset
|
143 YUD.get('open_new_pr').innerHTML = _TM['Open new pull request for selected changesets']; |
b19b1723ff10
pullrequest: pullrequest from changelog view
Mads Kiilerich <madski@unity3d.com>
parents:
3465
diff
changeset
|
144 }else{ |
b19b1723ff10
pullrequest: pullrequest from changelog view
Mads Kiilerich <madski@unity3d.com>
parents:
3465
diff
changeset
|
145 YUD.get('open_new_pr').innerHTML = _TM['Open new pull request']; |
b19b1723ff10
pullrequest: pullrequest from changelog view
Mads Kiilerich <madski@unity3d.com>
parents:
3465
diff
changeset
|
146 } |
2996
ebe3e388bbb3
new patch function, and urls schema.
Marcin Kuzminski <marcin@python-works.com>
parents:
2973
diff
changeset
|
147 } |
2927
58bb350bfef8
Don't allow cherry picking changesets from the changelog using checkboxes.
Marcin Kuzminski <marcin@python-works.com>
parents:
2924
diff
changeset
|
148 } |
2973
9937afa7f093
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2934
diff
changeset
|
149 |
3536 | 150 if(checked_checkboxes.length>0){ |
151 var rev_end = checked_checkboxes[0].name; | |
152 var rev_start = checked_checkboxes[checked_checkboxes.length-1].name; | |
153 var url = url_tmpl.replace('__REVRANGE__', | |
154 rev_start+'...'+rev_end); | |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
155 |
3536 | 156 var link = (rev_start == rev_end) |
157 ? _TM['Show selected change __S'] | |
158 : _TM['Show selected changes __S -> __E']; | |
3447
e74557f57f76
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3446
diff
changeset
|
159 |
3536 | 160 link = link.replace('__S',rev_start.substr(0,6)); |
161 link = link.replace('__E',rev_end.substr(0,6)); | |
162 YUD.get('rev_range_container').href = url; | |
163 YUD.get('rev_range_container').innerHTML = link; | |
164 YUD.setStyle('rev_range_container','display',''); | |
165 YUD.setStyle('rev_range_clear','display',''); | |
2973
9937afa7f093
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2934
diff
changeset
|
166 |
3536 | 167 YUD.get('open_new_pr').href = pr_tmpl + '?rev_start={0}&rev_end={1}'.format(rev_start,rev_end); |
3465
df05806e8a2d
changelog: "compare fork with parent" should only be shown when no changesets selected
Mads Kiilerich <madski@unity3d.com>
parents:
3464
diff
changeset
|
168 YUD.setStyle('compare_fork','display','none'); |
3536 | 169 } else{ |
170 YUD.setStyle('rev_range_container','display','none'); | |
171 YUD.setStyle('rev_range_clear','display','none'); | |
3520
bd7c217003cf
changelog: let 'Open new pull request' use the currently topmost changeset
Mads Kiilerich <madski@unity3d.com>
parents:
3519
diff
changeset
|
172 if (checkboxes){ |
bd7c217003cf
changelog: let 'Open new pull request' use the currently topmost changeset
Mads Kiilerich <madski@unity3d.com>
parents:
3519
diff
changeset
|
173 YUD.get('open_new_pr').href = pr_tmpl + '?rev_end={0}'.format(checkboxes[0].name); |
bd7c217003cf
changelog: let 'Open new pull request' use the currently topmost changeset
Mads Kiilerich <madski@unity3d.com>
parents:
3519
diff
changeset
|
174 } |
3465
df05806e8a2d
changelog: "compare fork with parent" should only be shown when no changesets selected
Mads Kiilerich <madski@unity3d.com>
parents:
3464
diff
changeset
|
175 YUD.setStyle('compare_fork','display',''); |
977
28524453bb76
started work on #93 added rev ranges view, checkboxes in changelog to view ranges of changes
Marcin Kuzminski <marcin@python-works.com>
parents:
904
diff
changeset
|
176 } |
3464
d253f1b530c8
Bugfix: On the changelog page, its possible that some changeset is already checked out by the browser. So we check for that on page load.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3463
diff
changeset
|
177 }; |
d253f1b530c8
Bugfix: On the changelog page, its possible that some changeset is already checked out by the browser. So we check for that on page load.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3463
diff
changeset
|
178 YUE.onDOMReady(checkbox_checker); |
d253f1b530c8
Bugfix: On the changelog page, its possible that some changeset is already checked out by the browser. So we check for that on page load.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3463
diff
changeset
|
179 YUE.on(checkboxes,'click', checkbox_checker); |
d253f1b530c8
Bugfix: On the changelog page, its possible that some changeset is already checked out by the browser. So we check for that on page load.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3463
diff
changeset
|
180 |
3536 | 181 YUE.on('rev_range_clear','click',function(e){ |
182 for (var i=0; i<checkboxes.length; i++){ | |
183 var cb = checkboxes[i]; | |
184 cb.checked = false; | |
185 } | |
3519
d249fec283ae
changelog: fix page state after clearing selection
Mads Kiilerich <madski@unity3d.com>
parents:
3486
diff
changeset
|
186 checkbox_checker(); |
3536 | 187 YUE.preventDefault(e); |
188 }); | |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
189 |
3536 | 190 var msgs = YUQ('.message'); |
191 // get first element height | |
192 var el = YUQ('#graph_content .container')[0]; | |
193 var row_h = el.clientHeight; | |
194 for(var i=0;i<msgs.length;i++){ | |
195 var m = msgs[i]; | |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
196 |
3536 | 197 var h = m.clientHeight; |
198 var pad = YUD.getStyle(m,'padding'); | |
199 if(h > row_h){ | |
200 var offset = row_h - (h+12); | |
201 YUD.setStyle(m.nextElementSibling,'display','block'); | |
202 YUD.setStyle(m.nextElementSibling,'margin-top',offset+'px'); | |
3197 | 203 }; |
3536 | 204 } |
205 YUE.on(YUQ('.expand'),'click',function(e){ | |
206 var elem = e.currentTarget.parentNode.parentNode; | |
207 YUD.setStyle(e.currentTarget,'display','none'); | |
208 YUD.setStyle(elem,'height','auto'); | |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
209 |
3536 | 210 //redraw the graph, line_count and jsdata are global vars |
3197 | 211 set_canvas(100); |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
212 |
3197 | 213 var r = new BranchRenderer(); |
214 r.render(jsdata,100,line_count); | |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
215 |
3197 | 216 }); |
3536 | 217 |
218 // change branch filter | |
219 YUE.on(YUD.get('branch_filter'),'change',function(e){ | |
220 var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value; | |
221 var url_main = "${h.url('changelog_home',repo_name=c.repo_name)}"; | |
222 var url = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}"; | |
223 var url = url.replace('__BRANCH__',selected_branch); | |
224 if(selected_branch != ''){ | |
225 window.location = url; | |
226 }else{ | |
227 window.location = url_main; | |
228 } | |
229 | |
230 }); | |
231 | |
232 function set_canvas(width) { | |
233 var c = document.getElementById('graph_nodes'); | |
234 var t = document.getElementById('graph_content'); | |
235 canvas = document.getElementById('graph_canvas'); | |
236 var div_h = t.clientHeight; | |
237 //c.style.height=div_h+'px'; | |
238 canvas.setAttribute('height',div_h); | |
239 //c.style.height=width+'px'; | |
240 canvas.setAttribute('width',width); | |
241 }; | |
242 var heads = 1; | |
243 var line_count = 0; | |
244 var jsdata = ${c.jsdata|n}; | |
245 | |
246 for (var i=0;i<jsdata.length;i++) { | |
247 var in_l = jsdata[i][2]; | |
248 for (var j in in_l) { | |
249 var m = in_l[j][1]; | |
250 if (m > line_count) | |
251 line_count = m; | |
252 } | |
253 } | |
254 set_canvas(100); | |
255 | |
256 var r = new BranchRenderer(); | |
257 r.render(jsdata,100,line_count); | |
258 | |
259 }); | |
260 </script> | |
3197 | 261 %else: |
262 ${_('There are no changes yet')} | |
263 %endif | |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
264 </div> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
265 </div> |
1865 | 266 </%def> |