Show More
@@ -1,209 +1,229 | |||
|
1 | 1 | <%inherit file="/base/base.html"/> |
|
2 | 2 | |
|
3 | 3 | <%def name="title()"> |
|
4 | 4 | ${c.repo_name} ${_('New pull request')} |
|
5 | 5 | </%def> |
|
6 | 6 | |
|
7 | 7 | <%def name="breadcrumbs_links()"> |
|
8 | 8 | ${_('New pull request')} |
|
9 | 9 | </%def> |
|
10 | 10 | |
|
11 | 11 | <%def name="page_nav()"> |
|
12 | 12 | ${self.menu('repositories')} |
|
13 | 13 | </%def> |
|
14 | 14 | |
|
15 | 15 | <%def name="main()"> |
|
16 | 16 | ${self.context_bar('showpullrequest')} |
|
17 | 17 | <div class="box"> |
|
18 | 18 | <!-- box / title --> |
|
19 | 19 | <div class="title"> |
|
20 | 20 | ${self.breadcrumbs()} |
|
21 | 21 | </div> |
|
22 | ${h.form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')} | |
|
23 | <div style="float:left;padding:0px 30px 30px 30px"> | |
|
24 | ##ORG | |
|
25 | <div style="float:left"> | |
|
26 | <div> | |
|
27 | <span style="font-size: 20px"> | |
|
28 | ${h.select('org_repo','',c.org_repos,class_='refs')}:${h.select('org_ref',c.default_org_ref,c.org_refs,class_='refs')} | |
|
29 | </span> | |
|
30 | <div style="padding:5px 3px 3px 20px;">${c.rhodecode_db_repo.description}</div> | |
|
31 | </div> | |
|
32 | <div style="clear:both;padding-top: 10px"></div> | |
|
33 | </div> | |
|
34 | <div style="float:left;font-size:24px;padding:0px 20px"> | |
|
35 | <img height=32 width=32 src="${h.url('/images/arrow_right_64.png')}"/> | |
|
36 | </div> | |
|
37 | 22 | |
|
38 | ##OTHER, most Probably the PARENT OF THIS FORK | |
|
39 | <div style="float:left"> | |
|
40 | <div> | |
|
41 | <span style="font-size: 20px"> | |
|
42 | ${h.select('other_repo',c.default_other_repo,c.other_repos,class_='refs')}:${c.default_other_repo_info['revs']} | |
|
43 | </span> | |
|
44 | <div id="other_repo_desc" style="padding:5px 3px 3px 20px;"></div> | |
|
45 | </div> | |
|
46 | <div style="clear:both;padding-top: 10px"></div> | |
|
47 | </div> | |
|
48 | <div style="clear:both;padding-top: 10px"></div> | |
|
49 | ## overview pulled by ajax | |
|
50 | <div style="float:left" id="pull_request_overview"></div> | |
|
51 | <div style="float:left;clear:both;padding:10px 10px 10px 0px;display:none"> | |
|
52 | <a id="pull_request_overview_url" href="#">${_('Detailed compare view')}</a> | |
|
53 | </div> | |
|
54 | </div> | |
|
55 | <div style="float:left; border-left:1px dashed #eee"> | |
|
56 | <h4>${_('Pull request reviewers')}</h4> | |
|
57 | <div id="reviewers" style="padding:0px 0px 0px 15px"> | |
|
58 | ## members goes here ! | |
|
59 | <div class="group_members_wrap"> | |
|
60 | <ul id="review_members" class="group_members"> | |
|
61 | %for member in [c.default_other_repo_info['user']]: | |
|
62 | <li id="reviewer_${member['user_id']}"> | |
|
63 | <div class="reviewers_member"> | |
|
64 | <div class="gravatar"><img alt="gravatar" src="${member['gravatar_link']}"/> </div> | |
|
65 | <div style="float:left">${member['firstname']} ${member['lastname']} (${_('owner')})</div> | |
|
66 | <input type="hidden" value="${member['user_id']}" name="review_members" /> | |
|
67 | <span class="delete_icon action_button" onclick="removeReviewMember(${member['user_id']})"></span> | |
|
68 | </div> | |
|
69 | </li> | |
|
70 | %endfor | |
|
71 | </ul> | |
|
72 | </div> | |
|
23 | ${h.form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')} | |
|
73 | 24 | |
|
74 | <div class='ac'> | |
|
75 | <div class="reviewer_ac"> | |
|
76 | ${h.text('user', class_='yui-ac-input')} | |
|
77 | <span class="help-block">${_('Add reviewer to this pull request.')}</span> | |
|
78 | <div id="reviewers_container"></div> | |
|
79 | </div> | |
|
80 | </div> | |
|
81 | </div> | |
|
82 | </div> | |
|
83 | 25 | <h3>${_('Create new pull request')}</h3> |
|
84 | 26 | |
|
85 | 27 | <div class="form"> |
|
86 | 28 | <!-- fields --> |
|
87 | 29 | |
|
88 | <div class="fields"> | |
|
30 | <div class="fields" style="float:left;width:50%;padding-right:30px;"> | |
|
89 | 31 | |
|
90 | 32 | <div class="field"> |
|
91 | 33 | <div class="label"> |
|
92 | 34 | <label for="pullrequest_title">${_('Title')}:</label> |
|
93 | 35 | </div> |
|
94 | 36 | <div class="input"> |
|
95 | 37 | ${h.text('pullrequest_title',size=30)} |
|
96 | 38 | </div> |
|
97 | 39 | </div> |
|
98 | 40 | |
|
99 | 41 | <div class="field"> |
|
100 | 42 | <div class="label label-textarea"> |
|
101 | 43 | <label for="pullrequest_desc">${_('Description')}:</label> |
|
102 | 44 | </div> |
|
103 | 45 | <div class="textarea text-area editor"> |
|
104 | 46 | ${h.textarea('pullrequest_desc',size=30)} |
|
105 | 47 | </div> |
|
106 | 48 | </div> |
|
107 | 49 | |
|
108 |
<div class=" |
|
|
109 | ${h.submit('save',_('Send pull request'),class_="ui-btn large")} | |
|
110 | ${h.reset('reset',_('Reset'),class_="ui-btn large")} | |
|
50 | <div class="field"> | |
|
51 | <div class="label label-textarea"> | |
|
52 | <label for="pullrequest_desc">${_('Changeset flow')}:</label> | |
|
53 | </div> | |
|
54 | <div class="input"> | |
|
55 | ##ORG | |
|
56 | <div style="float:left"> | |
|
57 | <div> | |
|
58 | <span style="font-size: 20px"> | |
|
59 | ${h.select('org_repo','',c.org_repos,class_='refs')}:${h.select('org_ref',c.default_org_ref,c.org_refs,class_='refs')} | |
|
60 | </span> | |
|
61 | <div style="padding:5px 3px 3px 20px;">${c.rhodecode_db_repo.description}</div> | |
|
62 | </div> | |
|
63 | </div> | |
|
64 | <div style="float:left;font-size:24px;padding:0px 20px"> | |
|
65 | <img height=32 width=32 src="${h.url('/images/arrow_right_64.png')}"/> | |
|
66 | </div> | |
|
67 | ||
|
68 | ##OTHER, most Probably the PARENT OF THIS FORK | |
|
69 | <div style="float:left"> | |
|
70 | <div> | |
|
71 | <span style="font-size: 20px"> | |
|
72 | ${h.select('other_repo',c.default_other_repo,c.other_repos,class_='refs')}:${c.default_other_repo_info['revs']} | |
|
73 | </span> | |
|
74 | <div id="other_repo_desc" style="padding:5px 3px 3px 20px;"></div> | |
|
75 | </div> | |
|
76 | </div> | |
|
77 | <div style="clear:both"></div> | |
|
78 | </div> | |
|
79 | </div> | |
|
80 | ||
|
81 | <div class="field"> | |
|
82 | <div class="buttons"> | |
|
83 | ${h.submit('save',_('Send pull request'),class_="ui-btn large")} | |
|
84 | ${h.reset('reset',_('Reset'),class_="ui-btn large")} | |
|
85 | </div> | |
|
86 | </div> | |
|
87 | ||
|
88 | </div> | |
|
89 | ||
|
90 | ## Reviewers | |
|
91 | <div style="float:left; border-left:1px dashed #eee"> | |
|
92 | <h4>${_('Pull request reviewers')}</h4> | |
|
93 | <div id="reviewers" style="padding:0px 0px 0px 15px"> | |
|
94 | ## members goes here ! | |
|
95 | <div class="group_members_wrap"> | |
|
96 | <ul id="review_members" class="group_members"> | |
|
97 | %for member in [c.default_other_repo_info['user']]: | |
|
98 | <li id="reviewer_${member['user_id']}"> | |
|
99 | <div class="reviewers_member"> | |
|
100 | <div class="gravatar"><img alt="gravatar" src="${member['gravatar_link']}"/> </div> | |
|
101 | <div style="float:left">${member['firstname']} ${member['lastname']} (${_('owner')})</div> | |
|
102 | <input type="hidden" value="${member['user_id']}" name="review_members" /> | |
|
103 | <span class="delete_icon action_button" onclick="removeReviewMember(${member['user_id']})"></span> | |
|
104 | </div> | |
|
105 | </li> | |
|
106 | %endfor | |
|
107 | </ul> | |
|
108 | </div> | |
|
109 | ||
|
110 | <div class='ac'> | |
|
111 | <div class="reviewer_ac"> | |
|
112 | ${h.text('user', class_='yui-ac-input')} | |
|
113 | <span class="help-block">${_('Add reviewer to this pull request.')}</span> | |
|
114 | <div id="reviewers_container"></div> | |
|
115 | </div> | |
|
116 | </div> | |
|
117 | </div> | |
|
118 | </div> | |
|
119 | ||
|
120 | <div style="clear:both;padding: 0 0 30px 0;"></div> | |
|
121 | ||
|
122 | <h4>${_('Changesets')}</h4> | |
|
123 | <div style="float:left;padding:0px 30px 30px 30px"> | |
|
124 | ## overview pulled by ajax | |
|
125 | <div style="float:left" id="pull_request_overview"></div> | |
|
126 | <div style="float:left;clear:both;padding:10px 10px 10px 0px;display:none"> | |
|
127 | <a id="pull_request_overview_url" href="#">${_('Detailed compare view')}</a> | |
|
111 | 128 | </div> |
|
112 | 129 | </div> |
|
130 | <div style="clear:both;"></div> | |
|
131 | ||
|
113 | 132 | </div> |
|
133 | ||
|
114 | 134 | ${h.end_form()} |
|
115 | 135 | |
|
116 | 136 | </div> |
|
117 | 137 | |
|
118 | 138 | <script type="text/javascript"> |
|
119 | 139 | var _USERS_AC_DATA = ${c.users_array|n}; |
|
120 | 140 | var _GROUPS_AC_DATA = ${c.users_groups_array|n}; |
|
121 | 141 | PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA); |
|
122 | 142 | |
|
123 | 143 | var other_repos_info = ${c.other_repos_info|n}; |
|
124 | 144 | |
|
125 | 145 | var otherrepoChanged = function(){ |
|
126 | 146 | var sel_box = YUQ('#pull_request_form #other_repo')[0]; |
|
127 | 147 | var repo_name = sel_box.options[sel_box.selectedIndex].value; |
|
128 | 148 | |
|
129 | 149 | YUD.get('other_repo_desc').innerHTML = other_repos_info[repo_name]['description']; |
|
130 | 150 | // replace options of other_ref with the ones for the current other_repo |
|
131 | 151 | var other_ref_selector = YUD.get('other_ref'); |
|
132 | 152 | var new_select = YUD.createElementFromMarkup(other_repos_info[repo_name]['revs']); |
|
133 | 153 | var new_selectedIndex = new_select.selectedIndex; |
|
134 | 154 | other_ref_selector.innerHTML = ""; // clear old options |
|
135 | 155 | while (new_select.length > 0){ // children will be popped when appened to other_ref_selector |
|
136 | 156 | other_ref_selector.appendChild(new_select.children[0]); |
|
137 | 157 | } |
|
138 | 158 | // browsers lost track of selected when appendChild was used |
|
139 | 159 | other_ref_selector.selectedIndex = new_selectedIndex; |
|
140 | 160 | |
|
141 | 161 | // reset && add the reviewer based on selected repo |
|
142 | 162 | var _data = other_repos_info[repo_name]; |
|
143 | 163 | YUD.get('review_members').innerHTML = ''; |
|
144 | 164 | addReviewMember(_data.user.user_id, _data.user.firstname, |
|
145 | 165 | _data.user.lastname, _data.user.username, |
|
146 | 166 | _data.user.gravatar_link); |
|
147 | 167 | } |
|
148 | 168 | |
|
149 | 169 | var loadPreview = function(){ |
|
150 | 170 | //url template |
|
151 | 171 | var url = "${h.url('compare_url', |
|
152 | 172 | repo_name='__other_repo__', |
|
153 | 173 | org_ref_type='__other_ref_type__', |
|
154 | 174 | org_ref='__other_ref__', |
|
155 | 175 | other_repo='__org_repo__', |
|
156 | 176 | other_ref_type='__org_ref_type__', |
|
157 | 177 | other_ref='__org_ref__', |
|
158 | 178 | as_form=True, |
|
159 | 179 | merge=True, |
|
160 | 180 | )}"; |
|
161 | 181 | var org_repo = YUQ('#pull_request_form #org_repo')[0].value; |
|
162 | 182 | var org_ref = YUQ('#pull_request_form #org_ref')[0].value.split(':'); |
|
163 | 183 | |
|
164 | 184 | var other_repo = YUQ('#pull_request_form #other_repo')[0].value; |
|
165 | 185 | var other_ref = YUQ('#pull_request_form #other_ref')[0].value.split(':'); |
|
166 | 186 | |
|
167 | 187 | var select_refs = YUQ('#pull_request_form select.refs') |
|
168 | 188 | var rev_data = { |
|
169 | 189 | 'org_repo': org_repo, |
|
170 | 190 | 'org_ref': org_ref[2], |
|
171 | 191 | 'org_ref_type': 'rev', |
|
172 | 192 | 'other_repo': other_repo, |
|
173 | 193 | 'other_ref': other_ref[2], |
|
174 | 194 | 'other_ref_type': 'rev', |
|
175 | 195 | }; // gather the org/other ref and repo here |
|
176 | 196 | |
|
177 | 197 | for (k in rev_data){ |
|
178 | 198 | url = url.replace('__'+k+'__',rev_data[k]); |
|
179 | 199 | } |
|
180 | 200 | |
|
181 | 201 | YUD.get('pull_request_overview').innerHTML = "${_('Loading ...')}"; |
|
182 | 202 | ypjax(url,'pull_request_overview'); |
|
183 | 203 | |
|
184 | 204 | YUD.get('pull_request_overview_url').href = url; // shouldn't have as_form ... but ... |
|
185 | 205 | YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display',''); |
|
186 | 206 | } |
|
187 | 207 | |
|
188 | 208 | ## refresh automatically when something changes (org_repo can't change) |
|
189 | 209 | |
|
190 | 210 | YUE.on('org_ref', 'change', function(e){ |
|
191 | 211 | loadPreview(); |
|
192 | 212 | }); |
|
193 | 213 | |
|
194 | 214 | YUE.on('other_repo', 'change', function(e){ |
|
195 | 215 | otherrepoChanged(); |
|
196 | 216 | loadPreview(); |
|
197 | 217 | }); |
|
198 | 218 | |
|
199 | 219 | YUE.on('other_ref', 'change', function(e){ |
|
200 | 220 | loadPreview(); |
|
201 | 221 | }); |
|
202 | 222 | |
|
203 | 223 | otherrepoChanged(); |
|
204 | 224 | //lazy load overview after 0.5s |
|
205 | 225 | setTimeout(loadPreview, 500); |
|
206 | 226 | |
|
207 | 227 | </script> |
|
208 | 228 | |
|
209 | 229 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now