annotate rhodecode/templates/pullrequests/pullrequest.html @ 4057:6eaee7e2829e

pull requests: link to origin branch
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 27 Jun 2013 23:54:22 +0200
parents 072a37c44f58
children ffd45b185016
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2244
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
1 <%inherit file="/base/base.html"/>
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
2
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
3 <%def name="title()">
2434
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2396
diff changeset
4 ${c.repo_name} ${_('New pull request')}
2244
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
5 </%def>
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7 <%def name="breadcrumbs_links()">
3602
bb1eecda3172 clean-up of breadcrumbs on pages with repo context bar
Mads Kiilerich <madski@unity3d.com>
parents: 3596
diff changeset
8 ${_('New pull request')}
2244
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
9 </%def>
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10
3609
2ea981f9da79 templates: enforce more consistency by being less flexible in templates
Mads Kiilerich <madski@unity3d.com>
parents: 3602
diff changeset
11 <%def name="page_nav()">
2ea981f9da79 templates: enforce more consistency by being less flexible in templates
Mads Kiilerich <madski@unity3d.com>
parents: 3602
diff changeset
12 ${self.menu('repositories')}
2ea981f9da79 templates: enforce more consistency by being less flexible in templates
Mads Kiilerich <madski@unity3d.com>
parents: 3602
diff changeset
13 </%def>
2ea981f9da79 templates: enforce more consistency by being less flexible in templates
Mads Kiilerich <madski@unity3d.com>
parents: 3602
diff changeset
14
2244
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
15 <%def name="main()">
3988
072a37c44f58 templates: drop context_bar, use repo_context_bar directly
Mads Kiilerich <madski@unity3d.com>
parents: 3815
diff changeset
16 ${self.repo_context_bar('showpullrequest')}
2244
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
17 <div class="box">
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
18 <!-- box / title -->
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
19 <div class="title">
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
20 ${self.breadcrumbs()}
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
21 </div>
2434
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2396
diff changeset
22
3814
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
23 ${h.form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')}
2673
d5e42c00f3c1 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2613
diff changeset
24
2395
b262e349a7a5 created pull-request overview
Marcin Kuzminski <marcin@python-works.com>
parents: 2244
diff changeset
25 <h3>${_('Create new pull request')}</h3>
2434
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2396
diff changeset
26
2244
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
27 <div class="form">
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
28 <!-- fields -->
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
29
3814
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
30 <div class="fields" style="float:left;width:50%;padding-right:30px;">
2244
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
31
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
32 <div class="field">
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
33 <div class="label">
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
34 <label for="pullrequest_title">${_('Title')}:</label>
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
35 </div>
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
36 <div class="input">
3815
8b1f64722d46 small ui improvements to pull-request form
Marcin Kuzminski <marcin@python-works.com>
parents: 3814
diff changeset
37 ${h.text('pullrequest_title', class_="large")}
2244
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
38 </div>
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
39 </div>
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
40
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
41 <div class="field">
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
42 <div class="label label-textarea">
3516
c44645e5a836 fix casings
Mads Kiilerich <madski@unity3d.com>
parents: 3514
diff changeset
43 <label for="pullrequest_desc">${_('Description')}:</label>
2244
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
44 </div>
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
45 <div class="textarea text-area editor">
3815
8b1f64722d46 small ui improvements to pull-request form
Marcin Kuzminski <marcin@python-works.com>
parents: 3814
diff changeset
46 ${h.textarea('pullrequest_desc',size=30, style="height:100px")}
8b1f64722d46 small ui improvements to pull-request form
Marcin Kuzminski <marcin@python-works.com>
parents: 3814
diff changeset
47 <span class="help-block">${_('Write a short description on this pull request')}</span>
2244
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
48 </div>
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
49 </div>
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
50
3814
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
51 <div class="field">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
52 <div class="label label-textarea">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
53 <label for="pullrequest_desc">${_('Changeset flow')}:</label>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
54 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
55 <div class="input">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
56 ##ORG
3815
8b1f64722d46 small ui improvements to pull-request form
Marcin Kuzminski <marcin@python-works.com>
parents: 3814
diff changeset
57 <div>
3814
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
58 <div>
3815
8b1f64722d46 small ui improvements to pull-request form
Marcin Kuzminski <marcin@python-works.com>
parents: 3814
diff changeset
59 <div style="padding:5px 3px 3px 3px;">
8b1f64722d46 small ui improvements to pull-request form
Marcin Kuzminski <marcin@python-works.com>
parents: 3814
diff changeset
60 <b>${_('Origin repository')}:</b> ${c.rhodecode_db_repo.description}
8b1f64722d46 small ui improvements to pull-request form
Marcin Kuzminski <marcin@python-works.com>
parents: 3814
diff changeset
61 </div>
3814
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
62 <span style="font-size: 20px">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
63 ${h.select('org_repo','',c.org_repos,class_='refs')}:${h.select('org_ref',c.default_org_ref,c.org_refs,class_='refs')}
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
64 </span>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
65 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
66 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
67
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
68 ##OTHER, most Probably the PARENT OF THIS FORK
3815
8b1f64722d46 small ui improvements to pull-request form
Marcin Kuzminski <marcin@python-works.com>
parents: 3814
diff changeset
69 <div style="border-top: 1px solid #EEE; margin: 5px 0px 0px 0px">
3814
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
70 <div>
3815
8b1f64722d46 small ui improvements to pull-request form
Marcin Kuzminski <marcin@python-works.com>
parents: 3814
diff changeset
71 ## filled with JS
8b1f64722d46 small ui improvements to pull-request form
Marcin Kuzminski <marcin@python-works.com>
parents: 3814
diff changeset
72 <div id="other_repo_desc" style="padding:5px 3px 3px 3px;">
8b1f64722d46 small ui improvements to pull-request form
Marcin Kuzminski <marcin@python-works.com>
parents: 3814
diff changeset
73 </div>
3814
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
74 <span style="font-size: 20px">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
75 ${h.select('other_repo',c.default_other_repo,c.other_repos,class_='refs')}:${c.default_other_repo_info['revs']}
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
76 </span>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
77 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
78 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
79 <div style="clear:both"></div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
80 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
81 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
82
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
83 <div class="field">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
84 <div class="buttons">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
85 ${h.submit('save',_('Send pull request'),class_="ui-btn large")}
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
86 ${h.reset('reset',_('Reset'),class_="ui-btn large")}
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
87 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
88 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
89
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
90 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
91
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
92 ## Reviewers
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
93 <div style="float:left; border-left:1px dashed #eee">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
94 <h4>${_('Pull request reviewers')}</h4>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
95 <div id="reviewers" style="padding:0px 0px 0px 15px">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
96 ## members goes here !
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
97 <div class="group_members_wrap">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
98 <ul id="review_members" class="group_members">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
99 %for member in [c.default_other_repo_info['user']]:
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
100 <li id="reviewer_${member['user_id']}">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
101 <div class="reviewers_member">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
102 <div class="gravatar"><img alt="gravatar" src="${member['gravatar_link']}"/> </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
103 <div style="float:left">${member['firstname']} ${member['lastname']} (${_('owner')})</div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
104 <input type="hidden" value="${member['user_id']}" name="review_members" />
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
105 <span class="delete_icon action_button" onclick="removeReviewMember(${member['user_id']})"></span>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
106 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
107 </li>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
108 %endfor
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
109 </ul>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
110 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
111
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
112 <div class='ac'>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
113 <div class="reviewer_ac">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
114 ${h.text('user', class_='yui-ac-input')}
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
115 <span class="help-block">${_('Add reviewer to this pull request.')}</span>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
116 <div id="reviewers_container"></div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
117 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
118 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
119 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
120 </div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
121
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
122 <div style="clear:both;padding: 0 0 30px 0;"></div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
123
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
124 <h4>${_('Changesets')}</h4>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
125 <div style="float:left;padding:0px 30px 30px 30px">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
126 ## overview pulled by ajax
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
127 <div style="float:left" id="pull_request_overview"></div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
128 <div style="float:left;clear:both;padding:10px 10px 10px 0px;display:none">
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
129 <a id="pull_request_overview_url" href="#">${_('Detailed compare view')}</a>
2244
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
130 </div>
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
131 </div>
3814
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
132 <div style="clear:both;"></div>
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
133
2244
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
134 </div>
3814
8854ddd51b48 pullrequests: reorganize PR creation page - make it more like the view page
Mads Kiilerich <madski@unity3d.com>
parents: 3609
diff changeset
135
2434
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2396
diff changeset
136 ${h.end_form()}
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2396
diff changeset
137
2244
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
138 </div>
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
139
2395
b262e349a7a5 created pull-request overview
Marcin Kuzminski <marcin@python-works.com>
parents: 2244
diff changeset
140 <script type="text/javascript">
2612
9364776d1331 Added autocomplete widget for pull request reviewers, in exchange of 90s style
Marcin Kuzminski <marcin@python-works.com>
parents: 2607
diff changeset
141 var _USERS_AC_DATA = ${c.users_array|n};
9364776d1331 Added autocomplete widget for pull request reviewers, in exchange of 90s style
Marcin Kuzminski <marcin@python-works.com>
parents: 2607
diff changeset
142 var _GROUPS_AC_DATA = ${c.users_groups_array|n};
9364776d1331 Added autocomplete widget for pull request reviewers, in exchange of 90s style
Marcin Kuzminski <marcin@python-works.com>
parents: 2607
diff changeset
143 PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA);
9364776d1331 Added autocomplete widget for pull request reviewers, in exchange of 90s style
Marcin Kuzminski <marcin@python-works.com>
parents: 2607
diff changeset
144
2541
1c2ba03c42b4 Added dynamic data loading for other repo we open pull request against
Marcin Kuzminski <marcin@python-works.com>
parents: 2492
diff changeset
145 var other_repos_info = ${c.other_repos_info|n};
2907
0b86972de820 white space cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 2892
diff changeset
146
3514
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
147 var otherrepoChanged = function(){
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
148 var sel_box = YUQ('#pull_request_form #other_repo')[0];
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
149 var repo_name = sel_box.options[sel_box.selectedIndex].value;
3815
8b1f64722d46 small ui improvements to pull-request form
Marcin Kuzminski <marcin@python-works.com>
parents: 3814
diff changeset
150 var _tmpl = "<b>${_('Destination repository')}</b>: {0}".format(other_repos_info[repo_name]['description']);
8b1f64722d46 small ui improvements to pull-request form
Marcin Kuzminski <marcin@python-works.com>
parents: 3814
diff changeset
151 YUD.get('other_repo_desc').innerHTML = _tmpl
3514
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
152 // replace options of other_ref with the ones for the current other_repo
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
153 var other_ref_selector = YUD.get('other_ref');
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
154 var new_select = YUD.createElementFromMarkup(other_repos_info[repo_name]['revs']);
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
155 var new_selectedIndex = new_select.selectedIndex;
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
156 other_ref_selector.innerHTML = ""; // clear old options
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
157 while (new_select.length > 0){ // children will be popped when appened to other_ref_selector
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
158 other_ref_selector.appendChild(new_select.children[0]);
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
159 }
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
160 // browsers lost track of selected when appendChild was used
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
161 other_ref_selector.selectedIndex = new_selectedIndex;
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
162
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
163 // reset && add the reviewer based on selected repo
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
164 var _data = other_repos_info[repo_name];
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
165 YUD.get('review_members').innerHTML = '';
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
166 addReviewMember(_data.user.user_id, _data.user.firstname,
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
167 _data.user.lastname, _data.user.username,
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
168 _data.user.gravatar_link);
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
169 }
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
170
2395
b262e349a7a5 created pull-request overview
Marcin Kuzminski <marcin@python-works.com>
parents: 2244
diff changeset
171 var loadPreview = function(){
3321
a91fa221a3b8 be more explicit about constructing compare url
Marcin Kuzminski <marcin@python-works.com>
parents: 3317
diff changeset
172 //url template
2434
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2396
diff changeset
173 var url = "${h.url('compare_url',
3322
c9b0f1d363c7 compare: swap org and other when they refer to different repos, ie are pull request style
Mads Kiilerich <madski@unity3d.com>
parents: 3321
diff changeset
174 repo_name='__other_repo__',
c9b0f1d363c7 compare: swap org and other when they refer to different repos, ie are pull request style
Mads Kiilerich <madski@unity3d.com>
parents: 3321
diff changeset
175 org_ref_type='__other_ref_type__',
c9b0f1d363c7 compare: swap org and other when they refer to different repos, ie are pull request style
Mads Kiilerich <madski@unity3d.com>
parents: 3321
diff changeset
176 org_ref='__other_ref__',
c9b0f1d363c7 compare: swap org and other when they refer to different repos, ie are pull request style
Mads Kiilerich <madski@unity3d.com>
parents: 3321
diff changeset
177 other_repo='__org_repo__',
c9b0f1d363c7 compare: swap org and other when they refer to different repos, ie are pull request style
Mads Kiilerich <madski@unity3d.com>
parents: 3321
diff changeset
178 other_ref_type='__org_ref_type__',
c9b0f1d363c7 compare: swap org and other when they refer to different repos, ie are pull request style
Mads Kiilerich <madski@unity3d.com>
parents: 3321
diff changeset
179 other_ref='__org_ref__',
3304
70309536c143 compare and diff: remove unused "bundle" functionality
Mads Kiilerich <madski@unity3d.com>
parents: 3197
diff changeset
180 as_form=True,
3486
2053053e0882 compare/pullrequest: introduce merge parameter
Mads Kiilerich <madski@unity3d.com>
parents: 3484
diff changeset
181 merge=True,
3484
75e563531350 compare: drop unused rev_start and rev_end
Mads Kiilerich <madski@unity3d.com>
parents: 3449
diff changeset
182 )}";
3321
a91fa221a3b8 be more explicit about constructing compare url
Marcin Kuzminski <marcin@python-works.com>
parents: 3317
diff changeset
183 var org_repo = YUQ('#pull_request_form #org_repo')[0].value;
a91fa221a3b8 be more explicit about constructing compare url
Marcin Kuzminski <marcin@python-works.com>
parents: 3317
diff changeset
184 var org_ref = YUQ('#pull_request_form #org_ref')[0].value.split(':');
3338
cfc0fef66ddd whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 3330
diff changeset
185
3321
a91fa221a3b8 be more explicit about constructing compare url
Marcin Kuzminski <marcin@python-works.com>
parents: 3317
diff changeset
186 var other_repo = YUQ('#pull_request_form #other_repo')[0].value;
a91fa221a3b8 be more explicit about constructing compare url
Marcin Kuzminski <marcin@python-works.com>
parents: 3317
diff changeset
187 var other_ref = YUQ('#pull_request_form #other_ref')[0].value.split(':');
3338
cfc0fef66ddd whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 3330
diff changeset
188
2395
b262e349a7a5 created pull-request overview
Marcin Kuzminski <marcin@python-works.com>
parents: 2244
diff changeset
189 var select_refs = YUQ('#pull_request_form select.refs')
3321
a91fa221a3b8 be more explicit about constructing compare url
Marcin Kuzminski <marcin@python-works.com>
parents: 3317
diff changeset
190 var rev_data = {
3441
c4bb2b22110e pullrequests: use stable revisions in compare urls instead of bookmark/branch/tag
Mads Kiilerich <madski@unity3d.com>
parents: 3439
diff changeset
191 'org_repo': org_repo,
c4bb2b22110e pullrequests: use stable revisions in compare urls instead of bookmark/branch/tag
Mads Kiilerich <madski@unity3d.com>
parents: 3439
diff changeset
192 'org_ref': org_ref[2],
c4bb2b22110e pullrequests: use stable revisions in compare urls instead of bookmark/branch/tag
Mads Kiilerich <madski@unity3d.com>
parents: 3439
diff changeset
193 'org_ref_type': 'rev',
c4bb2b22110e pullrequests: use stable revisions in compare urls instead of bookmark/branch/tag
Mads Kiilerich <madski@unity3d.com>
parents: 3439
diff changeset
194 'other_repo': other_repo,
c4bb2b22110e pullrequests: use stable revisions in compare urls instead of bookmark/branch/tag
Mads Kiilerich <madski@unity3d.com>
parents: 3439
diff changeset
195 'other_ref': other_ref[2],
c4bb2b22110e pullrequests: use stable revisions in compare urls instead of bookmark/branch/tag
Mads Kiilerich <madski@unity3d.com>
parents: 3439
diff changeset
196 'other_ref_type': 'rev',
3321
a91fa221a3b8 be more explicit about constructing compare url
Marcin Kuzminski <marcin@python-works.com>
parents: 3317
diff changeset
197 }; // gather the org/other ref and repo here
3338
cfc0fef66ddd whitespace cleanup
Marcin Kuzminski <marcin@python-works.com>
parents: 3330
diff changeset
198
3321
a91fa221a3b8 be more explicit about constructing compare url
Marcin Kuzminski <marcin@python-works.com>
parents: 3317
diff changeset
199 for (k in rev_data){
3449
95a226b35b91 codecleaner, fix tabs -> spaces
Marcin Kuzminski <marcin@python-works.com>
parents: 3441
diff changeset
200 url = url.replace('__'+k+'__',rev_data[k]);
2395
b262e349a7a5 created pull-request overview
Marcin Kuzminski <marcin@python-works.com>
parents: 2244
diff changeset
201 }
2434
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2396
diff changeset
202
3438
cf3c2fce197e pullrequest: show 'loading' while waiting for compare_url to load
Mads Kiilerich <madski@unity3d.com>
parents: 3430
diff changeset
203 YUD.get('pull_request_overview').innerHTML = "${_('Loading ...')}";
3513
a2a61978752f pullrequest: don't do in the ajax callback what can be done in no time right now
Mads Kiilerich <madski@unity3d.com>
parents: 3512
diff changeset
204 ypjax(url,'pull_request_overview');
a2a61978752f pullrequest: don't do in the ajax callback what can be done in no time right now
Mads Kiilerich <madski@unity3d.com>
parents: 3512
diff changeset
205
3439
0153f5514aa3 pullrequest: show 'details' link immediately - don't wait for changeset list
Mads Kiilerich <madski@unity3d.com>
parents: 3438
diff changeset
206 YUD.get('pull_request_overview_url').href = url; // shouldn't have as_form ... but ...
0153f5514aa3 pullrequest: show 'details' link immediately - don't wait for changeset list
Mads Kiilerich <madski@unity3d.com>
parents: 3438
diff changeset
207 YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','');
2395
b262e349a7a5 created pull-request overview
Marcin Kuzminski <marcin@python-works.com>
parents: 2244
diff changeset
208 }
3325
c5dde6b5e976 pull request: only bind action to other_repo change once
Mads Kiilerich <madski@unity3d.com>
parents: 3322
diff changeset
209
3326
5ef64956c385 pull request: update changeset list automatically - remove refresh icon
Mads Kiilerich <madski@unity3d.com>
parents: 3325
diff changeset
210 ## refresh automatically when something changes (org_repo can't change)
5ef64956c385 pull request: update changeset list automatically - remove refresh icon
Mads Kiilerich <madski@unity3d.com>
parents: 3325
diff changeset
211
5ef64956c385 pull request: update changeset list automatically - remove refresh icon
Mads Kiilerich <madski@unity3d.com>
parents: 3325
diff changeset
212 YUE.on('org_ref', 'change', function(e){
5ef64956c385 pull request: update changeset list automatically - remove refresh icon
Mads Kiilerich <madski@unity3d.com>
parents: 3325
diff changeset
213 loadPreview();
5ef64956c385 pull request: update changeset list automatically - remove refresh icon
Mads Kiilerich <madski@unity3d.com>
parents: 3325
diff changeset
214 });
5ef64956c385 pull request: update changeset list automatically - remove refresh icon
Mads Kiilerich <madski@unity3d.com>
parents: 3325
diff changeset
215
3325
c5dde6b5e976 pull request: only bind action to other_repo change once
Mads Kiilerich <madski@unity3d.com>
parents: 3322
diff changeset
216 YUE.on('other_repo', 'change', function(e){
3514
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
217 otherrepoChanged();
3326
5ef64956c385 pull request: update changeset list automatically - remove refresh icon
Mads Kiilerich <madski@unity3d.com>
parents: 3325
diff changeset
218 loadPreview();
3325
c5dde6b5e976 pull request: only bind action to other_repo change once
Mads Kiilerich <madski@unity3d.com>
parents: 3322
diff changeset
219 });
c5dde6b5e976 pull request: only bind action to other_repo change once
Mads Kiilerich <madski@unity3d.com>
parents: 3322
diff changeset
220
3326
5ef64956c385 pull request: update changeset list automatically - remove refresh icon
Mads Kiilerich <madski@unity3d.com>
parents: 3325
diff changeset
221 YUE.on('other_ref', 'change', function(e){
5ef64956c385 pull request: update changeset list automatically - remove refresh icon
Mads Kiilerich <madski@unity3d.com>
parents: 3325
diff changeset
222 loadPreview();
5ef64956c385 pull request: update changeset list automatically - remove refresh icon
Mads Kiilerich <madski@unity3d.com>
parents: 3325
diff changeset
223 });
2434
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2396
diff changeset
224
3514
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
225 otherrepoChanged();
2434
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2396
diff changeset
226 //lazy load overview after 0.5s
3514
ba2cbb642c3e pullrequest: separate js actions for 'update preview' from 'destination repo changed'
Mads Kiilerich <madski@unity3d.com>
parents: 3513
diff changeset
227 setTimeout(loadPreview, 500);
2434
f29469677319 Added basic models for saving open pull requests
Marcin Kuzminski <marcin@python-works.com>
parents: 2396
diff changeset
228
2395
b262e349a7a5 created pull-request overview
Marcin Kuzminski <marcin@python-works.com>
parents: 2244
diff changeset
229 </script>
b262e349a7a5 created pull-request overview
Marcin Kuzminski <marcin@python-works.com>
parents: 2244
diff changeset
230
2244
77e376fdc4c6 pull requests draft UI
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
231 </%def>