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