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