Show More
@@ -1,313 +1,314 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | <%inherit file="/base/base.mako"/> |
|
3 | <%inherit file="/base/base.mako"/> | |
4 |
|
4 | |||
5 | <%def name="title()"> |
|
5 | <%def name="title()"> | |
6 | ${_('%s Changelog') % c.repo_name} |
|
6 | ${_('%s Changelog') % c.repo_name} | |
7 | %if c.changelog_for_path: |
|
7 | %if c.changelog_for_path: | |
8 | /${c.changelog_for_path} |
|
8 | /${c.changelog_for_path} | |
9 | %endif |
|
9 | %endif | |
10 | %if c.rhodecode_name: |
|
10 | %if c.rhodecode_name: | |
11 | · ${h.branding(c.rhodecode_name)} |
|
11 | · ${h.branding(c.rhodecode_name)} | |
12 | %endif |
|
12 | %endif | |
13 | </%def> |
|
13 | </%def> | |
14 |
|
14 | |||
15 | <%def name="breadcrumbs_links()"> |
|
15 | <%def name="breadcrumbs_links()"> | |
16 | %if c.changelog_for_path: |
|
16 | %if c.changelog_for_path: | |
17 | /${c.changelog_for_path} |
|
17 | /${c.changelog_for_path} | |
18 | %endif |
|
18 | %endif | |
19 | </%def> |
|
19 | </%def> | |
20 |
|
20 | |||
21 | <%def name="menu_bar_nav()"> |
|
21 | <%def name="menu_bar_nav()"> | |
22 | ${self.menu_items(active='repositories')} |
|
22 | ${self.menu_items(active='repositories')} | |
23 | </%def> |
|
23 | </%def> | |
24 |
|
24 | |||
25 | <%def name="menu_bar_subnav()"> |
|
25 | <%def name="menu_bar_subnav()"> | |
26 | ${self.repo_menu(active='changelog')} |
|
26 | ${self.repo_menu(active='changelog')} | |
27 | </%def> |
|
27 | </%def> | |
28 |
|
28 | |||
29 | <%def name="main()"> |
|
29 | <%def name="main()"> | |
30 |
|
30 | |||
31 | <div class="box"> |
|
31 | <div class="box"> | |
32 | <div class="title"> |
|
32 | <div class="title"> | |
33 | <ul class="links"> |
|
33 | <ul class="links"> | |
34 | <li> |
|
34 | <li> | |
35 | <a href="#" class="btn btn-small" id="rev_range_container" style="display:none;"></a> |
|
35 | <a href="#" class="btn btn-small" id="rev_range_container" style="display:none;"></a> | |
36 | %if c.rhodecode_db_repo.fork: |
|
36 | %if c.rhodecode_db_repo.fork: | |
37 | <span> |
|
37 | <span> | |
38 | <a id="compare_fork_button" |
|
38 | <a id="compare_fork_button" | |
39 | title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}" |
|
39 | title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}" | |
40 | class="btn btn-small" |
|
40 | class="btn btn-small" | |
41 | href="${h.route_path('repo_compare', |
|
41 | href="${h.route_path('repo_compare', | |
42 | repo_name=c.rhodecode_db_repo.fork.repo_name, |
|
42 | repo_name=c.rhodecode_db_repo.fork.repo_name, | |
43 | source_ref_type=c.rhodecode_db_repo.landing_rev[0], |
|
43 | source_ref_type=c.rhodecode_db_repo.landing_rev[0], | |
44 | source_ref=c.rhodecode_db_repo.landing_rev[1], |
|
44 | source_ref=c.rhodecode_db_repo.landing_rev[1], | |
45 | target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0], |
|
45 | target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0], | |
46 | target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], |
|
46 | target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], | |
47 | _query=dict(merge=1, target_repo=c.repo_name))}" |
|
47 | _query=dict(merge=1, target_repo=c.repo_name))}" | |
48 | > |
|
48 | > | |
49 | ${_('Compare fork with Parent (%s)' % c.rhodecode_db_repo.fork.repo_name)} |
|
49 | ${_('Compare fork with Parent (%s)' % c.rhodecode_db_repo.fork.repo_name)} | |
50 | </a> |
|
50 | </a> | |
51 | </span> |
|
51 | </span> | |
52 | %endif |
|
52 | %endif | |
53 |
|
53 | |||
54 | ## pr open link |
|
54 | ## pr open link | |
55 | %if h.is_hg(c.rhodecode_repo) or h.is_git(c.rhodecode_repo): |
|
55 | %if h.is_hg(c.rhodecode_repo) or h.is_git(c.rhodecode_repo): | |
56 | <span> |
|
56 | <span> | |
57 | <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}"> |
|
57 | <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}"> | |
58 | ${_('Open new pull request')} |
|
58 | ${_('Open new pull request')} | |
59 | </a> |
|
59 | </a> | |
60 | </span> |
|
60 | </span> | |
61 | %endif |
|
61 | %endif | |
62 |
|
62 | |||
63 | ## clear selection |
|
63 | ## clear selection | |
64 | <div title="${_('Clear selection')}" class="btn" id="rev_range_clear" style="display:none"> |
|
64 | <div title="${_('Clear selection')}" class="btn" id="rev_range_clear" style="display:none"> | |
65 | ${_('Clear selection')} |
|
65 | ${_('Clear selection')} | |
66 | </div> |
|
66 | </div> | |
67 |
|
67 | |||
68 | </li> |
|
68 | </li> | |
69 | </ul> |
|
69 | </ul> | |
70 | </div> |
|
70 | </div> | |
71 |
|
71 | |||
72 | % if c.pagination: |
|
72 | % if c.pagination: | |
73 | <script type="text/javascript" src="${h.asset('js/src/plugins/jquery.commits-graph.js')}"></script> |
|
73 | <script type="text/javascript" src="${h.asset('js/src/plugins/jquery.commits-graph.js')}"></script> | |
74 |
|
74 | |||
75 | <div class="graph-header"> |
|
75 | <div class="graph-header"> | |
76 | <div id="filter_changelog"> |
|
76 | <div id="filter_changelog"> | |
77 | ${h.hidden('branch_filter')} |
|
77 | ${h.hidden('branch_filter')} | |
78 | %if c.selected_name: |
|
78 | %if c.selected_name: | |
79 | <div class="btn btn-default" id="clear_filter" > |
|
79 | <div class="btn btn-default" id="clear_filter" > | |
80 | ${_('Clear filter')} |
|
80 | ${_('Clear filter')} | |
81 | </div> |
|
81 | </div> | |
82 | %endif |
|
82 | %endif | |
83 | </div> |
|
83 | </div> | |
84 | ${self.breadcrumbs('breadcrumbs_light')} |
|
84 | ${self.breadcrumbs('breadcrumbs_light')} | |
85 | <div class="pull-right"> |
|
85 | <div class="pull-right"> | |
86 | % if h.is_hg(c.rhodecode_repo): |
|
86 | % if h.is_hg(c.rhodecode_repo): | |
87 | % if c.show_hidden: |
|
87 | % if c.show_hidden: | |
88 | <a class="action-link" href="${h.current_route_path(request, evolve=0)}">${_('Hide obsolete/hidden')}</a> |
|
88 | <a class="action-link" href="${h.current_route_path(request, evolve=0)}">${_('Hide obsolete/hidden')}</a> | |
89 | % else: |
|
89 | % else: | |
90 | <a class="action-link" href="${h.current_route_path(request, evolve=1)}">${_('Show obsolete/hidden')}</a> |
|
90 | <a class="action-link" href="${h.current_route_path(request, evolve=1)}">${_('Show obsolete/hidden')}</a> | |
91 | % endif |
|
91 | % endif | |
92 | % else: |
|
92 | % else: | |
93 | <span class="action-link disabled">${_('Show hidden')}</span> |
|
93 | <span class="action-link disabled">${_('Show hidden')}</span> | |
94 | % endif |
|
94 | % endif | |
95 | </div> |
|
95 | </div> | |
96 | <div id="commit-counter" data-total=${c.total_cs} class="pull-right"> |
|
96 | <div id="commit-counter" data-total=${c.total_cs} class="pull-right"> | |
97 | ${_ungettext('showing %d out of %d commit', 'showing %d out of %d commits', c.showing_commits) % (c.showing_commits, c.total_cs)} |
|
97 | ${_ungettext('showing %d out of %d commit', 'showing %d out of %d commits', c.showing_commits) % (c.showing_commits, c.total_cs)} | |
98 | </div> |
|
98 | </div> | |
99 | </div> |
|
99 | </div> | |
100 |
|
100 | |||
101 | <div id="graph"> |
|
101 | <div id="graph"> | |
102 | <div class="graph-col-wrapper"> |
|
102 | <div class="graph-col-wrapper"> | |
103 | <div id="graph_nodes"> |
|
103 | <div id="graph_nodes"> | |
104 | <div id="graph_canvas"></div> |
|
104 | <div id="graph_canvas"></div> | |
105 | </div> |
|
105 | </div> | |
106 | <div id="graph_content" class="main-content graph_full_width"> |
|
106 | <div id="graph_content" class="main-content graph_full_width"> | |
107 |
|
107 | |||
108 | <div class="table"> |
|
108 | <div class="table"> | |
109 | <table id="changesets" class="rctable"> |
|
109 | <table id="changesets" class="rctable"> | |
110 | <tr> |
|
110 | <tr> | |
111 | ## checkbox |
|
111 | ## checkbox | |
112 | <th></th> |
|
112 | <th></th> | |
113 |
<th |
|
113 | <th></th> | |
114 |
|
114 | |||
115 | <th>${_('Commit')}</th> |
|
115 | <th>${_('Commit')}</th> | |
116 | ## Mercurial phase/evolve state |
|
116 | ||
117 | <th></th> |
|
|||
118 | ## commit message expand arrow |
|
117 | ## commit message expand arrow | |
119 | <th></th> |
|
118 | <th></th> | |
120 | <th>${_('Commit Message')}</th> |
|
119 | <th>${_('Commit Message')}</th> | |
121 |
|
120 | |||
122 | <th>${_('Age')}</th> |
|
121 | <th>${_('Age')}</th> | |
123 | <th>${_('Author')}</th> |
|
122 | <th>${_('Author')}</th> | |
124 |
|
123 | |||
125 | <th>${_('Refs')}</th> |
|
124 | <th>${_('Refs')}</th> | |
|
125 | ## comments | |||
|
126 | <th></th> | |||
126 | </tr> |
|
127 | </tr> | |
127 |
|
128 | |||
128 | <tbody class="commits-range"> |
|
129 | <tbody class="commits-range"> | |
129 | <%include file='changelog_elements.mako'/> |
|
130 | <%include file='changelog_elements.mako'/> | |
130 | </tbody> |
|
131 | </tbody> | |
131 | </table> |
|
132 | </table> | |
132 | </div> |
|
133 | </div> | |
133 | </div> |
|
134 | </div> | |
134 | <div class="pagination-wh pagination-left"> |
|
135 | <div class="pagination-wh pagination-left"> | |
135 | ${c.pagination.pager('$link_previous ~2~ $link_next')} |
|
136 | ${c.pagination.pager('$link_previous ~2~ $link_next')} | |
136 | </div> |
|
137 | </div> | |
137 | </div> |
|
138 | </div> | |
138 |
|
139 | |||
139 | <script type="text/javascript"> |
|
140 | <script type="text/javascript"> | |
140 | var cache = {}; |
|
141 | var cache = {}; | |
141 | $(function(){ |
|
142 | $(function(){ | |
142 |
|
143 | |||
143 | // Create links to commit ranges when range checkboxes are selected |
|
144 | // Create links to commit ranges when range checkboxes are selected | |
144 | var $commitCheckboxes = $('.commit-range'); |
|
145 | var $commitCheckboxes = $('.commit-range'); | |
145 | // cache elements |
|
146 | // cache elements | |
146 | var $commitRangeContainer = $('#rev_range_container'); |
|
147 | var $commitRangeContainer = $('#rev_range_container'); | |
147 | var $commitRangeClear = $('#rev_range_clear'); |
|
148 | var $commitRangeClear = $('#rev_range_clear'); | |
148 |
|
149 | |||
149 | var checkboxRangeSelector = function(e){ |
|
150 | var checkboxRangeSelector = function(e){ | |
150 | var selectedCheckboxes = []; |
|
151 | var selectedCheckboxes = []; | |
151 | for (pos in $commitCheckboxes){ |
|
152 | for (pos in $commitCheckboxes){ | |
152 | if($commitCheckboxes[pos].checked){ |
|
153 | if($commitCheckboxes[pos].checked){ | |
153 | selectedCheckboxes.push($commitCheckboxes[pos]); |
|
154 | selectedCheckboxes.push($commitCheckboxes[pos]); | |
154 | } |
|
155 | } | |
155 | } |
|
156 | } | |
156 | var open_new_pull_request = $('#open_new_pull_request'); |
|
157 | var open_new_pull_request = $('#open_new_pull_request'); | |
157 | if(open_new_pull_request){ |
|
158 | if(open_new_pull_request){ | |
158 | var selected_changes = selectedCheckboxes.length; |
|
159 | var selected_changes = selectedCheckboxes.length; | |
159 | if (selected_changes > 1 || selected_changes == 1 && templateContext.repo_type == 'svn') { |
|
160 | if (selected_changes > 1 || selected_changes == 1 && templateContext.repo_type == 'svn') { | |
160 | open_new_pull_request.hide(); |
|
161 | open_new_pull_request.hide(); | |
161 | } else { |
|
162 | } else { | |
162 | if (selected_changes == 1) { |
|
163 | if (selected_changes == 1) { | |
163 | open_new_pull_request.html(_gettext('Open new pull request for selected commit')); |
|
164 | open_new_pull_request.html(_gettext('Open new pull request for selected commit')); | |
164 | } else if (selected_changes == 0) { |
|
165 | } else if (selected_changes == 0) { | |
165 | open_new_pull_request.html(_gettext('Open new pull request')); |
|
166 | open_new_pull_request.html(_gettext('Open new pull request')); | |
166 | } |
|
167 | } | |
167 | open_new_pull_request.show(); |
|
168 | open_new_pull_request.show(); | |
168 | } |
|
169 | } | |
169 | } |
|
170 | } | |
170 |
|
171 | |||
171 | if (selectedCheckboxes.length>0){ |
|
172 | if (selectedCheckboxes.length>0){ | |
172 | var revEnd = selectedCheckboxes[0].name; |
|
173 | var revEnd = selectedCheckboxes[0].name; | |
173 | var revStart = selectedCheckboxes[selectedCheckboxes.length-1].name; |
|
174 | var revStart = selectedCheckboxes[selectedCheckboxes.length-1].name; | |
174 | var url = pyroutes.url('repo_commit', |
|
175 | var url = pyroutes.url('repo_commit', | |
175 | {'repo_name': '${c.repo_name}', |
|
176 | {'repo_name': '${c.repo_name}', | |
176 | 'commit_id': revStart+'...'+revEnd}); |
|
177 | 'commit_id': revStart+'...'+revEnd}); | |
177 |
|
178 | |||
178 | var link = (revStart == revEnd) |
|
179 | var link = (revStart == revEnd) | |
179 | ? _gettext('Show selected commit __S') |
|
180 | ? _gettext('Show selected commit __S') | |
180 | : _gettext('Show selected commits __S ... __E'); |
|
181 | : _gettext('Show selected commits __S ... __E'); | |
181 |
|
182 | |||
182 | link = link.replace('__S', revStart.substr(0,6)); |
|
183 | link = link.replace('__S', revStart.substr(0,6)); | |
183 | link = link.replace('__E', revEnd.substr(0,6)); |
|
184 | link = link.replace('__E', revEnd.substr(0,6)); | |
184 |
|
185 | |||
185 | $commitRangeContainer |
|
186 | $commitRangeContainer | |
186 | .attr('href',url) |
|
187 | .attr('href',url) | |
187 | .html(link) |
|
188 | .html(link) | |
188 | .show(); |
|
189 | .show(); | |
189 |
|
190 | |||
190 | $commitRangeClear.show(); |
|
191 | $commitRangeClear.show(); | |
191 | var _url = pyroutes.url('pullrequest_new', |
|
192 | var _url = pyroutes.url('pullrequest_new', | |
192 | {'repo_name': '${c.repo_name}', |
|
193 | {'repo_name': '${c.repo_name}', | |
193 | 'commit': revEnd}); |
|
194 | 'commit': revEnd}); | |
194 | open_new_pull_request.attr('href', _url); |
|
195 | open_new_pull_request.attr('href', _url); | |
195 | $('#compare_fork_button').hide(); |
|
196 | $('#compare_fork_button').hide(); | |
196 | } else { |
|
197 | } else { | |
197 | $commitRangeContainer.hide(); |
|
198 | $commitRangeContainer.hide(); | |
198 | $commitRangeClear.hide(); |
|
199 | $commitRangeClear.hide(); | |
199 |
|
200 | |||
200 | %if c.branch_name: |
|
201 | %if c.branch_name: | |
201 | var _url = pyroutes.url('pullrequest_new', |
|
202 | var _url = pyroutes.url('pullrequest_new', | |
202 | {'repo_name': '${c.repo_name}', |
|
203 | {'repo_name': '${c.repo_name}', | |
203 | 'branch':'${c.branch_name}'}); |
|
204 | 'branch':'${c.branch_name}'}); | |
204 | open_new_pull_request.attr('href', _url); |
|
205 | open_new_pull_request.attr('href', _url); | |
205 | %else: |
|
206 | %else: | |
206 | var _url = pyroutes.url('pullrequest_new', |
|
207 | var _url = pyroutes.url('pullrequest_new', | |
207 | {'repo_name': '${c.repo_name}'}); |
|
208 | {'repo_name': '${c.repo_name}'}); | |
208 | open_new_pull_request.attr('href', _url); |
|
209 | open_new_pull_request.attr('href', _url); | |
209 | %endif |
|
210 | %endif | |
210 | $('#compare_fork_button').show(); |
|
211 | $('#compare_fork_button').show(); | |
211 | } |
|
212 | } | |
212 | }; |
|
213 | }; | |
213 |
|
214 | |||
214 | $commitCheckboxes.on('click', checkboxRangeSelector); |
|
215 | $commitCheckboxes.on('click', checkboxRangeSelector); | |
215 |
|
216 | |||
216 | $commitRangeClear.on('click',function(e) { |
|
217 | $commitRangeClear.on('click',function(e) { | |
217 | $commitCheckboxes.attr('checked', false); |
|
218 | $commitCheckboxes.attr('checked', false); | |
218 | checkboxRangeSelector(); |
|
219 | checkboxRangeSelector(); | |
219 | e.preventDefault(); |
|
220 | e.preventDefault(); | |
220 | }); |
|
221 | }); | |
221 |
|
222 | |||
222 | // make sure the buttons are consistent when navigate back and forth |
|
223 | // make sure the buttons are consistent when navigate back and forth | |
223 | checkboxRangeSelector(); |
|
224 | checkboxRangeSelector(); | |
224 |
|
225 | |||
225 | var msgs = $('.message'); |
|
226 | var msgs = $('.message'); | |
226 | // get first element height |
|
227 | // get first element height | |
227 | var el = $('#graph_content .container')[0]; |
|
228 | var el = $('#graph_content .container')[0]; | |
228 | var row_h = el.clientHeight; |
|
229 | var row_h = el.clientHeight; | |
229 | for (var i=0; i < msgs.length; i++) { |
|
230 | for (var i=0; i < msgs.length; i++) { | |
230 | var m = msgs[i]; |
|
231 | var m = msgs[i]; | |
231 |
|
232 | |||
232 | var h = m.clientHeight; |
|
233 | var h = m.clientHeight; | |
233 | var pad = $(m).css('padding'); |
|
234 | var pad = $(m).css('padding'); | |
234 | if (h > row_h) { |
|
235 | if (h > row_h) { | |
235 | var offset = row_h - (h+12); |
|
236 | var offset = row_h - (h+12); | |
236 | $(m.nextElementSibling).css('display','block'); |
|
237 | $(m.nextElementSibling).css('display','block'); | |
237 | $(m.nextElementSibling).css('margin-top',offset+'px'); |
|
238 | $(m.nextElementSibling).css('margin-top',offset+'px'); | |
238 | } |
|
239 | } | |
239 | } |
|
240 | } | |
240 |
|
241 | |||
241 | $("#clear_filter").on("click", function() { |
|
242 | $("#clear_filter").on("click", function() { | |
242 | var filter = {'repo_name': '${c.repo_name}'}; |
|
243 | var filter = {'repo_name': '${c.repo_name}'}; | |
243 | window.location = pyroutes.url('repo_changelog', filter); |
|
244 | window.location = pyroutes.url('repo_changelog', filter); | |
244 | }); |
|
245 | }); | |
245 |
|
246 | |||
246 | $("#branch_filter").select2({ |
|
247 | $("#branch_filter").select2({ | |
247 | 'dropdownAutoWidth': true, |
|
248 | 'dropdownAutoWidth': true, | |
248 | 'width': 'resolve', |
|
249 | 'width': 'resolve', | |
249 | 'placeholder': "${c.selected_name or _('Filter changelog')}", |
|
250 | 'placeholder': "${c.selected_name or _('Filter changelog')}", | |
250 | containerCssClass: "drop-menu", |
|
251 | containerCssClass: "drop-menu", | |
251 | dropdownCssClass: "drop-menu-dropdown", |
|
252 | dropdownCssClass: "drop-menu-dropdown", | |
252 | query: function(query){ |
|
253 | query: function(query){ | |
253 | var key = 'cache'; |
|
254 | var key = 'cache'; | |
254 | var cached = cache[key] ; |
|
255 | var cached = cache[key] ; | |
255 | if(cached) { |
|
256 | if(cached) { | |
256 | var data = {results: []}; |
|
257 | var data = {results: []}; | |
257 | //filter results |
|
258 | //filter results | |
258 | $.each(cached.results, function(){ |
|
259 | $.each(cached.results, function(){ | |
259 | var section = this.text; |
|
260 | var section = this.text; | |
260 | var children = []; |
|
261 | var children = []; | |
261 | $.each(this.children, function(){ |
|
262 | $.each(this.children, function(){ | |
262 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ |
|
263 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ | |
263 | children.push({'id': this.id, 'text': this.text, 'type': this.type}) |
|
264 | children.push({'id': this.id, 'text': this.text, 'type': this.type}) | |
264 | } |
|
265 | } | |
265 | }); |
|
266 | }); | |
266 | data.results.push({'text': section, 'children': children}); |
|
267 | data.results.push({'text': section, 'children': children}); | |
267 | query.callback({results: data.results}); |
|
268 | query.callback({results: data.results}); | |
268 | }); |
|
269 | }); | |
269 | }else{ |
|
270 | }else{ | |
270 | $.ajax({ |
|
271 | $.ajax({ | |
271 | url: pyroutes.url('repo_refs_changelog_data', {'repo_name': '${c.repo_name}'}), |
|
272 | url: pyroutes.url('repo_refs_changelog_data', {'repo_name': '${c.repo_name}'}), | |
272 | data: {}, |
|
273 | data: {}, | |
273 | dataType: 'json', |
|
274 | dataType: 'json', | |
274 | type: 'GET', |
|
275 | type: 'GET', | |
275 | success: function(data) { |
|
276 | success: function(data) { | |
276 | cache[key] = data; |
|
277 | cache[key] = data; | |
277 | query.callback({results: data.results}); |
|
278 | query.callback({results: data.results}); | |
278 | } |
|
279 | } | |
279 | }) |
|
280 | }) | |
280 | } |
|
281 | } | |
281 | } |
|
282 | } | |
282 | }); |
|
283 | }); | |
283 | $('#branch_filter').on('change', function(e){ |
|
284 | $('#branch_filter').on('change', function(e){ | |
284 | var data = $('#branch_filter').select2('data'); |
|
285 | var data = $('#branch_filter').select2('data'); | |
285 | //type: branch_closed |
|
286 | //type: branch_closed | |
286 | var selected = data.text; |
|
287 | var selected = data.text; | |
287 | var filter = {'repo_name': '${c.repo_name}'}; |
|
288 | var filter = {'repo_name': '${c.repo_name}'}; | |
288 | if(data.type == 'branch' || data.type == 'branch_closed'){ |
|
289 | if(data.type == 'branch' || data.type == 'branch_closed'){ | |
289 | filter["branch"] = selected; |
|
290 | filter["branch"] = selected; | |
290 | if (data.type == 'branch_closed') { |
|
291 | if (data.type == 'branch_closed') { | |
291 | filter["evolve"] = '1'; |
|
292 | filter["evolve"] = '1'; | |
292 | } |
|
293 | } | |
293 | } |
|
294 | } | |
294 | else if (data.type == 'book'){ |
|
295 | else if (data.type == 'book'){ | |
295 | filter["bookmark"] = selected; |
|
296 | filter["bookmark"] = selected; | |
296 | } |
|
297 | } | |
297 | window.location = pyroutes.url('repo_changelog', filter); |
|
298 | window.location = pyroutes.url('repo_changelog', filter); | |
298 | }); |
|
299 | }); | |
299 |
|
300 | |||
300 | commitsController = new CommitsController(); |
|
301 | commitsController = new CommitsController(); | |
301 | % if not c.changelog_for_path: |
|
302 | % if not c.changelog_for_path: | |
302 | commitsController.reloadGraph(); |
|
303 | commitsController.reloadGraph(); | |
303 | % endif |
|
304 | % endif | |
304 |
|
305 | |||
305 | }); |
|
306 | }); | |
306 |
|
307 | |||
307 | </script> |
|
308 | </script> | |
308 | </div> |
|
309 | </div> | |
309 | % else: |
|
310 | % else: | |
310 | ${_('There are no changes yet')} |
|
311 | ${_('There are no changes yet')} | |
311 | % endif |
|
312 | % endif | |
312 | </div> |
|
313 | </div> | |
313 | </%def> |
|
314 | </%def> |
@@ -1,149 +1,155 b'' | |||||
1 | ## small box that displays changed/added/removed details fetched by AJAX |
|
1 | ## small box that displays changed/added/removed details fetched by AJAX | |
2 | <%namespace name="base" file="/base/base.mako"/> |
|
2 | <%namespace name="base" file="/base/base.mako"/> | |
3 |
|
3 | |||
4 | % if c.prev_page: |
|
4 | % if c.prev_page: | |
5 | <tr> |
|
5 | <tr> | |
6 | <td colspan="9" class="load-more-commits"> |
|
6 | <td colspan="9" class="load-more-commits"> | |
7 | <a class="prev-commits" href="#loadPrevCommits" onclick="commitsController.loadPrev(this, ${c.prev_page}, '${c.branch_name}', '${c.commit_id}', '${c.f_path}');return false"> |
|
7 | <a class="prev-commits" href="#loadPrevCommits" onclick="commitsController.loadPrev(this, ${c.prev_page}, '${c.branch_name}', '${c.commit_id}', '${c.f_path}');return false"> | |
8 | ${_('load previous')} |
|
8 | ${_('load previous')} | |
9 | </a> |
|
9 | </a> | |
10 | </td> |
|
10 | </td> | |
11 | </tr> |
|
11 | </tr> | |
12 | % endif |
|
12 | % endif | |
13 |
|
13 | |||
14 | ## to speed up lookups cache some functions before the loop |
|
14 | ## to speed up lookups cache some functions before the loop | |
15 | <% |
|
15 | <% | |
16 | active_patterns = h.get_active_pattern_entries(c.repo_name) |
|
16 | active_patterns = h.get_active_pattern_entries(c.repo_name) | |
17 | urlify_commit_message = h.partial(h.urlify_commit_message, active_pattern_entries=active_patterns) |
|
17 | urlify_commit_message = h.partial(h.urlify_commit_message, active_pattern_entries=active_patterns) | |
18 | %> |
|
18 | %> | |
19 |
|
19 | |||
20 | % for cnt,commit in enumerate(c.pagination): |
|
20 | % for cnt,commit in enumerate(c.pagination): | |
21 | <tr id="sha_${commit.raw_id}" class="changelogRow container ${'tablerow%s' % (cnt%2)}"> |
|
21 | <tr id="sha_${commit.raw_id}" class="changelogRow container ${'tablerow%s' % (cnt%2)}"> | |
22 |
|
22 | |||
23 | <td class="td-checkbox"> |
|
23 | <td class="td-checkbox"> | |
24 | ${h.checkbox(commit.raw_id,class_="commit-range")} |
|
24 | ${h.checkbox(commit.raw_id,class_="commit-range")} | |
25 | </td> |
|
25 | </td> | |
|
26 | ||||
26 | <td class="td-status"> |
|
27 | <td class="td-status"> | |
27 |
|
||||
28 | %if c.statuses.get(commit.raw_id): |
|
28 | %if c.statuses.get(commit.raw_id): | |
29 | <div class="changeset-status-ico"> |
|
29 | <div class="changeset-status-ico"> | |
30 | %if c.statuses.get(commit.raw_id)[2]: |
|
30 | %if c.statuses.get(commit.raw_id)[2]: | |
31 | <a class="tooltip" title="${_('Commit status: %s\nClick to open associated pull request #%s') % (h.commit_status_lbl(c.statuses.get(commit.raw_id)[0]), c.statuses.get(commit.raw_id)[2])}" href="${h.route_path('pullrequest_show',repo_name=c.statuses.get(commit.raw_id)[3],pull_request_id=c.statuses.get(commit.raw_id)[2])}"> |
|
31 | <a class="tooltip" title="${_('Commit status: %s\nClick to open associated pull request #%s') % (h.commit_status_lbl(c.statuses.get(commit.raw_id)[0]), c.statuses.get(commit.raw_id)[2])}" href="${h.route_path('pullrequest_show',repo_name=c.statuses.get(commit.raw_id)[3],pull_request_id=c.statuses.get(commit.raw_id)[2])}"> | |
32 | <div class="${'flag_status {}'.format(c.statuses.get(commit.raw_id)[0])}"></div> |
|
32 | <div class="${'flag_status {}'.format(c.statuses.get(commit.raw_id)[0])}"></div> | |
33 | </a> |
|
33 | </a> | |
34 | %else: |
|
34 | %else: | |
35 | <a class="tooltip" title="${_('Commit status: {}').format(h.commit_status_lbl(c.statuses.get(commit.raw_id)[0]))}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id,_anchor='comment-%s' % c.comments[commit.raw_id][0].comment_id)}"> |
|
35 | <a class="tooltip" title="${_('Commit status: {}').format(h.commit_status_lbl(c.statuses.get(commit.raw_id)[0]))}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id,_anchor='comment-%s' % c.comments[commit.raw_id][0].comment_id)}"> | |
36 | <div class="${'flag_status {}'.format(c.statuses.get(commit.raw_id)[0])}"></div> |
|
36 | <div class="${'flag_status {}'.format(c.statuses.get(commit.raw_id)[0])}"></div> | |
37 | </a> |
|
37 | </a> | |
38 | %endif |
|
38 | %endif | |
39 | </div> |
|
39 | </div> | |
40 | %else: |
|
40 | %else: | |
41 | <div class="tooltip flag_status not_reviewed" title="${_('Commit status: Not Reviewed')}"></div> |
|
41 | <div class="tooltip flag_status not_reviewed" title="${_('Commit status: Not Reviewed')}"></div> | |
42 | %endif |
|
42 | %endif | |
43 | </td> |
|
43 | </td> | |
44 | <td class="td-comments comments-col"> |
|
44 | ||
45 | %if c.comments.get(commit.raw_id): |
|
|||
46 | <a title="${_('Commit has comments')}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id,_anchor='comment-%s' % c.comments[commit.raw_id][0].comment_id)}"> |
|
|||
47 | <i class="icon-comment"></i> ${len(c.comments[commit.raw_id])} |
|
|||
48 | </a> |
|
|||
49 | %endif |
|
|||
50 | </td> |
|
|||
51 | <td class="td-hash"> |
|
45 | <td class="td-hash"> | |
52 | <code> |
|
46 | <code> | |
53 |
|
47 | |||
54 | <a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id)}"> |
|
48 | <a href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id)}"> | |
55 | <span class="${'commit_hash obsolete' if getattr(commit, 'obsolete', None) else 'commit_hash'}">${h.show_id(commit)}</span> |
|
49 | <span class="${'commit_hash obsolete' if getattr(commit, 'obsolete', None) else 'commit_hash'}">${h.show_id(commit)}</span> | |
56 | </a> |
|
50 | </a> | |
|
51 | ||||
57 | <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${commit.raw_id}" title="${_('Copy the full commit id')}"></i> |
|
52 | <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${commit.raw_id}" title="${_('Copy the full commit id')}"></i> | |
58 | </code> |
|
53 | ||
59 | </td> |
|
54 | ## COMMIT PHASES | |
60 | <td class="td-tags tags-col"> |
|
55 | ||
61 |
## |
|
56 | ## Draft | |
62 | % if hasattr(commit, 'phase'): |
|
57 | % if hasattr(commit, 'phase'): | |
63 | % if commit.phase != 'public': |
|
58 | % if commit.phase != 'public': | |
64 |
<span class="tag phase-${commit.phase} tooltip" title="${_(' |
|
59 | <span class="tag phase-${commit.phase} tooltip" title="${_('{} commit phase').format(commit.phase)}">${commit.phase[0].upper()}</span> | |
65 | % endif |
|
60 | % endif | |
66 | % endif |
|
61 | % endif | |
67 |
|
62 | |||
68 | ## obsolete commits |
|
63 | ## obsolete commits | |
69 | % if hasattr(commit, 'obsolete'): |
|
64 | % if hasattr(commit, 'obsolete') and commit.obsolete: | |
70 | % if commit.obsolete: |
|
65 | <span class="tag obsolete-${commit.obsolete} tooltip" title="${_('Obsolete Evolve State')}">O</span> | |
71 | <span class="tag obsolete-${commit.obsolete} tooltip" title="${_('Evolve State')}">${_('obsolete')}</span> |
|
|||
72 | % endif |
|
|||
73 | % endif |
|
66 | % endif | |
74 |
|
67 | |||
75 | ## hidden commits |
|
68 | ## hidden commits | |
76 | % if hasattr(commit, 'hidden'): |
|
69 | % if hasattr(commit, 'hidden') and commit.hidden: | |
77 | % if commit.hidden: |
|
70 | <span class="tag obsolete-${commit.hidden} tooltip" title="${_('Hidden Evolve State')}">H</span> | |
78 | <span class="tag obsolete-${commit.hidden} tooltip" title="${_('Evolve State')}">${_('hidden')}</span> |
|
|||
79 | % endif |
|
|||
80 | % endif |
|
71 | % endif | |
|
72 | ||||
|
73 | </code> | |||
81 | </td> |
|
74 | </td> | |
|
75 | ||||
82 | <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_('Expand commit message')}" onclick="commitsController.expandCommit(this, true); return false"> |
|
76 | <td class="td-message expand_commit" data-commit-id="${commit.raw_id}" title="${_('Expand commit message')}" onclick="commitsController.expandCommit(this, true); return false"> | |
83 | <i class="icon-expand-linked"></i> |
|
77 | <i class="icon-expand-linked"></i> | |
84 | </td> |
|
78 | </td> | |
85 | <td class="td-description mid"> |
|
79 | <td class="td-description mid"> | |
86 | <div class="log-container truncate-wrap"> |
|
80 | <div class="log-container truncate-wrap"> | |
87 | <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}">${urlify_commit_message(commit.message, c.repo_name)}</div> |
|
81 | <div class="message truncate" id="c-${commit.raw_id}" data-message-raw="${commit.message}">${urlify_commit_message(commit.message, c.repo_name)}</div> | |
88 | </div> |
|
82 | </div> | |
89 | </td> |
|
83 | </td> | |
90 |
|
84 | |||
91 | <td class="td-time"> |
|
85 | <td class="td-time"> | |
92 | ${h.age_component(commit.date)} |
|
86 | ${h.age_component(commit.date)} | |
93 | </td> |
|
87 | </td> | |
94 | <td class="td-user"> |
|
88 | <td class="td-user"> | |
95 | ${base.gravatar_with_user(commit.author)} |
|
89 | ${base.gravatar_with_user(commit.author)} | |
96 | </td> |
|
90 | </td> | |
97 |
|
91 | |||
98 | <td class="td-tags tags-col"> |
|
92 | <td class="td-tags tags-col"> | |
99 | <div id="t-${commit.raw_id}"> |
|
93 | <div id="t-${commit.raw_id}"> | |
100 |
|
94 | |||
101 | ## merge |
|
95 | ## merge | |
102 | %if commit.merge: |
|
96 | %if commit.merge: | |
103 | <span class="tag mergetag"> |
|
97 | <span class="tag mergetag"> | |
104 | <i class="icon-merge"></i>${_('merge')} |
|
98 | <i class="icon-merge"></i>${_('merge')} | |
105 | </span> |
|
99 | </span> | |
106 | %endif |
|
100 | %endif | |
107 |
|
101 | |||
108 | ## branch |
|
102 | ## branch | |
109 | %if commit.branch: |
|
103 | %if commit.branch: | |
110 | <span class="tag branchtag" title="${h.tooltip(_('Branch %s') % commit.branch)}"> |
|
104 | <span class="tag branchtag" title="${h.tooltip(_('Branch %s') % commit.branch)}"> | |
111 | <a href="${h.route_path('repo_changelog',repo_name=c.repo_name,_query=dict(branch=commit.branch))}"><i class="icon-code-fork"></i>${h.shorter(commit.branch)}</a> |
|
105 | <a href="${h.route_path('repo_changelog',repo_name=c.repo_name,_query=dict(branch=commit.branch))}"><i class="icon-code-fork"></i>${h.shorter(commit.branch)}</a> | |
112 | </span> |
|
106 | </span> | |
113 | %endif |
|
107 | %endif | |
114 |
|
108 | |||
115 | ## bookmarks |
|
109 | ## bookmarks | |
116 | %if h.is_hg(c.rhodecode_repo): |
|
110 | %if h.is_hg(c.rhodecode_repo): | |
117 | %for book in commit.bookmarks: |
|
111 | %for book in commit.bookmarks: | |
118 | <span class="tag booktag" title="${h.tooltip(_('Bookmark %s') % book)}"> |
|
112 | <span class="tag booktag" title="${h.tooltip(_('Bookmark %s') % book)}"> | |
119 | <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=commit.raw_id, _query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a> |
|
113 | <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=commit.raw_id, _query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a> | |
120 | </span> |
|
114 | </span> | |
121 | %endfor |
|
115 | %endfor | |
122 | %endif |
|
116 | %endif | |
123 |
|
117 | |||
124 | ## tags |
|
118 | ## tags | |
125 | %for tag in commit.tags: |
|
119 | %for tag in commit.tags: | |
126 | <span class="tag tagtag" title="${h.tooltip(_('Tag %s') % tag)}"> |
|
120 | <span class="tag tagtag" title="${h.tooltip(_('Tag %s') % tag)}"> | |
127 | <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=commit.raw_id, _query=dict(at=tag))}"><i class="icon-tag"></i>${h.shorter(tag)}</a> |
|
121 | <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=commit.raw_id, _query=dict(at=tag))}"><i class="icon-tag"></i>${h.shorter(tag)}</a> | |
128 | </span> |
|
122 | </span> | |
129 | %endfor |
|
123 | %endfor | |
130 |
|
124 | |||
131 | </div> |
|
125 | </div> | |
132 | </td> |
|
126 | </td> | |
|
127 | ||||
|
128 | <td class="td-comments comments-col"> | |||
|
129 | <% cs_comments = c.comments.get(commit.raw_id,[]) %> | |||
|
130 | % if cs_comments: | |||
|
131 | <a title="${_('Commit has comments')}" href="${h.route_path('repo_commit',repo_name=c.repo_name,commit_id=commit.raw_id,_anchor='comment-%s' % cs_comments[0].comment_id)}"> | |||
|
132 | <i class="icon-comment"></i> ${len(cs_comments)} | |||
|
133 | </a> | |||
|
134 | % else: | |||
|
135 | <i class="icon-comment"></i> ${len(cs_comments)} | |||
|
136 | % endif | |||
|
137 | </td> | |||
|
138 | ||||
133 | </tr> |
|
139 | </tr> | |
134 | % endfor |
|
140 | % endfor | |
135 |
|
141 | |||
136 | % if c.next_page: |
|
142 | % if c.next_page: | |
137 | <tr> |
|
143 | <tr> | |
138 | <td colspan="10" class="load-more-commits"> |
|
144 | <td colspan="10" class="load-more-commits"> | |
139 | <a class="next-commits" href="#loadNextCommits" onclick="commitsController.loadNext(this, ${c.next_page}, '${c.branch_name}', '${c.commit_id}', '${c.f_path}');return false"> |
|
145 | <a class="next-commits" href="#loadNextCommits" onclick="commitsController.loadNext(this, ${c.next_page}, '${c.branch_name}', '${c.commit_id}', '${c.f_path}');return false"> | |
140 | ${_('load next')} |
|
146 | ${_('load next')} | |
141 | </a> |
|
147 | </a> | |
142 | </td> |
|
148 | </td> | |
143 | </tr> |
|
149 | </tr> | |
144 | % endif |
|
150 | % endif | |
145 | <tr class="chunk-graph-data" style="display:none" |
|
151 | <tr class="chunk-graph-data" style="display:none" | |
146 | data-graph='${c.graph_data|n}' |
|
152 | data-graph='${c.graph_data|n}' | |
147 | data-node='${c.prev_page}:${c.next_page}' |
|
153 | data-node='${c.prev_page}:${c.next_page}' | |
148 | data-commits='${c.graph_commits|n}'> |
|
154 | data-commits='${c.graph_commits|n}'> | |
149 | </tr> No newline at end of file |
|
155 | </tr> |
General Comments 0
You need to be logged in to leave comments.
Login now