Show More
@@ -1,314 +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 | ${self.repo_page_title(c.rhodecode_db_repo)} |
|
33 | ${self.repo_page_title(c.rhodecode_db_repo)} | |
34 | <ul class="links"> |
|
34 | <ul class="links"> | |
35 | <li> |
|
35 | <li> | |
36 | <a href="#" class="btn btn-small" id="rev_range_container" style="display:none;"></a> |
|
36 | <a href="#" class="btn btn-small" id="rev_range_container" style="display:none;"></a> | |
37 | %if c.rhodecode_db_repo.fork: |
|
37 | %if c.rhodecode_db_repo.fork: | |
38 | <span> |
|
38 | <span> | |
39 | <a id="compare_fork_button" |
|
39 | <a id="compare_fork_button" | |
40 | title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}" |
|
40 | title="${h.tooltip(_('Compare fork with %s' % c.rhodecode_db_repo.fork.repo_name))}" | |
41 | class="btn btn-small" |
|
41 | class="btn btn-small" | |
42 | href="${h.route_path('repo_compare', |
|
42 | href="${h.route_path('repo_compare', | |
43 | repo_name=c.rhodecode_db_repo.fork.repo_name, |
|
43 | repo_name=c.rhodecode_db_repo.fork.repo_name, | |
44 | source_ref_type=c.rhodecode_db_repo.landing_rev[0], |
|
44 | source_ref_type=c.rhodecode_db_repo.landing_rev[0], | |
45 | source_ref=c.rhodecode_db_repo.landing_rev[1], |
|
45 | source_ref=c.rhodecode_db_repo.landing_rev[1], | |
46 | target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0], |
|
46 | target_ref_type='branch' if request.GET.get('branch') else c.rhodecode_db_repo.landing_rev[0], | |
47 | target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], |
|
47 | target_ref=request.GET.get('branch') or c.rhodecode_db_repo.landing_rev[1], | |
48 | _query=dict(merge=1, target_repo=c.repo_name))}" |
|
48 | _query=dict(merge=1, target_repo=c.repo_name))}" | |
49 | > |
|
49 | > | |
50 | ${_('Compare fork with Parent (%s)' % c.rhodecode_db_repo.fork.repo_name)} |
|
50 | ${_('Compare fork with Parent (%s)' % c.rhodecode_db_repo.fork.repo_name)} | |
51 | </a> |
|
51 | </a> | |
52 | </span> |
|
52 | </span> | |
53 | %endif |
|
53 | %endif | |
54 |
|
54 | |||
55 | ## pr open link |
|
55 | ## pr open link | |
56 | %if h.is_hg(c.rhodecode_repo) or h.is_git(c.rhodecode_repo): |
|
56 | %if h.is_hg(c.rhodecode_repo) or h.is_git(c.rhodecode_repo): | |
57 | <span> |
|
57 | <span> | |
58 | <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}"> |
|
58 | <a id="open_new_pull_request" class="btn btn-small btn-success" href="${h.route_path('pullrequest_new',repo_name=c.repo_name)}"> | |
59 | ${_('Open new pull request')} |
|
59 | ${_('Open new pull request')} | |
60 | </a> |
|
60 | </a> | |
61 | </span> |
|
61 | </span> | |
62 | %endif |
|
62 | %endif | |
63 |
|
63 | |||
64 | ## clear selection |
|
64 | ## clear selection | |
65 | <div title="${_('Clear selection')}" class="btn" id="rev_range_clear" style="display:none"> |
|
65 | <div title="${_('Clear selection')}" class="btn" id="rev_range_clear" style="display:none"> | |
66 | ${_('Clear selection')} |
|
66 | ${_('Clear selection')} | |
67 | </div> |
|
67 | </div> | |
68 |
|
68 | |||
69 | </li> |
|
69 | </li> | |
70 | </ul> |
|
70 | </ul> | |
71 | </div> |
|
71 | </div> | |
72 |
|
72 | |||
73 | % if c.pagination: |
|
73 | % if c.pagination: | |
74 | <script type="text/javascript" src="${h.asset('js/src/plugins/jquery.commits-graph.js')}"></script> |
|
74 | <script type="text/javascript" src="${h.asset('js/src/plugins/jquery.commits-graph.js')}"></script> | |
75 |
|
75 | |||
76 | <div class="graph-header"> |
|
76 | <div class="graph-header"> | |
77 | <div id="filter_changelog"> |
|
77 | <div id="filter_changelog"> | |
78 | ${h.hidden('branch_filter')} |
|
78 | ${h.hidden('branch_filter')} | |
79 | %if c.selected_name: |
|
79 | %if c.selected_name: | |
80 | <div class="btn btn-default" id="clear_filter" > |
|
80 | <div class="btn btn-default" id="clear_filter" > | |
81 | ${_('Clear filter')} |
|
81 | ${_('Clear filter')} | |
82 | </div> |
|
82 | </div> | |
83 | %endif |
|
83 | %endif | |
84 | </div> |
|
84 | </div> | |
85 | ${self.breadcrumbs('breadcrumbs_light')} |
|
85 | ${self.breadcrumbs('breadcrumbs_light')} | |
86 | <div class="pull-right"> |
|
86 | <div class="pull-right"> | |
87 | % if h.is_hg(c.rhodecode_repo): |
|
87 | % if h.is_hg(c.rhodecode_repo): | |
88 | % if c.show_hidden: |
|
88 | % if c.show_hidden: | |
89 | <a class="action-link" href="${h.current_route_path(request, evolve=0)}">${_('Hide obsolete/hidden')}</a> |
|
89 | <a class="action-link" href="${h.current_route_path(request, evolve=0)}">${_('Hide obsolete/hidden')}</a> | |
90 | % else: |
|
90 | % else: | |
91 | <a class="action-link" href="${h.current_route_path(request, evolve=1)}">${_('Show obsolete/hidden')}</a> |
|
91 | <a class="action-link" href="${h.current_route_path(request, evolve=1)}">${_('Show obsolete/hidden')}</a> | |
92 | % endif |
|
92 | % endif | |
93 | % else: |
|
93 | % else: | |
94 | <span class="action-link disabled">${_('Show hidden')}</span> |
|
94 | <span class="action-link disabled">${_('Show hidden')}</span> | |
95 | % endif |
|
95 | % endif | |
96 | </div> |
|
96 | </div> | |
97 | <div id="commit-counter" data-total=${c.total_cs} class="pull-right"> |
|
97 | <div id="commit-counter" data-total=${c.total_cs} class="pull-right"> | |
98 | ${_ungettext('showing %d out of %d commit', 'showing %d out of %d commits', c.showing_commits) % (c.showing_commits, c.total_cs)} |
|
98 | ${_ungettext('showing %d out of %d commit', 'showing %d out of %d commits', c.showing_commits) % (c.showing_commits, c.total_cs)} | |
99 | </div> |
|
99 | </div> | |
100 | </div> |
|
100 | </div> | |
101 |
|
101 | |||
102 | <div id="graph"> |
|
102 | <div id="graph"> | |
103 | <div class="graph-col-wrapper"> |
|
103 | <div class="graph-col-wrapper"> | |
104 | <div id="graph_nodes"> |
|
104 | <div id="graph_nodes"> | |
105 | <div id="graph_canvas"></div> |
|
105 | <div id="graph_canvas"></div> | |
106 | </div> |
|
106 | </div> | |
107 | <div id="graph_content" class="main-content graph_full_width"> |
|
107 | <div id="graph_content" class="main-content graph_full_width"> | |
108 |
|
108 | |||
109 | <div class="table"> |
|
109 | <div class="table"> | |
110 | <table id="changesets" class="rctable"> |
|
110 | <table id="changesets" class="rctable"> | |
111 | <tr> |
|
111 | <tr> | |
112 | ## checkbox |
|
112 | ## checkbox | |
113 | <th></th> |
|
113 | <th></th> | |
114 | <th colspan="2"></th> |
|
114 | <th colspan="2"></th> | |
115 |
|
115 | |||
116 | <th>${_('Commit')}</th> |
|
116 | <th>${_('Commit')}</th> | |
117 | ## Mercurial phase/evolve state |
|
117 | ## Mercurial phase/evolve state | |
118 | <th></th> |
|
118 | <th></th> | |
119 | ## commit message expand arrow |
|
119 | ## commit message expand arrow | |
120 | <th></th> |
|
120 | <th></th> | |
121 | <th>${_('Commit Message')}</th> |
|
121 | <th>${_('Commit Message')}</th> | |
122 |
|
122 | |||
123 | <th>${_('Age')}</th> |
|
123 | <th>${_('Age')}</th> | |
124 | <th>${_('Author')}</th> |
|
124 | <th>${_('Author')}</th> | |
125 |
|
125 | |||
126 | <th>${_('Refs')}</th> |
|
126 | <th>${_('Refs')}</th> | |
127 | </tr> |
|
127 | </tr> | |
128 |
|
128 | |||
129 | <tbody class="commits-range"> |
|
129 | <tbody class="commits-range"> | |
130 | <%include file='changelog_elements.mako'/> |
|
130 | <%include file='changelog_elements.mako'/> | |
131 | </tbody> |
|
131 | </tbody> | |
132 | </table> |
|
132 | </table> | |
133 | </div> |
|
133 | </div> | |
134 | </div> |
|
134 | </div> | |
135 | <div class="pagination-wh pagination-left"> |
|
135 | <div class="pagination-wh pagination-left"> | |
136 | ${c.pagination.pager('$link_previous ~2~ $link_next')} |
|
136 | ${c.pagination.pager('$link_previous ~2~ $link_next')} | |
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 $commitRangeContainer = $('#rev_range_container'); |
|
147 | var $commitRangeContainer = $('#rev_range_container'); | |
148 | var $commitRangeClear = $('#rev_range_clear'); |
|
148 | var $commitRangeClear = $('#rev_range_clear'); | |
149 |
|
149 | |||
150 | var checkboxRangeSelector = function(e){ |
|
150 | var checkboxRangeSelector = function(e){ | |
151 | var selectedCheckboxes = []; |
|
151 | var selectedCheckboxes = []; | |
152 | for (pos in $commitCheckboxes){ |
|
152 | for (pos in $commitCheckboxes){ | |
153 | if($commitCheckboxes[pos].checked){ |
|
153 | if($commitCheckboxes[pos].checked){ | |
154 | selectedCheckboxes.push($commitCheckboxes[pos]); |
|
154 | selectedCheckboxes.push($commitCheckboxes[pos]); | |
155 | } |
|
155 | } | |
156 | } |
|
156 | } | |
157 | var open_new_pull_request = $('#open_new_pull_request'); |
|
157 | var open_new_pull_request = $('#open_new_pull_request'); | |
158 | if(open_new_pull_request){ |
|
158 | if(open_new_pull_request){ | |
159 | var selected_changes = selectedCheckboxes.length; |
|
159 | var selected_changes = selectedCheckboxes.length; | |
160 |
if (selected_changes > 1 || selected_changes == 1 && templateContext.repo_type |
|
160 | if (selected_changes > 1 || selected_changes == 1 && templateContext.repo_type == 'svn') { | |
161 | open_new_pull_request.hide(); |
|
161 | open_new_pull_request.hide(); | |
162 | } else { |
|
162 | } else { | |
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 if (selected_changes == 0) { |
|
165 | } else if (selected_changes == 0) { | |
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 |
|
171 | |||
172 | if (selectedCheckboxes.length>0){ |
|
172 | if (selectedCheckboxes.length>0){ | |
173 | var revEnd = selectedCheckboxes[0].name; |
|
173 | var revEnd = selectedCheckboxes[0].name; | |
174 | var revStart = selectedCheckboxes[selectedCheckboxes.length-1].name; |
|
174 | var revStart = selectedCheckboxes[selectedCheckboxes.length-1].name; | |
175 | var url = pyroutes.url('repo_commit', |
|
175 | var url = pyroutes.url('repo_commit', | |
176 | {'repo_name': '${c.repo_name}', |
|
176 | {'repo_name': '${c.repo_name}', | |
177 | 'commit_id': revStart+'...'+revEnd}); |
|
177 | 'commit_id': revStart+'...'+revEnd}); | |
178 |
|
178 | |||
179 | var link = (revStart == revEnd) |
|
179 | var link = (revStart == revEnd) | |
180 | ? _gettext('Show selected commit __S') |
|
180 | ? _gettext('Show selected commit __S') | |
181 | : _gettext('Show selected commits __S ... __E'); |
|
181 | : _gettext('Show selected commits __S ... __E'); | |
182 |
|
182 | |||
183 | link = link.replace('__S', revStart.substr(0,6)); |
|
183 | link = link.replace('__S', revStart.substr(0,6)); | |
184 | link = link.replace('__E', revEnd.substr(0,6)); |
|
184 | link = link.replace('__E', revEnd.substr(0,6)); | |
185 |
|
185 | |||
186 | $commitRangeContainer |
|
186 | $commitRangeContainer | |
187 | .attr('href',url) |
|
187 | .attr('href',url) | |
188 | .html(link) |
|
188 | .html(link) | |
189 | .show(); |
|
189 | .show(); | |
190 |
|
190 | |||
191 | $commitRangeClear.show(); |
|
191 | $commitRangeClear.show(); | |
192 | var _url = pyroutes.url('pullrequest_new', |
|
192 | var _url = pyroutes.url('pullrequest_new', | |
193 | {'repo_name': '${c.repo_name}', |
|
193 | {'repo_name': '${c.repo_name}', | |
194 | 'commit': revEnd}); |
|
194 | 'commit': revEnd}); | |
195 | open_new_pull_request.attr('href', _url); |
|
195 | open_new_pull_request.attr('href', _url); | |
196 | $('#compare_fork_button').hide(); |
|
196 | $('#compare_fork_button').hide(); | |
197 | } else { |
|
197 | } else { | |
198 | $commitRangeContainer.hide(); |
|
198 | $commitRangeContainer.hide(); | |
199 | $commitRangeClear.hide(); |
|
199 | $commitRangeClear.hide(); | |
200 |
|
200 | |||
201 | %if c.branch_name: |
|
201 | %if c.branch_name: | |
202 | var _url = pyroutes.url('pullrequest_new', |
|
202 | var _url = pyroutes.url('pullrequest_new', | |
203 | {'repo_name': '${c.repo_name}', |
|
203 | {'repo_name': '${c.repo_name}', | |
204 | 'branch':'${c.branch_name}'}); |
|
204 | 'branch':'${c.branch_name}'}); | |
205 | open_new_pull_request.attr('href', _url); |
|
205 | open_new_pull_request.attr('href', _url); | |
206 | %else: |
|
206 | %else: | |
207 | var _url = pyroutes.url('pullrequest_new', |
|
207 | var _url = pyroutes.url('pullrequest_new', | |
208 | {'repo_name': '${c.repo_name}'}); |
|
208 | {'repo_name': '${c.repo_name}'}); | |
209 | open_new_pull_request.attr('href', _url); |
|
209 | open_new_pull_request.attr('href', _url); | |
210 | %endif |
|
210 | %endif | |
211 | $('#compare_fork_button').show(); |
|
211 | $('#compare_fork_button').show(); | |
212 | } |
|
212 | } | |
213 | }; |
|
213 | }; | |
214 |
|
214 | |||
215 | $commitCheckboxes.on('click', checkboxRangeSelector); |
|
215 | $commitCheckboxes.on('click', checkboxRangeSelector); | |
216 |
|
216 | |||
217 | $commitRangeClear.on('click',function(e) { |
|
217 | $commitRangeClear.on('click',function(e) { | |
218 | $commitCheckboxes.attr('checked', false); |
|
218 | $commitCheckboxes.attr('checked', false); | |
219 | checkboxRangeSelector(); |
|
219 | checkboxRangeSelector(); | |
220 | e.preventDefault(); |
|
220 | e.preventDefault(); | |
221 | }); |
|
221 | }); | |
222 |
|
222 | |||
223 | // make sure the buttons are consistent when navigate back and forth |
|
223 | // make sure the buttons are consistent when navigate back and forth | |
224 | checkboxRangeSelector(); |
|
224 | checkboxRangeSelector(); | |
225 |
|
225 | |||
226 | var msgs = $('.message'); |
|
226 | var msgs = $('.message'); | |
227 | // get first element height |
|
227 | // get first element height | |
228 | var el = $('#graph_content .container')[0]; |
|
228 | var el = $('#graph_content .container')[0]; | |
229 | var row_h = el.clientHeight; |
|
229 | var row_h = el.clientHeight; | |
230 | for (var i=0; i < msgs.length; i++) { |
|
230 | for (var i=0; i < msgs.length; i++) { | |
231 | var m = msgs[i]; |
|
231 | var m = msgs[i]; | |
232 |
|
232 | |||
233 | var h = m.clientHeight; |
|
233 | var h = m.clientHeight; | |
234 | var pad = $(m).css('padding'); |
|
234 | var pad = $(m).css('padding'); | |
235 | if (h > row_h) { |
|
235 | if (h > row_h) { | |
236 | var offset = row_h - (h+12); |
|
236 | var offset = row_h - (h+12); | |
237 | $(m.nextElementSibling).css('display','block'); |
|
237 | $(m.nextElementSibling).css('display','block'); | |
238 | $(m.nextElementSibling).css('margin-top',offset+'px'); |
|
238 | $(m.nextElementSibling).css('margin-top',offset+'px'); | |
239 | } |
|
239 | } | |
240 | } |
|
240 | } | |
241 |
|
241 | |||
242 | $("#clear_filter").on("click", function() { |
|
242 | $("#clear_filter").on("click", function() { | |
243 | var filter = {'repo_name': '${c.repo_name}'}; |
|
243 | var filter = {'repo_name': '${c.repo_name}'}; | |
244 | window.location = pyroutes.url('repo_changelog', filter); |
|
244 | window.location = pyroutes.url('repo_changelog', filter); | |
245 | }); |
|
245 | }); | |
246 |
|
246 | |||
247 | $("#branch_filter").select2({ |
|
247 | $("#branch_filter").select2({ | |
248 | 'dropdownAutoWidth': true, |
|
248 | 'dropdownAutoWidth': true, | |
249 | 'width': 'resolve', |
|
249 | 'width': 'resolve', | |
250 | 'placeholder': "${c.selected_name or _('Filter changelog')}", |
|
250 | 'placeholder': "${c.selected_name or _('Filter changelog')}", | |
251 | containerCssClass: "drop-menu", |
|
251 | containerCssClass: "drop-menu", | |
252 | dropdownCssClass: "drop-menu-dropdown", |
|
252 | dropdownCssClass: "drop-menu-dropdown", | |
253 | query: function(query){ |
|
253 | query: function(query){ | |
254 | var key = 'cache'; |
|
254 | var key = 'cache'; | |
255 | var cached = cache[key] ; |
|
255 | var cached = cache[key] ; | |
256 | if(cached) { |
|
256 | if(cached) { | |
257 | var data = {results: []}; |
|
257 | var data = {results: []}; | |
258 | //filter results |
|
258 | //filter results | |
259 | $.each(cached.results, function(){ |
|
259 | $.each(cached.results, function(){ | |
260 | var section = this.text; |
|
260 | var section = this.text; | |
261 | var children = []; |
|
261 | var children = []; | |
262 | $.each(this.children, function(){ |
|
262 | $.each(this.children, function(){ | |
263 | 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 ){ | |
264 | children.push({'id': this.id, 'text': this.text, 'type': this.type}) |
|
264 | children.push({'id': this.id, 'text': this.text, 'type': this.type}) | |
265 | } |
|
265 | } | |
266 | }); |
|
266 | }); | |
267 | data.results.push({'text': section, 'children': children}); |
|
267 | data.results.push({'text': section, 'children': children}); | |
268 | query.callback({results: data.results}); |
|
268 | query.callback({results: data.results}); | |
269 | }); |
|
269 | }); | |
270 | }else{ |
|
270 | }else{ | |
271 | $.ajax({ |
|
271 | $.ajax({ | |
272 | 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}'}), | |
273 | data: {}, |
|
273 | data: {}, | |
274 | dataType: 'json', |
|
274 | dataType: 'json', | |
275 | type: 'GET', |
|
275 | type: 'GET', | |
276 | success: function(data) { |
|
276 | success: function(data) { | |
277 | cache[key] = data; |
|
277 | cache[key] = data; | |
278 | query.callback({results: data.results}); |
|
278 | query.callback({results: data.results}); | |
279 | } |
|
279 | } | |
280 | }) |
|
280 | }) | |
281 | } |
|
281 | } | |
282 | } |
|
282 | } | |
283 | }); |
|
283 | }); | |
284 | $('#branch_filter').on('change', function(e){ |
|
284 | $('#branch_filter').on('change', function(e){ | |
285 | var data = $('#branch_filter').select2('data'); |
|
285 | var data = $('#branch_filter').select2('data'); | |
286 | //type: branch_closed |
|
286 | //type: branch_closed | |
287 | var selected = data.text; |
|
287 | var selected = data.text; | |
288 | var filter = {'repo_name': '${c.repo_name}'}; |
|
288 | var filter = {'repo_name': '${c.repo_name}'}; | |
289 | if(data.type == 'branch' || data.type == 'branch_closed'){ |
|
289 | if(data.type == 'branch' || data.type == 'branch_closed'){ | |
290 | filter["branch"] = selected; |
|
290 | filter["branch"] = selected; | |
291 | if (data.type == 'branch_closed') { |
|
291 | if (data.type == 'branch_closed') { | |
292 | filter["evolve"] = '1'; |
|
292 | filter["evolve"] = '1'; | |
293 | } |
|
293 | } | |
294 | } |
|
294 | } | |
295 | else if (data.type == 'book'){ |
|
295 | else if (data.type == 'book'){ | |
296 | filter["bookmark"] = selected; |
|
296 | filter["bookmark"] = selected; | |
297 | } |
|
297 | } | |
298 | window.location = pyroutes.url('repo_changelog', filter); |
|
298 | window.location = pyroutes.url('repo_changelog', filter); | |
299 | }); |
|
299 | }); | |
300 |
|
300 | |||
301 | commitsController = new CommitsController(); |
|
301 | commitsController = new CommitsController(); | |
302 | % if not c.changelog_for_path: |
|
302 | % if not c.changelog_for_path: | |
303 | commitsController.reloadGraph(); |
|
303 | commitsController.reloadGraph(); | |
304 | % endif |
|
304 | % endif | |
305 |
|
305 | |||
306 | }); |
|
306 | }); | |
307 |
|
307 | |||
308 | </script> |
|
308 | </script> | |
309 | </div> |
|
309 | </div> | |
310 | % else: |
|
310 | % else: | |
311 | ${_('There are no changes yet')} |
|
311 | ${_('There are no changes yet')} | |
312 | % endif |
|
312 | % endif | |
313 | </div> |
|
313 | </div> | |
314 | </%def> |
|
314 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now