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