##// END OF EJS Templates
fixed issue with formatting escaping on url used in changelog js....
marcink -
r3979:04242759 default
parent child Browse files
Show More
@@ -148,7 +148,10
148 148 //Monitor range checkboxes and build a link to changesets
149 149 //ranges
150 150 var checkboxes = YUD.getElementsByClassName('changeset_range');
151 var url_tmpl = "${h.url('changeset_home',repo_name=c.repo_name,revision='__REVRANGE__')}";
151 // register our routes needed for this view
152 pyroutes.register('changeset_home', "${h.url('changeset_home', repo_name='%(repo_name)s', revision='%(revision)s')}", ['repo_name', 'revision']);
153 pyroutes.register('changelog_home', "${h.url('changelog_home', repo_name='%(repo_name)s')}", ['repo_name']);
154 pyroutes.register('pullrequest_home', "${h.url('pullrequest_home', repo_name='%(repo_name)s')}", ['repo_name']);
152 155
153 156 var checkbox_checker = function(e){
154 157 var checked_checkboxes = [];
@@ -173,8 +176,8
173 176 if(checked_checkboxes.length>0){
174 177 var rev_end = checked_checkboxes[0].name;
175 178 var rev_start = checked_checkboxes[checked_checkboxes.length-1].name;
176 var url = url_tmpl.replace('__REVRANGE__',
177 rev_start+'...'+rev_end);
179 var url = pyroutes.url('changeset_home', {'repo_name': '${c.repo_name}',
180 'revision': rev_start+'...'+rev_end});
178 181
179 182 var link = (rev_start == rev_end)
180 183 ? _TM['Show selected changeset __S']
@@ -187,16 +190,22
187 190 YUD.setStyle('rev_range_container','display','');
188 191 YUD.setStyle('rev_range_clear','display','');
189 192
190 var pr_tmpl = "${h.url('pullrequest_home',repo_name=c.repo_name,rev_start='{0}',rev_end='{1}')}";
191 YUD.get('open_new_pr').href = pr_tmpl.format(rev_start,rev_end);
193 YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home',
194 {'repo_name': '${c.repo_name}',
195 'rev_start': rev_start,
196 'rev_end': rev_end})
197
192 198 YUD.setStyle('compare_fork','display','none');
193 199 }else{
194 200 YUD.setStyle('rev_range_container','display','none');
195 201 YUD.setStyle('rev_range_clear','display','none');
196 202 %if c.branch_name:
197 YUD.get('open_new_pr').href = "${h.url('pullrequest_home',repo_name=c.repo_name,branch=c.branch_name)}";
203 YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home',
204 {'repo_name': '${c.repo_name}',
205 'branch':'${c.branch_name}'});
198 206 %else:
199 YUD.get('open_new_pr').href = "${h.url('pullrequest_home',repo_name=c.repo_name)}";
207 YUD.get('open_new_pr').href = pyroutes.url('pullrequest_home',
208 {'repo_name': '${c.repo_name}'});
200 209 %endif
201 210 YUD.setStyle('compare_fork','display','');
202 211 }
@@ -244,15 +253,12
244 253 // change branch filter
245 254 YUE.on(YUD.get('branch_filter'),'change',function(e){
246 255 var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value;
247 var url_main = "${h.url('changelog_home',repo_name=c.repo_name)}";
248 var url = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}";
249 var url = url.replace('__BRANCH__', encodeURIComponent(selected_branch));
250 256 if(selected_branch != ''){
251 window.location = url;
257 window.location = pyroutes.url('changelog_home', {'repo_name': '${c.repo_name}',
258 'branch':encodeURIComponent(selected_branch)});
252 259 }else{
253 window.location = url_main;
260 window.location = pyroutes.url('changelog_home', {'repo_name': '${c.repo_name}'});
254 261 }
255
256 262 });
257 263
258 264 function set_canvas(width) {
General Comments 0
You need to be logged in to leave comments. Login now