##// END OF EJS Templates
summary: redirect from repo URLs with #branchname to changelog with this branch...
summary: redirect from repo URLs with #branchname to changelog with this branch This implements partial support for the Mercurial syntax for specifying revisions so https://secure.rhodecode.org/rhodecode/#beta works both for pulling with Mercurial and browsing. This uses javascript, and has a bit of extra support for onhashchange in HTML5 browsers.

File last commit:

r3609:2ea981f9 beta
r3655:c78de39f beta
Show More
pullrequest.html
209 lines | 7.7 KiB | text/html | HtmlLexer
pull requests draft UI
r2244 <%inherit file="/base/base.html"/>
<%def name="title()">
Added basic models for saving open pull requests...
r2434 ${c.repo_name} ${_('New pull request')}
pull requests draft UI
r2244 </%def>
<%def name="breadcrumbs_links()">
Mads Kiilerich
clean-up of breadcrumbs on pages with repo context bar
r3602 ${_('New pull request')}
pull requests draft UI
r2244 </%def>
Mads Kiilerich
templates: enforce more consistency by being less flexible in templates...
r3609 <%def name="page_nav()">
${self.menu('repositories')}
</%def>
pull requests draft UI
r2244 <%def name="main()">
show only open pull requests in the counter, and use repo context bar in pull requests view
r3580 ${self.context_bar('showpullrequest')}
pull requests draft UI
r2244 <div class="box">
<!-- box / title -->
<div class="title">
${self.breadcrumbs()}
</div>
Added basic models for saving open pull requests...
r2434 ${h.form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')}
<div style="float:left;padding:0px 30px 30px 30px">
pull requests draft UI
r2244 ##ORG
<div style="float:left">
Mads Kiilerich
pull request: don't show fake path with owner names - and owner avatars is also not relevant
r3330 <div>
pull requests draft UI
r2244 <span style="font-size: 20px">
Mads Kiilerich
pull request: select 'tip' by default ... and show what it means right now
r3329 ${h.select('org_repo','',c.org_repos,class_='refs')}:${h.select('org_ref',c.default_org_ref,c.org_refs,class_='refs')}
pull requests draft UI
r2244 </span>
notifications changes...
r3430 <div style="padding:5px 3px 3px 20px;">${c.rhodecode_db_repo.description}</div>
pull requests draft UI
r2244 </div>
<div style="clear:both;padding-top: 10px"></div>
</div>
<div style="float:left;font-size:24px;padding:0px 20px">
created pull-request overview
r2395 <img height=32 width=32 src="${h.url('/images/arrow_right_64.png')}"/>
pull requests draft UI
r2244 </div>
Added basic models for saving open pull requests...
r2434
pull requests draft UI
r2244 ##OTHER, most Probably the PARENT OF THIS FORK
<div style="float:left">
Mads Kiilerich
pull request: don't show fake path with owner names - and owner avatars is also not relevant
r3330 <div>
pull requests draft UI
r2244 <span style="font-size: 20px">
Mads Kiilerich
pullrequests: use default_other_repo_info for the default other_ref selector
r3596 ${h.select('other_repo',c.default_other_repo,c.other_repos,class_='refs')}:${c.default_other_repo_info['revs']}
pull requests draft UI
r2244 </span>
notifications changes...
r3430 <div id="other_repo_desc" style="padding:5px 3px 3px 20px;"></div>
pull requests draft UI
r2244 </div>
<div style="clear:both;padding-top: 10px"></div>
</div>
Added basic models for saving open pull requests...
r2434 <div style="clear:both;padding-top: 10px"></div>
## overview pulled by ajax
<div style="float:left" id="pull_request_overview"></div>
added link for detailed overview in pull-request form
r2396 <div style="float:left;clear:both;padding:10px 10px 10px 0px;display:none">
<a id="pull_request_overview_url" href="#">${_('Detailed compare view')}</a>
Added basic models for saving open pull requests...
r2434 </div>
pull requests draft UI
r2244 </div>
created pull-request overview
r2395 <div style="float:left; border-left:1px dashed #eee">
<h4>${_('Pull request reviewers')}</h4>
<div id="reviewers" style="padding:0px 0px 0px 15px">
Added autocomplete widget for pull request reviewers, in exchange of 90s style...
r2612 ## members goes here !
<div class="group_members_wrap">
<ul id="review_members" class="group_members">
Mads Kiilerich
pullrequests: fix non-js defaults for repo owner...
r3595 %for member in [c.default_other_repo_info['user']]:
<li id="reviewer_${member['user_id']}">
added option to remove members added using autocomplete widget from pull...
r2613 <div class="reviewers_member">
Mads Kiilerich
pullrequests: fix non-js defaults for repo owner...
r3595 <div class="gravatar"><img alt="gravatar" src="${member['gravatar_link']}"/> </div>
<div style="float:left">${member['firstname']} ${member['lastname']} (${_('owner')})</div>
<input type="hidden" value="${member['user_id']}" name="review_members" />
<span class="delete_icon action_button" onclick="removeReviewMember(${member['user_id']})"></span>
added option to remove members added using autocomplete widget from pull...
r2613 </div>
</li>
Added autocomplete widget for pull request reviewers, in exchange of 90s style...
r2612 %endfor
</ul>
white space cleanup
r2673 </div>
Added autocomplete widget for pull request reviewers, in exchange of 90s style...
r2612 <div class='ac'>
<div class="reviewer_ac">
${h.text('user', class_='yui-ac-input')}
<span class="help-block">${_('Add reviewer to this pull request.')}</span>
white space cleanup
r2673 <div id="reviewers_container"></div>
Added autocomplete widget for pull request reviewers, in exchange of 90s style...
r2612 </div>
</div>
created pull-request overview
r2395 </div>
Added basic models for saving open pull requests...
r2434 </div>
created pull-request overview
r2395 <h3>${_('Create new pull request')}</h3>
Added basic models for saving open pull requests...
r2434
pull requests draft UI
r2244 <div class="form">
<!-- fields -->
<div class="fields">
<div class="field">
<div class="label">
<label for="pullrequest_title">${_('Title')}:</label>
</div>
<div class="input">
${h.text('pullrequest_title',size=30)}
</div>
</div>
<div class="field">
<div class="label label-textarea">
Mads Kiilerich
fix casings
r3516 <label for="pullrequest_desc">${_('Description')}:</label>
pull requests draft UI
r2244 </div>
<div class="textarea text-area editor">
${h.textarea('pullrequest_desc',size=30)}
</div>
</div>
<div class="buttons">
removed deprecated ui-button
r2607 ${h.submit('save',_('Send pull request'),class_="ui-btn large")}
${h.reset('reset',_('Reset'),class_="ui-btn large")}
pull requests draft UI
r2244 </div>
</div>
</div>
Added basic models for saving open pull requests...
r2434 ${h.end_form()}
pull requests draft UI
r2244 </div>
created pull-request overview
r2395 <script type="text/javascript">
Added autocomplete widget for pull request reviewers, in exchange of 90s style...
r2612 var _USERS_AC_DATA = ${c.users_array|n};
var _GROUPS_AC_DATA = ${c.users_groups_array|n};
PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA);
Added dynamic data loading for other repo we open pull request against...
r2541 var other_repos_info = ${c.other_repos_info|n};
white space cleanup
r2907
Mads Kiilerich
pullrequest: separate js actions for 'update preview' from 'destination repo changed'
r3514 var otherrepoChanged = function(){
var sel_box = YUQ('#pull_request_form #other_repo')[0];
var repo_name = sel_box.options[sel_box.selectedIndex].value;
YUD.get('other_repo_desc').innerHTML = other_repos_info[repo_name]['description'];
// replace options of other_ref with the ones for the current other_repo
var other_ref_selector = YUD.get('other_ref');
var new_select = YUD.createElementFromMarkup(other_repos_info[repo_name]['revs']);
var new_selectedIndex = new_select.selectedIndex;
other_ref_selector.innerHTML = ""; // clear old options
while (new_select.length > 0){ // children will be popped when appened to other_ref_selector
other_ref_selector.appendChild(new_select.children[0]);
}
// browsers lost track of selected when appendChild was used
other_ref_selector.selectedIndex = new_selectedIndex;
// reset && add the reviewer based on selected repo
var _data = other_repos_info[repo_name];
YUD.get('review_members').innerHTML = '';
addReviewMember(_data.user.user_id, _data.user.firstname,
_data.user.lastname, _data.user.username,
_data.user.gravatar_link);
}
created pull-request overview
r2395 var loadPreview = function(){
be more explicit about constructing compare url
r3321 //url template
Added basic models for saving open pull requests...
r2434 var url = "${h.url('compare_url',
Mads Kiilerich
compare: swap org and other when they refer to different repos, ie are pull request style...
r3322 repo_name='__other_repo__',
org_ref_type='__other_ref_type__',
org_ref='__other_ref__',
other_repo='__org_repo__',
other_ref_type='__org_ref_type__',
other_ref='__org_ref__',
Mads Kiilerich
compare and diff: remove unused "bundle" functionality...
r3304 as_form=True,
Mads Kiilerich
compare/pullrequest: introduce merge parameter...
r3486 merge=True,
Mads Kiilerich
compare: drop unused rev_start and rev_end
r3484 )}";
be more explicit about constructing compare url
r3321 var org_repo = YUQ('#pull_request_form #org_repo')[0].value;
var org_ref = YUQ('#pull_request_form #org_ref')[0].value.split(':');
whitespace cleanup
r3338
be more explicit about constructing compare url
r3321 var other_repo = YUQ('#pull_request_form #other_repo')[0].value;
var other_ref = YUQ('#pull_request_form #other_ref')[0].value.split(':');
whitespace cleanup
r3338
created pull-request overview
r2395 var select_refs = YUQ('#pull_request_form select.refs')
be more explicit about constructing compare url
r3321 var rev_data = {
Mads Kiilerich
pullrequests: use stable revisions in compare urls instead of bookmark/branch/tag
r3441 'org_repo': org_repo,
'org_ref': org_ref[2],
'org_ref_type': 'rev',
'other_repo': other_repo,
'other_ref': other_ref[2],
'other_ref_type': 'rev',
be more explicit about constructing compare url
r3321 }; // gather the org/other ref and repo here
whitespace cleanup
r3338
be more explicit about constructing compare url
r3321 for (k in rev_data){
codecleaner, fix tabs -> spaces
r3449 url = url.replace('__'+k+'__',rev_data[k]);
created pull-request overview
r2395 }
Added basic models for saving open pull requests...
r2434
Mads Kiilerich
pullrequest: show 'loading' while waiting for compare_url to load
r3438 YUD.get('pull_request_overview').innerHTML = "${_('Loading ...')}";
Mads Kiilerich
pullrequest: don't do in the ajax callback what can be done in no time right now
r3513 ypjax(url,'pull_request_overview');
Mads Kiilerich
pullrequest: show 'details' link immediately - don't wait for changeset list
r3439 YUD.get('pull_request_overview_url').href = url; // shouldn't have as_form ... but ...
YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','');
created pull-request overview
r2395 }
Mads Kiilerich
pull request: only bind action to other_repo change once
r3325
Mads Kiilerich
pull request: update changeset list automatically - remove refresh icon...
r3326 ## refresh automatically when something changes (org_repo can't change)
YUE.on('org_ref', 'change', function(e){
loadPreview();
});
Mads Kiilerich
pull request: only bind action to other_repo change once
r3325 YUE.on('other_repo', 'change', function(e){
Mads Kiilerich
pullrequest: separate js actions for 'update preview' from 'destination repo changed'
r3514 otherrepoChanged();
Mads Kiilerich
pull request: update changeset list automatically - remove refresh icon...
r3326 loadPreview();
Mads Kiilerich
pull request: only bind action to other_repo change once
r3325 });
Mads Kiilerich
pull request: update changeset list automatically - remove refresh icon...
r3326 YUE.on('other_ref', 'change', function(e){
loadPreview();
});
Added basic models for saving open pull requests...
r2434
Mads Kiilerich
pullrequest: separate js actions for 'update preview' from 'destination repo changed'
r3514 otherrepoChanged();
Added basic models for saving open pull requests...
r2434 //lazy load overview after 0.5s
Mads Kiilerich
pullrequest: separate js actions for 'update preview' from 'destination repo changed'
r3514 setTimeout(loadPreview, 500);
Added basic models for saving open pull requests...
r2434
created pull-request overview
r2395 </script>
pull requests draft UI
r2244 </%def>