##// END OF EJS Templates
pull requests: show pull url with revision to merge the pull request
marcink -
r4047:3608f15f default
parent child Browse files
Show More
@@ -1,252 +1,257
1 1 <%inherit file="/base/base.html"/>
2 2
3 3 <%def name="title()">
4 4 ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)} &middot; ${c.rhodecode_name}
5 5 </%def>
6 6
7 7 <%def name="breadcrumbs_links()">
8 8 ${_('Pull request #%s') % c.pull_request.pull_request_id}
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.repo_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 22
23 23 <h3 class="${'closed' if c.pull_request.is_closed() else ''}">
24 24 <img src="${h.url('/images/icons/flag_status_%s.png' % str(c.pull_request.last_review_status))}" />
25 25 ${_('Title')}: ${c.pull_request.title}
26 26 %if c.pull_request.is_closed():
27 27 (${_('Closed')})
28 28 %endif
29 29 </h3>
30 30
31 31 <div class="form">
32 32 <div id="summary" class="fields">
33 33 <div class="field">
34 34 <div class="label-summary">
35 35 <label>${_('Review status')}:</label>
36 36 </div>
37 37 <div class="input">
38 38 <div class="changeset-status-container" style="float:none;clear:both">
39 39 %if c.current_changeset_status:
40 40 <div title="${_('Pull request status')}" class="changeset-status-lbl">
41 41 %if c.pull_request.is_closed():
42 42 ${_('Closed')},
43 43 %endif
44 44 ${h.changeset_status_lbl(c.current_changeset_status)}
45 45 </div>
46 46 <div class="changeset-status-ico" style="padding:1px 4px"><img src="${h.url('/images/icons/flag_status_%s.png' % c.current_changeset_status)}" /></div>
47 47 %endif
48 48 </div>
49 49 </div>
50 50 </div>
51 51 <div class="field">
52 52 <div class="label-summary">
53 53 <label>${_('Still not reviewed by')}:</label>
54 54 </div>
55 55 <div class="input">
56 56 % if len(c.pull_request_pending_reviewers) > 0:
57 57 <div class="tooltip" title="${h.tooltip(', '.join([x.username for x in c.pull_request_pending_reviewers]))}">${ungettext('%d reviewer', '%d reviewers',len(c.pull_request_pending_reviewers)) % len(c.pull_request_pending_reviewers)}</div>
58 58 %else:
59 59 <div>${_('Pull request was reviewed by all reviewers')}</div>
60 60 %endif
61 61 </div>
62 62 </div>
63 63 <div class="field">
64 64 <div class="label-summary">
65 65 <label>${_('Origin repository')}:</label>
66 66 </div>
67 67 <div class="input">
68 68 <div>
69 69 ##%if h.is_hg(c.pull_request.org_repo):
70 70 ## <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
71 71 ##%elif h.is_git(c.pull_request.org_repo):
72 72 ## <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
73 73 ##%endif
74 74 <span class="spantag">${c.pull_request.org_ref_parts[0]}: ${c.pull_request.org_ref_parts[1]}</span>
75 <span><a href="${h.url('summary_home', repo_name=c.pull_request.org_repo.repo_name)}">${c.pull_request.org_repo.clone_url()}</a></span>
75 <span>
76 %if h.is_hg(c.pull_request.org_repo):
77 | ${_('Pull changes')} <span style="font-family: monospace">hg pull -r ${h.short_id(c.cs_ranges[-1].raw_id)} <a href="${h.url('summary_home', repo_name=c.pull_request.org_repo.repo_name)}">${c.pull_request.org_repo.clone_url()}</a></span>
78 %elif h.is_git(c.pull_request.org_repo):
79 | ${_('Pull changes')}
80 %endif
76 81 </div>
77 82 </div>
78 83 </div>
79 84 <div class="field">
80 85 <div class="label-summary">
81 86 <label>${_('Description')}:</label>
82 87 </div>
83 88 <div class="input">
84 89 <div style="white-space:pre-wrap">${h.urlify_commit(c.pull_request.description)}</div>
85 90 </div>
86 91 </div>
87 92 <div class="field">
88 93 <div class="label-summary">
89 94 <label>${_('Created on')}:</label>
90 95 </div>
91 96 <div class="input">
92 97 <div>${h.fmt_date(c.pull_request.created_on)}</div>
93 98 </div>
94 99 </div>
95 100 </div>
96 101 </div>
97 102
98 103 <div style="overflow: auto;">
99 104 ##DIFF
100 105 <div class="table" style="float:left;clear:none">
101 106 <div id="body" class="diffblock">
102 107 <div style="white-space:pre-wrap;padding:5px">${_('Compare view')}</div>
103 108 </div>
104 109 <div id="changeset_compare_view_content">
105 110 ##CS
106 111 <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${ungettext('Showing %s commit','Showing %s commits', len(c.cs_ranges)) % len(c.cs_ranges)}</div>
107 112 <%include file="/compare/compare_cs.html" />
108 113
109 114 ## FILES
110 115 <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">
111 116
112 117 % if c.limited_diff:
113 118 ${ungettext('%s file changed', '%s files changed', len(c.files)) % len(c.files)}
114 119 % else:
115 120 ${ungettext('%s file changed with %s insertions and %s deletions','%s files changed with %s insertions and %s deletions', len(c.files)) % (len(c.files),c.lines_added,c.lines_deleted)}:
116 121 %endif
117 122
118 123 </div>
119 124 <div class="cs_files">
120 125 %if not c.files:
121 126 <span class="empty_data">${_('No files')}</span>
122 127 %endif
123 128 %for fid, change, f, stat in c.files:
124 129 <div class="cs_${change}">
125 130 <div class="node">${h.link_to(h.safe_unicode(f),h.url.current(anchor=fid))}</div>
126 131 <div class="changes">${h.fancy_file_stats(stat)}</div>
127 132 </div>
128 133 %endfor
129 134 </div>
130 135 % if c.limited_diff:
131 136 <h5>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("Showing a huge diff might take some time and resources")}')">${_('Show full diff')}</a></h5>
132 137 % endif
133 138 </div>
134 139 </div>
135 140 ## REVIEWERS
136 141 <div style="float:left; border-left:1px dashed #eee">
137 142 <h4>${_('Pull request reviewers')}</h4>
138 143 <div id="reviewers" style="padding:0px 0px 5px 10px">
139 144 ## members goes here !
140 145 <div class="group_members_wrap" style="min-height:45px">
141 146 <ul id="review_members" class="group_members">
142 147 %for member,status in c.pull_request_reviewers:
143 148 <li id="reviewer_${member.user_id}">
144 149 <div class="reviewers_member">
145 150 <div style="float:left;padding:0px 3px 0px 0px" class="tooltip" title="${h.tooltip(h.changeset_status_lbl(status[0][1].status if status else 'not_reviewed'))}">
146 151 <img src="${h.url(str('/images/icons/flag_status_%s.png' % (status[0][1].status if status else 'not_reviewed')))}"/>
147 152 </div>
148 153 <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(member.email,14)}"/> </div>
149 154 <div style="float:left">${member.full_name} (${_('owner') if c.pull_request.user_id == member.user_id else _('reviewer')})</div>
150 155 <input type="hidden" value="${member.user_id}" name="review_members" />
151 156 %if not c.pull_request.is_closed() and (h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.user_id == c.rhodecode_user.user_id):
152 157 <span class="delete_icon action_button" onclick="removeReviewMember(${member.user_id})"></span>
153 158 %endif
154 159 </div>
155 160 </li>
156 161 %endfor
157 162 </ul>
158 163 </div>
159 164 %if not c.pull_request.is_closed():
160 165 <div class='ac'>
161 166 %if h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.author.user_id == c.rhodecode_user.user_id:
162 167 <div class="reviewer_ac">
163 168 ${h.text('user', class_='yui-ac-input')}
164 169 <span class="help-block">${_('Add or remove reviewer to this pull request.')}</span>
165 170 <div id="reviewers_container"></div>
166 171 </div>
167 172 <div style="padding:0px 10px">
168 173 <span id="update_pull_request" class="ui-btn xsmall">${_('Save changes')}</span>
169 174 </div>
170 175 %endif
171 176 </div>
172 177 %endif
173 178 </div>
174 179 </div>
175 180 </div>
176 181 <script>
177 182 var _USERS_AC_DATA = ${c.users_array|n};
178 183 var _GROUPS_AC_DATA = ${c.users_groups_array|n};
179 184 // TODO: switch this to pyroutes
180 185 AJAX_COMMENT_URL = "${url('pullrequest_comment',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id)}";
181 186 AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
182 187
183 188 pyroutes.register('pullrequest_comment', "${url('pullrequest_comment',repo_name='%(repo_name)s',pull_request_id='%(pull_request_id)s')}", ['repo_name', 'pull_request_id']);
184 189 pyroutes.register('pullrequest_comment_delete', "${url('pullrequest_comment_delete',repo_name='%(repo_name)s',comment_id='%(comment_id)s')}", ['repo_name', 'comment_id']);
185 190 pyroutes.register('pullrequest_update', "${url('pullrequest_update',repo_name='%(repo_name)s',pull_request_id='%(pull_request_id)s')}", ['repo_name', 'pull_request_id']);
186 191
187 192 </script>
188 193
189 194 ## diff block
190 195 <%namespace name="diff_block" file="/changeset/diff_block.html"/>
191 196 %for fid, change, f, stat in c.files:
192 197 ${diff_block.diff_block_simple([c.changes[fid]])}
193 198 %endfor
194 199 % if c.limited_diff:
195 200 <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("Showing a huge diff might take some time and resources")}')">${_('Show full diff')}</a></h4>
196 201 % endif
197 202
198 203
199 204 ## template for inline comment form
200 205 <%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
201 206 ${comment.comment_inline_form()}
202 207
203 208 ## render comments and inlines
204 209 ${comment.generate_comments(include_pr=True)}
205 210
206 211 % if not c.pull_request.is_closed():
207 212 ## main comment form and it status
208 213 ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name,
209 214 pull_request_id=c.pull_request.pull_request_id),
210 215 c.current_changeset_status,
211 216 close_btn=True, change_status=c.allowed_to_change_status)}
212 217 %endif
213 218
214 219 <script type="text/javascript">
215 220 YUE.onDOMReady(function(){
216 221 PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA);
217 222
218 223 YUE.on(YUQ('.show-inline-comments'),'change',function(e){
219 224 var show = 'none';
220 225 var target = e.currentTarget;
221 226 if(target.checked){
222 227 var show = ''
223 228 }
224 229 var boxid = YUD.getAttribute(target,'id_for');
225 230 var comments = YUQ('#{0} .inline-comments'.format(boxid));
226 231 for(c in comments){
227 232 YUD.setStyle(comments[c],'display',show);
228 233 }
229 234 var btns = YUQ('#{0} .inline-comments-button'.format(boxid));
230 235 for(c in btns){
231 236 YUD.setStyle(btns[c],'display',show);
232 237 }
233 238 })
234 239
235 240 YUE.on(YUQ('.line'),'click',function(e){
236 241 var tr = e.currentTarget;
237 242 injectInlineForm(tr);
238 243 });
239 244
240 245 // inject comments into they proper positions
241 246 var file_comments = YUQ('.inline-comment-placeholder');
242 247 renderInlineComments(file_comments);
243 248
244 249 YUE.on(YUD.get('update_pull_request'),'click',function(e){
245 250 updateReviewers(undefined, "${c.repo_name}", "${c.pull_request.pull_request_id}");
246 251 })
247 252 })
248 253 </script>
249 254
250 255 </div>
251 256
252 257 </%def>
General Comments 0
You need to be logged in to leave comments. Login now