##// END OF EJS Templates
be more explicit about constructing compare url
marcink -
r3321:a91fa221 beta
parent child Browse files
Show More
@@ -493,8 +493,8 b' def make_map(config):'
493 493 controller='compare', action='index',
494 494 conditions=dict(function=check_repo),
495 495 requirements=dict(
496 org_ref_type='(branch|book|tag|rev|org_ref_type)',
497 other_ref_type='(branch|book|tag|rev|other_ref_type)')
496 org_ref_type='(branch|book|tag|rev|__org_ref_type__)',
497 other_ref_type='(branch|book|tag|rev|__other_ref_type__)')
498 498 )
499 499
500 500 rmap.connect('pullrequest_home',
@@ -138,40 +138,35 b''
138 138
139 139 var loadPreview = function(){
140 140 YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','none');
141 //url template
141 142 var url = "${h.url('compare_url',
142 repo_name='org_repo',
143 org_ref_type='org_ref_type', org_ref='org_ref',
144 other_repo='other_repo',
145 other_ref_type='other_ref_type', other_ref='other_ref',
143 repo_name='__org_repo__',
144 org_ref_type='__org_ref_type__',
145 org_ref='__org_ref__',
146 other_repo='__other_repo__',
147 other_ref_type='__other_ref_type__',
148 other_ref='__other_ref__',
146 149 as_form=True,
147 150 rev_start=request.GET.get('rev_start',''),
148 151 rev_end=request.GET.get('rev_end',''))}";
152 var org_repo = YUQ('#pull_request_form #org_repo')[0].value;
153 var org_ref = YUQ('#pull_request_form #org_ref')[0].value.split(':');
154
155 var other_repo = YUQ('#pull_request_form #other_repo')[0].value;
156 var other_ref = YUQ('#pull_request_form #other_ref')[0].value.split(':');
149 157
150 158 var select_refs = YUQ('#pull_request_form select.refs')
151 var rev_data = {}; // gather the org/other ref and repo here
152 for(var i=0;i<select_refs.length;i++){
153 var select_ref = select_refs[i];
154 var select_ref_data = select_ref.value.split(':');
155 var key = null;
156 var val = null;
159 var rev_data = {
160 'org_repo': org_repo,
161 'org_ref': org_ref[1],
162 'org_ref_type': org_ref[0],
163 'other_repo': other_repo,
164 'other_ref': other_ref[1],
165 'other_ref_type': other_ref[0],
166 }; // gather the org/other ref and repo here
157 167
158 if(select_ref_data.length>1){
159 key = select_ref.name+"_type";
160 val = select_ref_data[0];
161 url = url.replace(key,val);
162 rev_data[key] = val;
163
164 key = select_ref.name;
165 val = select_ref_data[1];
166 url = url.replace(key,val);
167 rev_data[key] = val;
168
169 }else{
170 key = select_ref.name;
171 val = select_ref.value;
172 url = url.replace(key,val);
173 rev_data[key] = val;
174 }
168 for (k in rev_data){
169 url = url.replace('__'+k+'__',rev_data[k]);
175 170 }
176 171
177 172 YUE.on('other_repo', 'change', function(e){
General Comments 0
You need to be logged in to leave comments. Login now