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