##// END OF EJS Templates
Show that all reviewers reviewed pull request
marcink -
r2883:b1822f4a beta
parent child Browse files
Show More
@@ -1,195 +1,199 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 <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>
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>
49 %else:
50 <div>${_('pull request was reviewed by all reviewers')}</div>
51 %endif
48 </div>
52 </div>
49 </div>
53 </div>
50 </div>
54 </div>
51 </div>
55 </div>
52 <div style="white-space:pre-wrap;padding:3px 3px 5px 20px">${h.literal(c.pull_request.description)}</div>
56 <div style="white-space:pre-wrap;padding:3px 3px 5px 20px">${h.literal(c.pull_request.description)}</div>
53 <div style="padding:4px 4px 10px 20px">
57 <div style="padding:4px 4px 10px 20px">
54 <div>${_('Created on')}: ${h.fmt_date(c.pull_request.created_on)}</div>
58 <div>${_('Created on')}: ${h.fmt_date(c.pull_request.created_on)}</div>
55 </div>
59 </div>
56
60
57 <div style="min-height:160px">
61 <div style="min-height:160px">
58 ##DIFF
62 ##DIFF
59 <div class="table" style="float:left;clear:none">
63 <div class="table" style="float:left;clear:none">
60 <div id="body" class="diffblock">
64 <div id="body" class="diffblock">
61 <div style="white-space:pre-wrap;padding:5px">${_('Compare view')}</div>
65 <div style="white-space:pre-wrap;padding:5px">${_('Compare view')}</div>
62 </div>
66 </div>
63 <div id="changeset_compare_view_content">
67 <div id="changeset_compare_view_content">
64 ##CS
68 ##CS
65 <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Incoming changesets')}</div>
69 <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Incoming changesets')}</div>
66 <%include file="/compare/compare_cs.html" />
70 <%include file="/compare/compare_cs.html" />
67
71
68 ## FILES
72 ## FILES
69 <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Files affected')}</div>
73 <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Files affected')}</div>
70 <div class="cs_files">
74 <div class="cs_files">
71 %for fid, change, f, stat in c.files:
75 %for fid, change, f, stat in c.files:
72 <div class="cs_${change}">
76 <div class="cs_${change}">
73 <div class="node">${h.link_to(h.safe_unicode(f),h.url.current(anchor=fid))}</div>
77 <div class="node">${h.link_to(h.safe_unicode(f),h.url.current(anchor=fid))}</div>
74 <div class="changes">${h.fancy_file_stats(stat)}</div>
78 <div class="changes">${h.fancy_file_stats(stat)}</div>
75 </div>
79 </div>
76 %endfor
80 %endfor
77 </div>
81 </div>
78 </div>
82 </div>
79 </div>
83 </div>
80 ## REVIEWERS
84 ## REVIEWERS
81 <div style="float:left; border-left:1px dashed #eee">
85 <div style="float:left; border-left:1px dashed #eee">
82 <h4>${_('Pull request reviewers')}</h4>
86 <h4>${_('Pull request reviewers')}</h4>
83 <div id="reviewers" style="padding:0px 0px 0px 15px">
87 <div id="reviewers" style="padding:0px 0px 0px 15px">
84 ## members goes here !
88 ## members goes here !
85 <div class="group_members_wrap">
89 <div class="group_members_wrap">
86 <ul id="review_members" class="group_members">
90 <ul id="review_members" class="group_members">
87 %for member,status in c.pull_request_reviewers:
91 %for member,status in c.pull_request_reviewers:
88 <li id="reviewer_${member.user_id}">
92 <li id="reviewer_${member.user_id}">
89 <div class="reviewers_member">
93 <div class="reviewers_member">
90 <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'))}">
94 <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'))}">
91 <img src="${h.url(str('/images/icons/flag_status_%s.png' % (status[0][1].status if status else 'not_reviewed')))}"/>
95 <img src="${h.url(str('/images/icons/flag_status_%s.png' % (status[0][1].status if status else 'not_reviewed')))}"/>
92 </div>
96 </div>
93 <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(member.email,14)}"/> </div>
97 <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(member.email,14)}"/> </div>
94 <div style="float:left">${member.full_name} (${_('owner')})</div>
98 <div style="float:left">${member.full_name} (${_('owner')})</div>
95 <input type="hidden" value="${member.user_id}" name="review_members" />
99 <input type="hidden" value="${member.user_id}" name="review_members" />
96 %if not c.pull_request.is_closed() and (h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.author.user_id == c.rhodecode_user.user_id):
100 %if not c.pull_request.is_closed() and (h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.author.user_id == c.rhodecode_user.user_id):
97 <span class="delete_icon action_button" onclick="removeReviewer(${member.user_id})"></span>
101 <span class="delete_icon action_button" onclick="removeReviewer(${member.user_id})"></span>
98 %endif
102 %endif
99 </div>
103 </div>
100 </li>
104 </li>
101 %endfor
105 %endfor
102 </ul>
106 </ul>
103 </div>
107 </div>
104 %if not c.pull_request.is_closed():
108 %if not c.pull_request.is_closed():
105 <div class='ac'>
109 <div class='ac'>
106 %if h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.author.user_id == c.rhodecode_user.user_id:
110 %if h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.author.user_id == c.rhodecode_user.user_id:
107 <div class="reviewer_ac">
111 <div class="reviewer_ac">
108 ${h.text('user', class_='yui-ac-input')}
112 ${h.text('user', class_='yui-ac-input')}
109 <span class="help-block">${_('Add reviewer to this pull request.')}</span>
113 <span class="help-block">${_('Add reviewer to this pull request.')}</span>
110 <div id="reviewers_container"></div>
114 <div id="reviewers_container"></div>
111 </div>
115 </div>
112 <div style="padding:0px 10px">
116 <div style="padding:0px 10px">
113 <span id="update_pull_request" class="ui-btn xsmall">${_('save')}</span>
117 <span id="update_pull_request" class="ui-btn xsmall">${_('save')}</span>
114 </div>
118 </div>
115 %endif
119 %endif
116 </div>
120 </div>
117 %endif
121 %endif
118 </div>
122 </div>
119 </div>
123 </div>
120 </div>
124 </div>
121 <script>
125 <script>
122 var _USERS_AC_DATA = ${c.users_array|n};
126 var _USERS_AC_DATA = ${c.users_array|n};
123 var _GROUPS_AC_DATA = ${c.users_groups_array|n};
127 var _GROUPS_AC_DATA = ${c.users_groups_array|n};
124 AJAX_COMMENT_URL = "${url('pullrequest_comment',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id)}";
128 AJAX_COMMENT_URL = "${url('pullrequest_comment',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id)}";
125 AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
129 AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";
126 AJAX_UPDATE_PULLREQUEST = "${url('pullrequest_update',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id)}"
130 AJAX_UPDATE_PULLREQUEST = "${url('pullrequest_update',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id)}"
127 </script>
131 </script>
128
132
129 ## diff block
133 ## diff block
130 <%namespace name="diff_block" file="/changeset/diff_block.html"/>
134 <%namespace name="diff_block" file="/changeset/diff_block.html"/>
131 %for fid, change, f, stat in c.files:
135 %for fid, change, f, stat in c.files:
132 ${diff_block.diff_block_simple([c.changes[fid]])}
136 ${diff_block.diff_block_simple([c.changes[fid]])}
133 %endfor
137 %endfor
134
138
135 ## template for inline comment form
139 ## template for inline comment form
136 <%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
140 <%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
137 ${comment.comment_inline_form()}
141 ${comment.comment_inline_form()}
138
142
139 ## render comments and inlines
143 ## render comments and inlines
140 ${comment.generate_comments()}
144 ${comment.generate_comments()}
141
145
142 % if not c.pull_request.is_closed():
146 % if not c.pull_request.is_closed():
143 ## main comment form and it status
147 ## main comment form and it status
144 ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name,
148 ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name,
145 pull_request_id=c.pull_request.pull_request_id),
149 pull_request_id=c.pull_request.pull_request_id),
146 c.current_changeset_status,
150 c.current_changeset_status,
147 close_btn=True)}
151 close_btn=True)}
148 %endif
152 %endif
149
153
150 <script type="text/javascript">
154 <script type="text/javascript">
151 YUE.onDOMReady(function(){
155 YUE.onDOMReady(function(){
152 PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA);
156 PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA);
153
157
154 YUE.on(YUQ('.show-inline-comments'),'change',function(e){
158 YUE.on(YUQ('.show-inline-comments'),'change',function(e){
155 var show = 'none';
159 var show = 'none';
156 var target = e.currentTarget;
160 var target = e.currentTarget;
157 if(target.checked){
161 if(target.checked){
158 var show = ''
162 var show = ''
159 }
163 }
160 var boxid = YUD.getAttribute(target,'id_for');
164 var boxid = YUD.getAttribute(target,'id_for');
161 var comments = YUQ('#{0} .inline-comments'.format(boxid));
165 var comments = YUQ('#{0} .inline-comments'.format(boxid));
162 for(c in comments){
166 for(c in comments){
163 YUD.setStyle(comments[c],'display',show);
167 YUD.setStyle(comments[c],'display',show);
164 }
168 }
165 var btns = YUQ('#{0} .inline-comments-button'.format(boxid));
169 var btns = YUQ('#{0} .inline-comments-button'.format(boxid));
166 for(c in btns){
170 for(c in btns){
167 YUD.setStyle(btns[c],'display',show);
171 YUD.setStyle(btns[c],'display',show);
168 }
172 }
169 })
173 })
170
174
171 YUE.on(YUQ('.line'),'click',function(e){
175 YUE.on(YUQ('.line'),'click',function(e){
172 var tr = e.currentTarget;
176 var tr = e.currentTarget;
173 injectInlineForm(tr);
177 injectInlineForm(tr);
174 });
178 });
175
179
176 // inject comments into they proper positions
180 // inject comments into they proper positions
177 var file_comments = YUQ('.inline-comment-placeholder');
181 var file_comments = YUQ('.inline-comment-placeholder');
178 renderInlineComments(file_comments);
182 renderInlineComments(file_comments);
179
183
180 YUE.on(YUD.get('update_pull_request'),'click',function(e){
184 YUE.on(YUD.get('update_pull_request'),'click',function(e){
181
185
182 var reviewers_ids = [];
186 var reviewers_ids = [];
183 var ids = YUQ('#review_members input');
187 var ids = YUQ('#review_members input');
184 for(var i=0; i<ids.length;i++){
188 for(var i=0; i<ids.length;i++){
185 var id = ids[i].value
189 var id = ids[i].value
186 reviewers_ids.push(id);
190 reviewers_ids.push(id);
187 }
191 }
188 updateReviewers(reviewers_ids);
192 updateReviewers(reviewers_ids);
189 })
193 })
190 })
194 })
191 </script>
195 </script>
192
196
193 </div>
197 </div>
194
198
195 </%def>
199 </%def>
General Comments 0
You need to be logged in to leave comments. Login now