Mercurial > kallithea
annotate rhodecode/templates/changelog/changelog.html @ 4076:c7e656e96c5d
Use review status labels in changelog view
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 02 Jul 2013 00:10:52 +0200 |
parents | 458fd829aa20 |
children | ffd45b185016 |
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()"> |
3761
087b50ef7e17
changelog for file history shows that we're in different changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
3760
diff
changeset
|
6 ${_('%s Changelog') % c.repo_name} · |
087b50ef7e17
changelog for file history shows that we're in different changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
3760
diff
changeset
|
7 %if c.changelog_for_path: |
087b50ef7e17
changelog for file history shows that we're in different changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
3760
diff
changeset
|
8 /${c.changelog_for_path} · |
087b50ef7e17
changelog for file history shows that we're in different changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
3760
diff
changeset
|
9 %endif |
087b50ef7e17
changelog for file history shows that we're in different changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
3760
diff
changeset
|
10 ${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
|
11 </%def> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
12 |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
13 <%def name="breadcrumbs_links()"> |
2312
f6d57d055d1e
Improved i18n on changelog and user group administration pages.
Vincent Duvert <vincent@duvert.net>
parents:
2269
diff
changeset
|
14 <% size = c.size if c.size <= c.total_cs else c.total_cs %> |
3761
087b50ef7e17
changelog for file history shows that we're in different changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
3760
diff
changeset
|
15 ${_('Changelog')} |
087b50ef7e17
changelog for file history shows that we're in different changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
3760
diff
changeset
|
16 %if c.changelog_for_path: |
087b50ef7e17
changelog for file history shows that we're in different changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
3760
diff
changeset
|
17 - /${c.changelog_for_path} |
087b50ef7e17
changelog for file history shows that we're in different changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
3760
diff
changeset
|
18 %endif |
087b50ef7e17
changelog for file history shows that we're in different changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
3760
diff
changeset
|
19 - ${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
|
20 </%def> |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
21 |
143
787689980bcd
Tempaltes changes for changelog and shortlog, changed menu generation in base
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
22 <%def name="page_nav()"> |
3603
eacd33e0c5b3
use valid options for the top menu: repositories, journal, search and admin
Mads Kiilerich <madski@unity3d.com>
parents:
3592
diff
changeset
|
23 ${self.menu('repositories')} |
143
787689980bcd
Tempaltes changes for changelog and shortlog, changed menu generation in base
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
24 </%def> |
787689980bcd
Tempaltes changes for changelog and shortlog, changed menu generation in base
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
25 |
787689980bcd
Tempaltes changes for changelog and shortlog, changed menu generation in base
Marcin Kuzminski <marcin@python-works.com>
parents:
diff
changeset
|
26 <%def name="main()"> |
3988
072a37c44f58
templates: drop context_bar, use repo_context_bar directly
Mads Kiilerich <madski@unity3d.com>
parents:
3979
diff
changeset
|
27 ${self.repo_context_bar('changelog')} |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
28 <div class="box"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
29 <!-- box / title --> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
30 <div class="title"> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
31 ${self.breadcrumbs()} |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
32 </div> |
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
33 <div class="table"> |
3197 | 34 % if c.pagination: |
35 <div id="graph"> | |
3760
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
36 <div style="display:${'none' if c.changelog_for_path else ''}"> |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
37 <div class="info_box" style="clear: both;padding: 10px 6px;min-height: 12px;text-align: right;"> |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
38 <a href="#" class="ui-btn small" id="rev_range_container" style="display:none"></a> |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
39 <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
|
40 |
3760
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
41 %if c.rhodecode_db_repo.fork: |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
42 <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> |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
43 %endif |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
44 %if h.is_hg(c.rhodecode_repo): |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
45 <a id="open_new_pr" href="${h.url('pullrequest_home',repo_name=c.repo_name)}" class="ui-btn small">${_('Open new pull request')}</a> |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
46 %endif |
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
|
47 </div> |
3760
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
48 <div class="container_header"> |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
49 ${h.form(h.url.current(),method='get')} |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
50 <div style="float:left"> |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
51 ${h.submit('set',_('Show'),class_="ui-btn")} |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
52 ${h.text('size',size=1,value=c.size)} |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
53 ${_('revisions')} |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
54 </div> |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
55 ${h.end_form()} |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
56 <div style="float:right">${h.select('branch_filter',c.branch_name,c.branch_filters)}</div> |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
57 </div> |
3536 | 58 </div> |
59 <div id="graph_nodes"> | |
60 <canvas id="graph_canvas"></canvas> | |
61 </div> | |
62 <div id="graph_content"> | |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
63 |
3536 | 64 <table id="changesets"> |
65 <tbody> | |
3197 | 66 %for cnt,cs in enumerate(c.pagination): |
3536 | 67 <tr id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}"> |
68 <td class="checkbox"> | |
3760
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
69 %if c.changelog_for_path: |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
70 ${h.checkbox(cs.raw_id,class_="changeset_range", disabled="disabled")} |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
71 %else: |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
72 ${h.checkbox(cs.raw_id,class_="changeset_range")} |
6302a1423a4e
Use changelog controller for displaying history of files.
Marcin Kuzminski <marcin@python-works.com>
parents:
3707
diff
changeset
|
73 %endif |
3688
6c505fe11f0f
bring back review status in main changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
3654
diff
changeset
|
74 <td class="status"> |
6c505fe11f0f
bring back review status in main changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
3654
diff
changeset
|
75 %if c.statuses.get(cs.raw_id): |
6c505fe11f0f
bring back review status in main changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
3654
diff
changeset
|
76 <div class="changeset-status-ico"> |
6c505fe11f0f
bring back review status in main changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
3654
diff
changeset
|
77 %if c.statuses.get(cs.raw_id)[2]: |
4076
c7e656e96c5d
Use review status labels in changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
4056
diff
changeset
|
78 <a class="tooltip" title="${_('Changeset status: %s\nClick to open associated pull request #%s') % (h.changeset_status_lbl(c.statuses.get(cs.raw_id)[0]), 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])}"> |
3688
6c505fe11f0f
bring back review status in main changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
3654
diff
changeset
|
79 <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" /> |
6c505fe11f0f
bring back review status in main changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
3654
diff
changeset
|
80 </a> |
6c505fe11f0f
bring back review status in main changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
3654
diff
changeset
|
81 %else: |
4076
c7e656e96c5d
Use review status labels in changelog view
Marcin Kuzminski <marcin@python-works.com>
parents:
4056
diff
changeset
|
82 <a class="tooltip" title="${_('Changeset status: %s') % h.changeset_status_lbl(c.statuses.get(cs.raw_id)[0])}" 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)}"> |
4056
458fd829aa20
pull requests: add a 'Changeset status' comment on changeset status
Mads Kiilerich <madski@unity3d.com>
parents:
3992
diff
changeset
|
83 <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" /> |
458fd829aa20
pull requests: add a 'Changeset status' comment on changeset status
Mads Kiilerich <madski@unity3d.com>
parents:
3992
diff
changeset
|
84 </a> |
3688
6c505fe11f0f
bring back review status in main changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
3654
diff
changeset
|
85 %endif |
6c505fe11f0f
bring back review status in main changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
3654
diff
changeset
|
86 </div> |
6c505fe11f0f
bring back review status in main changelog
Marcin Kuzminski <marcin@python-works.com>
parents:
3654
diff
changeset
|
87 %endif |
3536 | 88 </td> |
89 <td class="author"> | |
90 <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(cs.author),16)}"/> | |
91 <span title="${cs.author}" class="user">${h.shorter(h.person(cs.author),22)}</span> | |
92 </td> | |
3585
acc264c649d6
adjust the width on changelog based on the show_id function output
Marcin Kuzminski <marcin@python-works.com>
parents:
3582
diff
changeset
|
93 <td class="hash" style="width:${len(h.show_id(cs))*6.5}px"> |
3538
9bf927589f7a
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3537
diff
changeset
|
94 <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"> |
3557
58dcef7eef03
Implemented show_id function that is a configurable way to display sha hashes in the changelog.
Marcin Kuzminski <marcin@python-works.com>
parents:
3552
diff
changeset
|
95 <span class="changeset_hash">${h.show_id(cs)}</span> |
3538
9bf927589f7a
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3537
diff
changeset
|
96 </a> |
3536 | 97 </td> |
98 <td class="date"> | |
99 <div class="date">${h.age(cs.date,True)}</div> | |
100 </td> | |
101 <td class="mid"> | |
3537
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
102 <div class="log-container"> |
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
103 <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
|
104 <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
|
105 <div class="extra-container"> |
3765
5a8918aba869
show comments in summary changelog overview
Marcin Kuzminski <marcin@python-works.com>
parents:
3761
diff
changeset
|
106 %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
|
107 <div class="comments-container"> |
4056
458fd829aa20
pull requests: add a 'Changeset status' comment on changeset status
Mads Kiilerich <madski@unity3d.com>
parents:
3992
diff
changeset
|
108 <div class="comments-cnt" title="${_('Changeset has comments')}"> |
3538
9bf927589f7a
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3537
diff
changeset
|
109 <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
|
110 ${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
|
111 </a> |
1885 | 112 </div> |
1884
0614862a20ec
Added number of comments in changelog for each changeset
Marcin Kuzminski <marcin@python-works.com>
parents:
1882
diff
changeset
|
113 </div> |
3537
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
114 %endif |
3541
8fae93880c30
fixed bookmarks error on git
Marcin Kuzminski <marcin@python-works.com>
parents:
3540
diff
changeset
|
115 %if h.is_hg(c.rhodecode_repo): |
3544 | 116 %for book in cs.bookmarks: |
3707
93de03499097
shortlog: show all refs (bookmarks,tags,branches) in one dedicated column
Marcin Kuzminski <marcin@python-works.com>
parents:
3688
diff
changeset
|
117 <div class="booktag" title="${_('Bookmark %s') % book}"> |
3544 | 118 ${h.link_to(h.shorter(book),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} |
119 </div> | |
120 %endfor | |
3541
8fae93880c30
fixed bookmarks error on git
Marcin Kuzminski <marcin@python-works.com>
parents:
3540
diff
changeset
|
121 %endif |
3537
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
122 %for tag in cs.tags: |
3654
ec6354949623
Fix a lot of casings - use standard casing in most places
Mads Kiilerich <madski@unity3d.com>
parents:
3603
diff
changeset
|
123 <div class="tagtag" title="${_('Tag %s') % tag}"> |
3537
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
124 ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} |
3197 | 125 </div> |
126 %endfor | |
3538
9bf927589f7a
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3537
diff
changeset
|
127 %if (not c.branch_name) and cs.branch: |
3654
ec6354949623
Fix a lot of casings - use standard casing in most places
Mads Kiilerich <madski@unity3d.com>
parents:
3603
diff
changeset
|
128 <div class="branchtag" title="${_('Branch %s' % cs.branch)}"> |
3538
9bf927589f7a
Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents:
3537
diff
changeset
|
129 ${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
|
130 </div> |
3197 | 131 %endif |
3536 | 132 </div> |
3537
7f8d349bbde4
Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents:
3536
diff
changeset
|
133 </div> |
3536 | 134 </td> |
135 </tr> | |
3197 | 136 %endfor |
3536 | 137 </tbody> |
138 </table> | |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
139 |
3197 | 140 <div class="pagination-wh pagination-left"> |
141 ${c.pagination.pager('$link_previous ~2~ $link_next')} | |
142 </div> | |
143 </div> | |
3536 | 144 </div> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
145 |
3536 | 146 <script type="text/javascript" src="${h.url('/js/graph.js')}"></script> |
147 <script type="text/javascript"> | |
148 YAHOO.util.Event.onDOMReady(function(){ | |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
149 |
3536 | 150 //Monitor range checkboxes and build a link to changesets |
151 //ranges | |
152 var checkboxes = YUD.getElementsByClassName('changeset_range'); | |
3979
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
153 // register our routes needed for this view |
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
154 pyroutes.register('changeset_home', "${h.url('changeset_home', repo_name='%(repo_name)s', revision='%(revision)s')}", ['repo_name', 'revision']); |
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
155 pyroutes.register('changelog_home', "${h.url('changelog_home', repo_name='%(repo_name)s')}", ['repo_name']); |
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
156 pyroutes.register('pullrequest_home', "${h.url('pullrequest_home', repo_name='%(repo_name)s')}", ['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
|
157 |
3552
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
158 var checkbox_checker = function(e){ |
3536 | 159 var checked_checkboxes = []; |
160 for (pos in checkboxes){ | |
161 if(checkboxes[pos].checked){ | |
162 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
|
163 } |
3536 | 164 } |
165 if(YUD.get('open_new_pr')){ | |
3552
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
166 if(checked_checkboxes.length>1){ |
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
167 YUD.setStyle('open_new_pr','display','none'); |
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
168 } else { |
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
169 YUD.setStyle('open_new_pr','display',''); |
3485
b19b1723ff10
pullrequest: pullrequest from changelog view
Mads Kiilerich <madski@unity3d.com>
parents:
3465
diff
changeset
|
170 if(checked_checkboxes.length>0){ |
3552
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
171 YUD.get('open_new_pr').innerHTML = _TM['Open new pull request for selected changesets']; |
3485
b19b1723ff10
pullrequest: pullrequest from changelog view
Mads Kiilerich <madski@unity3d.com>
parents:
3465
diff
changeset
|
172 }else{ |
3552
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
173 YUD.get('open_new_pr').innerHTML = _TM['Open new pull request']; |
3485
b19b1723ff10
pullrequest: pullrequest from changelog view
Mads Kiilerich <madski@unity3d.com>
parents:
3465
diff
changeset
|
174 } |
2927
58bb350bfef8
Don't allow cherry picking changesets from the changelog using checkboxes.
Marcin Kuzminski <marcin@python-works.com>
parents:
2924
diff
changeset
|
175 } |
3552
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
176 } |
2973
9937afa7f093
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2934
diff
changeset
|
177 |
3536 | 178 if(checked_checkboxes.length>0){ |
179 var rev_end = checked_checkboxes[0].name; | |
180 var rev_start = checked_checkboxes[checked_checkboxes.length-1].name; | |
3979
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
181 var url = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}', |
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
182 'revision': rev_start+'...'+rev_end}); |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
183 |
3536 | 184 var link = (rev_start == rev_end) |
3592
549c73bfc206
changelog / compare: adjust titles
Mads Kiilerich <madski@unity3d.com>
parents:
3585
diff
changeset
|
185 ? _TM['Show selected changeset __S'] |
549c73bfc206
changelog / compare: adjust titles
Mads Kiilerich <madski@unity3d.com>
parents:
3585
diff
changeset
|
186 : _TM['Show selected changesets __S -> __E']; |
3447
e74557f57f76
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
3446
diff
changeset
|
187 |
3536 | 188 link = link.replace('__S',rev_start.substr(0,6)); |
189 link = link.replace('__E',rev_end.substr(0,6)); | |
190 YUD.get('rev_range_container').href = url; | |
191 YUD.get('rev_range_container').innerHTML = link; | |
192 YUD.setStyle('rev_range_container','display',''); | |
193 YUD.setStyle('rev_range_clear','display',''); | |
2973
9937afa7f093
whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
2934
diff
changeset
|
194 |
3979
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
195 YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home', |
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
196 {'repo_name': '${c.repo_name}', |
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
197 'rev_start': rev_start, |
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
198 'rev_end': rev_end}) |
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
199 |
3552
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
200 YUD.setStyle('compare_fork','display','none'); |
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
201 }else{ |
3536 | 202 YUD.setStyle('rev_range_container','display','none'); |
203 YUD.setStyle('rev_range_clear','display','none'); | |
3813
dca89d578c70
pull requests: use branch name when creating PRs from a changelog with branch filter
Mads Kiilerich <madski@unity3d.com>
parents:
3810
diff
changeset
|
204 %if c.branch_name: |
3979
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
205 YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home', |
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
206 {'repo_name': '${c.repo_name}', |
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
207 'branch':'${c.branch_name}'}); |
3813
dca89d578c70
pull requests: use branch name when creating PRs from a changelog with branch filter
Mads Kiilerich <madski@unity3d.com>
parents:
3810
diff
changeset
|
208 %else: |
3979
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
209 YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home', |
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
210 {'repo_name': '${c.repo_name}'}); |
3813
dca89d578c70
pull requests: use branch name when creating PRs from a changelog with branch filter
Mads Kiilerich <madski@unity3d.com>
parents:
3810
diff
changeset
|
211 %endif |
3552
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
212 YUD.setStyle('compare_fork','display',''); |
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
213 } |
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
214 }; |
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
215 YUE.onDOMReady(checkbox_checker); |
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
216 YUE.on(checkboxes,'click', checkbox_checker); |
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
|
217 |
3536 | 218 YUE.on('rev_range_clear','click',function(e){ |
219 for (var i=0; i<checkboxes.length; i++){ | |
220 var cb = checkboxes[i]; | |
221 cb.checked = false; | |
222 } | |
3552
7967d00e4692
Stylistic cleanup - mostly formatting
Mads Kiilerich <madski@unity3d.com>
parents:
3550
diff
changeset
|
223 checkbox_checker(); |
3536 | 224 YUE.preventDefault(e); |
225 }); | |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
226 |
3536 | 227 var msgs = YUQ('.message'); |
228 // get first element height | |
229 var el = YUQ('#graph_content .container')[0]; | |
230 var row_h = el.clientHeight; | |
231 for(var i=0;i<msgs.length;i++){ | |
232 var m = msgs[i]; | |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
233 |
3536 | 234 var h = m.clientHeight; |
235 var pad = YUD.getStyle(m,'padding'); | |
236 if(h > row_h){ | |
237 var offset = row_h - (h+12); | |
238 YUD.setStyle(m.nextElementSibling,'display','block'); | |
239 YUD.setStyle(m.nextElementSibling,'margin-top',offset+'px'); | |
3197 | 240 }; |
3536 | 241 } |
242 YUE.on(YUQ('.expand'),'click',function(e){ | |
243 var elem = e.currentTarget.parentNode.parentNode; | |
244 YUD.setStyle(e.currentTarget,'display','none'); | |
245 YUD.setStyle(elem,'height','auto'); | |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
246 |
3536 | 247 //redraw the graph, line_count and jsdata are global vars |
3197 | 248 set_canvas(100); |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
249 |
3197 | 250 var r = new BranchRenderer(); |
251 r.render(jsdata,100,line_count); | |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
252 |
3197 | 253 }); |
3536 | 254 |
255 // change branch filter | |
256 YUE.on(YUD.get('branch_filter'),'change',function(e){ | |
257 var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value; | |
258 if(selected_branch != ''){ | |
3979
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
259 window.location = pyroutes.url('changelog_home', {'repo_name': '${c.repo_name}', |
3992
c1a1f05e680f
removed encodeURIComponent, on url generation.
Marcin Kuzminski <marcin@python-works.com>
parents:
3988
diff
changeset
|
260 'branch':selected_branch}); |
3536 | 261 }else{ |
3979
04242759b61e
fixed issue with formatting escaping on url used in changelog js.
Marcin Kuzminski <marcin@python-works.com>
parents:
3960
diff
changeset
|
262 window.location = pyroutes.url('changelog_home', {'repo_name': '${c.repo_name}'}); |
3536 | 263 } |
264 }); | |
265 | |
266 function set_canvas(width) { | |
267 var c = document.getElementById('graph_nodes'); | |
268 var t = document.getElementById('graph_content'); | |
269 canvas = document.getElementById('graph_canvas'); | |
270 var div_h = t.clientHeight; | |
271 canvas.setAttribute('height',div_h); | |
272 canvas.setAttribute('width',width); | |
273 }; | |
274 var heads = 1; | |
275 var line_count = 0; | |
276 var jsdata = ${c.jsdata|n}; | |
277 | |
278 for (var i=0;i<jsdata.length;i++) { | |
279 var in_l = jsdata[i][2]; | |
280 for (var j in in_l) { | |
281 var m = in_l[j][1]; | |
282 if (m > line_count) | |
283 line_count = m; | |
284 } | |
285 } | |
286 set_canvas(100); | |
287 | |
288 var r = new BranchRenderer(); | |
289 r.render(jsdata,100,line_count); | |
290 | |
291 }); | |
292 </script> | |
3197 | 293 %else: |
294 ${_('There are no changes yet')} | |
295 %endif | |
362
558eb7c5028f
version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents:
322
diff
changeset
|
296 </div> |
1888
f91d3f9b7230
White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents:
1885
diff
changeset
|
297 </div> |
1865 | 298 </%def> |