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