annotate rhodecode/templates/changelog/changelog.html @ 3539:c65b440540da beta

Style clean up, and comments removal.
author Leonardo Carneiro <leonardo@unity3d.com>
date Mon, 11 Mar 2013 16:43:41 +0100
parents 9bf927589f7a
children 6e8027c2f49c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
9e677f6d34cb Fixing missing icons.
Leonardo <leo@unity3d.com>
parents: 3531
diff changeset
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
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
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
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
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
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
26 % if c.pagination:
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
27 <div id="graph">
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
28 <div class="info_box" style="clear: both;padding: 10px 6px;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:
3445
246ab6d8a0f3 changelog: improve texts and functionality regarding selecting changesets
Mads Kiilerich <madski@unity3d.com>
parents: 3434
diff changeset
33 <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>
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):
3445
246ab6d8a0f3 changelog: improve texts and functionality regarding selecting changesets
Mads Kiilerich <madski@unity3d.com>
parents: 3434
diff changeset
36 <a id="open_new_pr" href="${h.url('pullrequest_form',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
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
38 </div>
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
39 <div class="container_header">
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
40 ${h.form(h.url.current(),method='get')}
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
41 <div style="float:left">
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
42 ${h.submit('set',_('Show'),class_="ui-btn")}
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
43 ${h.text('size',size=1,value=c.size)}
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
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
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
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
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
48 </div>
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
49 <div id="graph_nodes">
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
50 <canvas id="graph_canvas"></canvas>
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
51 </div>
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
52 <div id="graph_content">
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1885
diff changeset
53
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
54 <table id="changesets">
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
55 <tbody>
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
56 %for cnt,cs in enumerate(c.pagination):
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
57 <tr id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}">
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
58 <td class="checkbox">
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
59 ${h.checkbox(cs.raw_id,class_="changeset_range")}
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
60 </td>
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
61 <td class="author">
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
62 <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(cs.author),16)}"/>
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
63 <span title="${cs.author}" class="user">${h.shorter(h.person(cs.author),22)}</span>
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
64 </td>
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
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)}">
9bf927589f7a Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents: 3537
diff changeset
67 <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
68 </a>
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
69 </td>
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
70 <td class="date">
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
71 <div class="date">${h.age(cs.date,True)}</div>
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
72 </td>
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
73 <td class="mid">
3537
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
74 <div class="log-container">
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
75 <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
76 <div class="expand"><span class="expandtext">&darr; ${_('Show more')} &darr;</span></div>
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
77 <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
78 %if c.comments.get(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
79 <div class="comments-container">
9bf927589f7a Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents: 3537
diff changeset
80 <div class="comments-cnt" title="${('comments')}">
9bf927589f7a Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents: 3537
diff changeset
81 <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
82 ${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
83 </a>
9bf927589f7a Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents: 3537
diff changeset
84 </div>
3537
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
85 </div>
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
86 %endif
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
87 %for book in cs.bookmarks:
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
88 <div class="bookbook" title="${'%s %s' % (_('bookmark'),book)}">
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
89 ${h.link_to(h.shorter(book),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
90 </div>
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
91
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
92 %endfor
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
93 %for tag in cs.tags:
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
94 <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
95 ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
96 </div>
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
97 %endfor
3538
9bf927589f7a Tweaks to Changelog and Summary view, removing excess information, and improving layout.
Leonardo Carneiro <leonardo@unity3d.com>
parents: 3537
diff changeset
98 %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
99 <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
100 ${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
101 </div>
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
102 %endif
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
103 </div>
3537
7f8d349bbde4 Tweaks to Changelog view, removing excess information, and improving layout.
Leonardo <leo@unity3d.com>
parents: 3536
diff changeset
104 </div>
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
105 </td>
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
106 </tr>
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
107 %endfor
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
108 </tbody>
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
109 </table>
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
110
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
111
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
112 <div class="pagination-wh pagination-left">
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
113 ${c.pagination.pager('$link_previous ~2~ $link_next')}
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
114 </div>
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
115 </div>
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
116 </div>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1885
diff changeset
117
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
118 <script type="text/javascript" src="${h.url('/js/graph.js')}"></script>
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
119 <script type="text/javascript">
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
120 YAHOO.util.Event.onDOMReady(function(){
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1885
diff changeset
121
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
122 //Monitor range checkboxes and build a link to changesets
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
123 //ranges
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
124 var checkboxes = YUD.getElementsByClassName('changeset_range');
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
125 var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}";
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
126 var pr_tmpl = "${h.url('pullrequest_home',repo_name=c.repo_name)}";
3539
c65b440540da Style clean up, and comments removal.
Leonardo Carneiro <leonardo@unity3d.com>
parents: 3538
diff changeset
127
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
128 var checkbox_checker = function(e){
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
129 var clicked_cb = e.currentTarget;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
130 var checked_checkboxes = [];
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
131 for (pos in checkboxes){
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
132 if(checkboxes[pos].checked){
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
133 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
134 }
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
135 }
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
136 if(YUD.get('open_new_pr')){
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
137 if(checked_checkboxes.length>0){
2996
ebe3e388bbb3 new patch function, and urls schema.
Marcin Kuzminski <marcin@python-works.com>
parents: 2973
diff changeset
138 // modify open pull request to show we have selected cs
ebe3e388bbb3 new patch function, and urls schema.
Marcin Kuzminski <marcin@python-works.com>
parents: 2973
diff changeset
139 YUD.get('open_new_pr').innerHTML = _TM['Open new pull request for selected changesets'];
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
140 }else{
2996
ebe3e388bbb3 new patch function, and urls schema.
Marcin Kuzminski <marcin@python-works.com>
parents: 2973
diff changeset
141 YUD.get('open_new_pr').innerHTML = _TM['Open new pull request'];
2924
fcbcef60be02 graph: fix counting of "heads" for graph, condense graph into more narrow lines instead of trying to increase its width (past certain width produces really bad html layout)
Aras Pranckevicius <aras@unity3d.com>
parents: 2885
diff changeset
142 }
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
143 }
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
144
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
145 if(checked_checkboxes.length>0){
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
146 var rev_end = checked_checkboxes[0].name;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
147 var rev_start = checked_checkboxes[checked_checkboxes.length-1].name;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
148 var url = url_tmpl.replace('__REVRANGE__',
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
149 rev_start+'...'+rev_end);
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
150
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
151 var link = (rev_start == rev_end)
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
152 ? _TM['Show selected change __S']
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
153 : _TM['Show selected changes __S -> __E'];
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
154
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
155 link = link.replace('__S',rev_start.substr(0,6));
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
156 link = link.replace('__E',rev_end.substr(0,6));
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
157 YUD.get('rev_range_container').href = url;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
158 YUD.get('rev_range_container').innerHTML = link;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
159 YUD.setStyle('rev_range_container','display','');
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
160 YUD.setStyle('rev_range_clear','display','');
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
161
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
162 YUD.get('open_new_pr').href = pr_tmpl + '?rev_start={0}&rev_end={1}'.format(rev_start,rev_end);
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
163
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
164 } else{
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
165 YUD.setStyle('rev_range_container','display','none');
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
166 YUD.setStyle('rev_range_clear','display','none');
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
167 }
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
168 };
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
169 YUE.onDOMReady(checkbox_checker);
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
170 YUE.on(checkboxes,'click', checkbox_checker);
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
171
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
172 YUE.on('rev_range_clear','click',function(e){
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
173 for (var i=0; i<checkboxes.length; i++){
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
174 var cb = checkboxes[i];
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
175 cb.checked = false;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
176 }
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
177 YUE.preventDefault(e);
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
178 });
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
179
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
180 var msgs = YUQ('.message');
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
181 // get first element height
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
182 var el = YUQ('#graph_content .container')[0];
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
183 var row_h = el.clientHeight;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
184 for(var i=0;i<msgs.length;i++){
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
185 var m = msgs[i];
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
186
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
187 var h = m.clientHeight;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
188 var pad = YUD.getStyle(m,'padding');
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
189 if(h > row_h){
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
190 var offset = row_h - (h+12);
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
191 YUD.setStyle(m.nextElementSibling,'display','block');
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
192 YUD.setStyle(m.nextElementSibling,'margin-top',offset+'px');
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
193 };
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
194 }
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
195 YUE.on(YUQ('.expand'),'click',function(e){
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
196 var elem = e.currentTarget.parentNode.parentNode;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
197 YUD.setStyle(e.currentTarget,'display','none');
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
198 YUD.setStyle(elem,'height','auto');
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
199
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
200 //redraw the graph, line_count and jsdata are global vars
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
201 set_canvas(100);
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1885
diff changeset
202
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
203 var r = new BranchRenderer();
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
204 r.render(jsdata,100,line_count);
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1885
diff changeset
205
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
206 });
3536
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
207
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
208 // change branch filter
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
209 YUE.on(YUD.get('branch_filter'),'change',function(e){
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
210 var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
211 var url_main = "${h.url('changelog_home',repo_name=c.repo_name)}";
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
212 var url = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}";
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
213 var url = url.replace('__BRANCH__',selected_branch);
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
214 if(selected_branch != ''){
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
215 window.location = url;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
216 }else{
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
217 window.location = url_main;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
218 }
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
219
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
220 });
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
221
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
222 function set_canvas(width) {
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
223 var c = document.getElementById('graph_nodes');
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
224 var t = document.getElementById('graph_content');
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
225 canvas = document.getElementById('graph_canvas');
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
226 var div_h = t.clientHeight;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
227 //c.style.height=div_h+'px';
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
228 canvas.setAttribute('height',div_h);
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
229 //c.style.height=width+'px';
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
230 canvas.setAttribute('width',width);
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
231 };
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
232 var heads = 1;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
233 var line_count = 0;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
234 var jsdata = ${c.jsdata|n};
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
235
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
236 for (var i=0;i<jsdata.length;i++) {
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
237 var in_l = jsdata[i][2];
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
238 for (var j in in_l) {
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
239 var m = in_l[j][1];
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
240 if (m > line_count)
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
241 line_count = m;
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
242 }
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
243 }
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
244 set_canvas(100);
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
245
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
246 var r = new BranchRenderer();
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
247 r.render(jsdata,100,line_count);
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
248
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
249 });
ed48d17836a4 WIP: Changelog view
Leonardo <leo@unity3d.com>
parents: 3532
diff changeset
250 </script>
3197
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
251 %else:
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
252 ${_('There are no changes yet')}
b4f401524060 html: don't use tabs
Mads Kiilerich <madski@unity3d.com>
parents: 3188
diff changeset
253 %endif
362
558eb7c5028f version bump to 0.8
Marcin Kuzminski <marcin@python-works.com>
parents: 322
diff changeset
254 </div>
1888
f91d3f9b7230 White-space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 1885
diff changeset
255 </div>
1865
37b3c3244bbc UI fixes
Marcin Kuzminski <marcin@python-works.com>
parents: 1862
diff changeset
256 </%def>