Show More
@@ -1,195 +1,195 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | ## usage: |
|
2 | ## usage: | |
3 | ## <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
|
3 | ## <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> | |
4 | ## ${comment.comment_block(co)} |
|
4 | ## ${comment.comment_block(co)} | |
5 | ## |
|
5 | ## | |
6 | <%def name="comment_block(co)"> |
|
6 | <%def name="comment_block(co)"> | |
7 | <div class="comment" id="comment-${co.comment_id}" line="${co.line_no}"> |
|
7 | <div class="comment" id="comment-${co.comment_id}" line="${co.line_no}"> | |
8 | <div class="comment-wrapp"> |
|
8 | <div class="comment-wrapp"> | |
9 | <div class="meta"> |
|
9 | <div class="meta"> | |
10 | <div style="float:left"> <img src="${h.gravatar_url(co.author.email, 20)}" /> </div> |
|
10 | <div style="float:left"> <img src="${h.gravatar_url(co.author.email, 20)}" /> </div> | |
11 | <div class="user"> |
|
11 | <div class="user"> | |
12 | ${co.author.username} |
|
12 | ${co.author.username} | |
13 | </div> |
|
13 | </div> | |
14 | <div class="date"> |
|
14 | <div class="date"> | |
15 | ${h.age(co.modified_at)} <a class="permalink" href="#comment-${co.comment_id}">¶</a> |
|
15 | ${h.age(co.modified_at)} <a class="permalink" href="#comment-${co.comment_id}">¶</a> | |
16 | </div> |
|
16 | </div> | |
17 | %if co.status_change: |
|
17 | %if co.status_change: | |
18 | <div style="float:left" class="changeset-status-container"> |
|
18 | <div style="float:left" class="changeset-status-container"> | |
19 | <div style="float:left;padding:0px 2px 0px 2px"><span style="font-size: 18px;">›</span></div> |
|
19 | <div style="float:left;padding:0px 2px 0px 2px"><span style="font-size: 18px;">›</span></div> | |
20 | <div title="${_('Changeset status')}" class="changeset-status-lbl"> ${co.status_change[0].status_lbl}</div> |
|
20 | <div title="${_('Changeset status')}" class="changeset-status-lbl"> ${co.status_change[0].status_lbl}</div> | |
21 | <div class="changeset-status-ico"><img src="${h.url(str('/images/icons/flag_status_%s.png' % co.status_change[0].status))}" /></div> |
|
21 | <div class="changeset-status-ico"><img src="${h.url(str('/images/icons/flag_status_%s.png' % co.status_change[0].status))}" /></div> | |
22 | </div> |
|
22 | </div> | |
23 | %endif |
|
23 | %endif | |
24 |
|
24 | |||
25 | <div style="float:left;padding:3px 0px 0px 5px"> |
|
25 | <div style="float:left;padding:3px 0px 0px 5px"> | |
26 | <span class=""> |
|
26 | <span class=""> | |
27 | %if co.pull_request: |
|
27 | %if co.pull_request: | |
28 | <a href="${h.url('pullrequest_show',repo_name=co.pull_request.other_repo.repo_name,pull_request_id=co.pull_request.pull_request_id)}"> |
|
28 | <a href="${h.url('pullrequest_show',repo_name=co.pull_request.other_repo.repo_name,pull_request_id=co.pull_request.pull_request_id)}"> | |
29 | %if co.status_change: |
|
29 | %if co.status_change: | |
30 | ${_('Status from pull request %s') % co.pull_request.pull_request_id} |
|
30 | ${_('Status from pull request %s') % co.pull_request.pull_request_id} | |
31 | %else: |
|
31 | %else: | |
32 | ${_('Comment from pull request %s') % co.pull_request.pull_request_id} |
|
32 | ${_('Comment from pull request %s') % co.pull_request.pull_request_id} | |
33 | %endif |
|
33 | %endif | |
34 | </a> |
|
34 | </a> | |
35 | %endif |
|
35 | %endif | |
36 | </span> |
|
36 | </span> | |
37 | </div> |
|
37 | </div> | |
38 |
|
38 | |||
39 | %if h.HasPermissionAny('hg.admin', 'repository.admin')() or co.author.user_id == c.rhodecode_user.user_id: |
|
39 | %if h.HasPermissionAny('hg.admin', 'repository.admin')() or co.author.user_id == c.rhodecode_user.user_id: | |
40 | <div class="buttons"> |
|
40 | <div class="buttons"> | |
41 | <span onClick="deleteComment(${co.comment_id})" class="delete-comment ui-btn">${_('Delete')}</span> |
|
41 | <span onClick="deleteComment(${co.comment_id})" class="delete-comment ui-btn">${_('Delete')}</span> | |
42 | </div> |
|
42 | </div> | |
43 | %endif |
|
43 | %endif | |
44 | </div> |
|
44 | </div> | |
45 | <div class="text"> |
|
45 | <div class="text"> | |
46 | ${h.rst_w_mentions(co.text)|n} |
|
46 | ${h.rst_w_mentions(co.text)|n} | |
47 | </div> |
|
47 | </div> | |
48 | </div> |
|
48 | </div> | |
49 | </div> |
|
49 | </div> | |
50 | </%def> |
|
50 | </%def> | |
51 |
|
51 | |||
52 |
|
52 | |||
53 | <%def name="comment_inline_form()"> |
|
53 | <%def name="comment_inline_form()"> | |
54 | <div id='comment-inline-form-template' style="display:none"> |
|
54 | <div id='comment-inline-form-template' style="display:none"> | |
55 | <div class="comment-inline-form ac"> |
|
55 | <div class="comment-inline-form ac"> | |
56 | %if c.rhodecode_user.username != 'default': |
|
56 | %if c.rhodecode_user.username != 'default': | |
57 | <div class="overlay"><div class="overlay-text">${_('Submitting...')}</div></div> |
|
57 | <div class="overlay"><div class="overlay-text">${_('Submitting...')}</div></div> | |
58 | ${h.form('#', class_='inline-form')} |
|
58 | ${h.form('#', class_='inline-form')} | |
59 | <div class="clearfix"> |
|
59 | <div class="clearfix"> | |
60 | <div class="comment-help">${_('Commenting on line {1}.')} |
|
60 | <div class="comment-help">${_('Commenting on line {1}.')} | |
61 | ${(_('Comments parsed using %s syntax with %s support.') % ( |
|
61 | ${(_('Comments parsed using %s syntax with %s support.') % ( | |
62 | ('<a href="%s">RST</a>' % h.url('rst_help')), |
|
62 | ('<a href="%s">RST</a>' % h.url('rst_help')), | |
63 | ('<span style="color:#003367" class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to send notification to this RhodeCode user')) |
|
63 | ('<span style="color:#003367" class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to send notification to this RhodeCode user')) | |
64 | ) |
|
64 | ) | |
65 | )|n |
|
65 | )|n | |
66 | } |
|
66 | } | |
67 | </div> |
|
67 | </div> | |
68 | <div class="mentions-container" id="mentions_container_{1}"></div> |
|
68 | <div class="mentions-container" id="mentions_container_{1}"></div> | |
69 | <textarea id="text_{1}" name="text" class="yui-ac-input"></textarea> |
|
69 | <textarea id="text_{1}" name="text" class="yui-ac-input"></textarea> | |
70 | </div> |
|
70 | </div> | |
71 | <div class="comment-button"> |
|
71 | <div class="comment-button"> | |
72 | <input type="hidden" name="f_path" value="{0}"> |
|
72 | <input type="hidden" name="f_path" value="{0}"> | |
73 | <input type="hidden" name="line" value="{1}"> |
|
73 | <input type="hidden" name="line" value="{1}"> | |
74 | ${h.submit('save', _('Comment'), class_='ui-btn save-inline-form')} |
|
74 | ${h.submit('save', _('Comment'), class_='ui-btn save-inline-form')} | |
75 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')} |
|
75 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')} | |
76 | </div> |
|
76 | </div> | |
77 | ${h.end_form()} |
|
77 | ${h.end_form()} | |
78 | %else: |
|
78 | %else: | |
79 | ${h.form('')} |
|
79 | ${h.form('')} | |
80 | <div class="clearfix"> |
|
80 | <div class="clearfix"> | |
81 | <div class="comment-help"> |
|
81 | <div class="comment-help"> | |
82 | ${_('You need to be logged in to comment.')} <a href="${h.url('login_home',came_from=h.url.current())}">${_('Login now')}</a> |
|
82 | ${_('You need to be logged in to comment.')} <a href="${h.url('login_home',came_from=h.url.current())}">${_('Login now')}</a> | |
83 | </div> |
|
83 | </div> | |
84 | </div> |
|
84 | </div> | |
85 | <div class="comment-button"> |
|
85 | <div class="comment-button"> | |
86 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')} |
|
86 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')} | |
87 | </div> |
|
87 | </div> | |
88 | ${h.end_form()} |
|
88 | ${h.end_form()} | |
89 | %endif |
|
89 | %endif | |
90 | </div> |
|
90 | </div> | |
91 | </div> |
|
91 | </div> | |
92 | </%def> |
|
92 | </%def> | |
93 |
|
93 | |||
94 |
|
94 | |||
95 | ## generates inlines taken from c.comments var |
|
95 | ## generates inlines taken from c.comments var | |
96 | <%def name="inlines()"> |
|
96 | <%def name="inlines()"> | |
97 | <div class="comments-number">${ungettext("%d comment", "%d comments", len(c.comments)) % len(c.comments)} ${ungettext("(%d inline)", "(%d inline)", c.inline_cnt) % c.inline_cnt}</div> |
|
97 | <div class="comments-number">${ungettext("%d comment", "%d comments", len(c.comments)) % len(c.comments)} ${ungettext("(%d inline)", "(%d inline)", c.inline_cnt) % c.inline_cnt}</div> | |
98 | %for path, lines in c.inline_comments: |
|
98 | %for path, lines in c.inline_comments: | |
99 | % for line,comments in lines.iteritems(): |
|
99 | % for line,comments in lines.iteritems(): | |
100 | <div style="display:none" class="inline-comment-placeholder" path="${path}" target_id="${h.safeid(h.safe_unicode(path))}"> |
|
100 | <div style="display:none" class="inline-comment-placeholder" path="${path}" target_id="${h.safeid(h.safe_unicode(path))}"> | |
101 | %for co in comments: |
|
101 | %for co in comments: | |
102 | ${comment_block(co)} |
|
102 | ${comment_block(co)} | |
103 | %endfor |
|
103 | %endfor | |
104 | </div> |
|
104 | </div> | |
105 | %endfor |
|
105 | %endfor | |
106 | %endfor |
|
106 | %endfor | |
107 |
|
107 | |||
108 | </%def> |
|
108 | </%def> | |
109 |
|
109 | |||
110 | ## generate inline comments and the main ones |
|
110 | ## generate inline comments and the main ones | |
111 | <%def name="generate_comments()"> |
|
111 | <%def name="generate_comments(include_pr=False)"> | |
112 | <div class="comments"> |
|
112 | <div class="comments"> | |
113 | <div id="inline-comments-container"> |
|
113 | <div id="inline-comments-container"> | |
114 | ## generate inlines for this changeset |
|
114 | ## generate inlines for this changeset | |
115 | ${inlines()} |
|
115 | ${inlines()} | |
116 | </div> |
|
116 | </div> | |
117 |
|
117 | |||
118 | %for co in c.comments: |
|
118 | %for co in c.comments: | |
119 | <div id="comment-tr-${co.comment_id}"> |
|
119 | <div id="comment-tr-${co.comment_id}"> | |
120 | ## only render comments that are not from pull request, or from |
|
120 | ## only render comments that are not from pull request, or from | |
121 | ## pull request and a status change |
|
121 | ## pull request and a status change | |
122 | %if not co.pull_request or co.pull_request and co.status_change: |
|
122 | %if not co.pull_request or (co.pull_request and co.status_change) or include_pr: | |
123 | ${comment_block(co)} |
|
123 | ${comment_block(co)} | |
124 | %endif |
|
124 | %endif | |
125 | </div> |
|
125 | </div> | |
126 | %endfor |
|
126 | %endfor | |
127 | </div> |
|
127 | </div> | |
128 | </%def> |
|
128 | </%def> | |
129 |
|
129 | |||
130 | ## MAIN COMMENT FORM |
|
130 | ## MAIN COMMENT FORM | |
131 | <%def name="comments(post_url, cur_status, close_btn=False, change_status=True)"> |
|
131 | <%def name="comments(post_url, cur_status, close_btn=False, change_status=True)"> | |
132 |
|
132 | |||
133 | <div class="comments"> |
|
133 | <div class="comments"> | |
134 | %if c.rhodecode_user.username != 'default': |
|
134 | %if c.rhodecode_user.username != 'default': | |
135 | <div class="comment-form ac"> |
|
135 | <div class="comment-form ac"> | |
136 | ${h.form(post_url)} |
|
136 | ${h.form(post_url)} | |
137 | <strong>${_('Leave a comment')}</strong> |
|
137 | <strong>${_('Leave a comment')}</strong> | |
138 | <div class="clearfix"> |
|
138 | <div class="clearfix"> | |
139 | <div class="comment-help"> |
|
139 | <div class="comment-help"> | |
140 | ${(_('Comments parsed using %s syntax with %s support.') % (('<a href="%s">RST</a>' % h.url('rst_help')), |
|
140 | ${(_('Comments parsed using %s syntax with %s support.') % (('<a href="%s">RST</a>' % h.url('rst_help')), | |
141 | '<span style="color:#003367" class="tooltip" title="%s">@mention</span>' % |
|
141 | '<span style="color:#003367" class="tooltip" title="%s">@mention</span>' % | |
142 | _('Use @username inside this text to send notification to this RhodeCode user')))|n} |
|
142 | _('Use @username inside this text to send notification to this RhodeCode user')))|n} | |
143 | %if change_status: |
|
143 | %if change_status: | |
144 | | <label for="show_changeset_status_box" class="tooltip" title="${_('Check this to change current status of code-review for this changeset')}"> ${_('change status')}</label> |
|
144 | | <label for="show_changeset_status_box" class="tooltip" title="${_('Check this to change current status of code-review for this changeset')}"> ${_('change status')}</label> | |
145 | <input style="vertical-align: bottom;margin-bottom:-2px" id="show_changeset_status_box" type="checkbox" name="change_changeset_status" /> |
|
145 | <input style="vertical-align: bottom;margin-bottom:-2px" id="show_changeset_status_box" type="checkbox" name="change_changeset_status" /> | |
146 | %endif |
|
146 | %endif | |
147 | </div> |
|
147 | </div> | |
148 | %if change_status: |
|
148 | %if change_status: | |
149 | <div id="status_block_container" class="status-block" style="display:none"> |
|
149 | <div id="status_block_container" class="status-block" style="display:none"> | |
150 | %for status,lbl in c.changeset_statuses: |
|
150 | %for status,lbl in c.changeset_statuses: | |
151 | <div class=""> |
|
151 | <div class=""> | |
152 | <img src="${h.url('/images/icons/flag_status_%s.png' % status)}" /> <input ${'checked="checked"' if status == cur_status else ''}" type="radio" class="status_change_radio" name="changeset_status" id="${status}" value="${status}"> |
|
152 | <img src="${h.url('/images/icons/flag_status_%s.png' % status)}" /> <input ${'checked="checked"' if status == cur_status else ''}" type="radio" class="status_change_radio" name="changeset_status" id="${status}" value="${status}"> | |
153 | <label for="${status}">${lbl}</label> |
|
153 | <label for="${status}">${lbl}</label> | |
154 | </div> |
|
154 | </div> | |
155 | %endfor |
|
155 | %endfor | |
156 | </div> |
|
156 | </div> | |
157 | %endif |
|
157 | %endif | |
158 | <div class="mentions-container" id="mentions_container"></div> |
|
158 | <div class="mentions-container" id="mentions_container"></div> | |
159 | ${h.textarea('text')} |
|
159 | ${h.textarea('text')} | |
160 | </div> |
|
160 | </div> | |
161 | <div class="comment-button"> |
|
161 | <div class="comment-button"> | |
162 | ${h.submit('save', _('Comment'), class_="ui-btn large")} |
|
162 | ${h.submit('save', _('Comment'), class_="ui-btn large")} | |
163 | %if close_btn and change_status: |
|
163 | %if close_btn and change_status: | |
164 | ${h.submit('save_close', _('Comment and close'), class_='ui-btn blue large %s' % ('hidden' if cur_status in ['not_reviewed','under_review'] else ''))} |
|
164 | ${h.submit('save_close', _('Comment and close'), class_='ui-btn blue large %s' % ('hidden' if cur_status in ['not_reviewed','under_review'] else ''))} | |
165 | %endif |
|
165 | %endif | |
166 | </div> |
|
166 | </div> | |
167 | ${h.end_form()} |
|
167 | ${h.end_form()} | |
168 | </div> |
|
168 | </div> | |
169 | %endif |
|
169 | %endif | |
170 | </div> |
|
170 | </div> | |
171 | <script> |
|
171 | <script> | |
172 | YUE.onDOMReady(function () { |
|
172 | YUE.onDOMReady(function () { | |
173 | MentionsAutoComplete('text', 'mentions_container', _USERS_AC_DATA, _GROUPS_AC_DATA); |
|
173 | MentionsAutoComplete('text', 'mentions_container', _USERS_AC_DATA, _GROUPS_AC_DATA); | |
174 |
|
174 | |||
175 | // changeset status box listener |
|
175 | // changeset status box listener | |
176 | YUE.on(YUD.get('show_changeset_status_box'),'change',function(e){ |
|
176 | YUE.on(YUD.get('show_changeset_status_box'),'change',function(e){ | |
177 | if(e.currentTarget.checked){ |
|
177 | if(e.currentTarget.checked){ | |
178 | YUD.setStyle('status_block_container','display',''); |
|
178 | YUD.setStyle('status_block_container','display',''); | |
179 | } |
|
179 | } | |
180 | else{ |
|
180 | else{ | |
181 | YUD.setStyle('status_block_container','display','none'); |
|
181 | YUD.setStyle('status_block_container','display','none'); | |
182 | } |
|
182 | } | |
183 | }) |
|
183 | }) | |
184 | YUE.on(YUQ('.status_change_radio'), 'change',function(e){ |
|
184 | YUE.on(YUQ('.status_change_radio'), 'change',function(e){ | |
185 | var val = e.currentTarget.value; |
|
185 | var val = e.currentTarget.value; | |
186 | if (val == 'approved' || val == 'rejected') { |
|
186 | if (val == 'approved' || val == 'rejected') { | |
187 | YUD.removeClass('save_close', 'hidden'); |
|
187 | YUD.removeClass('save_close', 'hidden'); | |
188 | }else{ |
|
188 | }else{ | |
189 | YUD.addClass('save_close', 'hidden'); |
|
189 | YUD.addClass('save_close', 'hidden'); | |
190 | } |
|
190 | } | |
191 | }) |
|
191 | }) | |
192 |
|
192 | |||
193 | }); |
|
193 | }); | |
194 | </script> |
|
194 | </script> | |
195 | </%def> |
|
195 | </%def> |
@@ -1,228 +1,228 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 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]}</span> |
|
65 | <span class="spantag">${c.pull_request.org_ref_parts[0]}</span> | |
66 | : |
|
66 | : | |
67 | <span class="spantag">${c.pull_request.org_ref_parts[1]}</span> |
|
67 | <span class="spantag">${c.pull_request.org_ref_parts[1]}</span> | |
68 | <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> |
|
68 | <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 | </div> |
|
69 | </div> | |
70 | </div> |
|
70 | </div> | |
71 | </div> |
|
71 | </div> | |
72 | </div> |
|
72 | </div> | |
73 | </div> |
|
73 | </div> | |
74 | <div style="white-space:pre-wrap;padding:3px 3px 5px 20px">${h.literal(c.pull_request.description)}</div> |
|
74 | <div style="white-space:pre-wrap;padding:3px 3px 5px 20px">${h.literal(c.pull_request.description)}</div> | |
75 | <div style="padding:4px 4px 10px 20px"> |
|
75 | <div style="padding:4px 4px 10px 20px"> | |
76 | <div>${_('Created on')}: ${h.fmt_date(c.pull_request.created_on)}</div> |
|
76 | <div>${_('Created on')}: ${h.fmt_date(c.pull_request.created_on)}</div> | |
77 | </div> |
|
77 | </div> | |
78 |
|
78 | |||
79 | <div style="overflow: auto;"> |
|
79 | <div style="overflow: auto;"> | |
80 | ##DIFF |
|
80 | ##DIFF | |
81 | <div class="table" style="float:left;clear:none"> |
|
81 | <div class="table" style="float:left;clear:none"> | |
82 | <div id="body" class="diffblock"> |
|
82 | <div id="body" class="diffblock"> | |
83 | <div style="white-space:pre-wrap;padding:5px">${_('Compare view')}</div> |
|
83 | <div style="white-space:pre-wrap;padding:5px">${_('Compare view')}</div> | |
84 | </div> |
|
84 | </div> | |
85 | <div id="changeset_compare_view_content"> |
|
85 | <div id="changeset_compare_view_content"> | |
86 | ##CS |
|
86 | ##CS | |
87 | <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> |
|
87 | <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> | |
88 | <%include file="/compare/compare_cs.html" /> |
|
88 | <%include file="/compare/compare_cs.html" /> | |
89 |
|
89 | |||
90 | ## FILES |
|
90 | ## FILES | |
91 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px"> |
|
91 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px"> | |
92 |
|
92 | |||
93 | % if c.limited_diff: |
|
93 | % if c.limited_diff: | |
94 | ${ungettext('%s file changed', '%s files changed', len(c.files)) % len(c.files)} |
|
94 | ${ungettext('%s file changed', '%s files changed', len(c.files)) % len(c.files)} | |
95 | % else: |
|
95 | % else: | |
96 | ${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)}: |
|
96 | ${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)}: | |
97 | %endif |
|
97 | %endif | |
98 |
|
98 | |||
99 | </div> |
|
99 | </div> | |
100 | <div class="cs_files"> |
|
100 | <div class="cs_files"> | |
101 | %if not c.files: |
|
101 | %if not c.files: | |
102 | <span class="empty_data">${_('No files')}</span> |
|
102 | <span class="empty_data">${_('No files')}</span> | |
103 | %endif |
|
103 | %endif | |
104 | %for fid, change, f, stat in c.files: |
|
104 | %for fid, change, f, stat in c.files: | |
105 | <div class="cs_${change}"> |
|
105 | <div class="cs_${change}"> | |
106 | <div class="node">${h.link_to(h.safe_unicode(f),h.url.current(anchor=fid))}</div> |
|
106 | <div class="node">${h.link_to(h.safe_unicode(f),h.url.current(anchor=fid))}</div> | |
107 | <div class="changes">${h.fancy_file_stats(stat)}</div> |
|
107 | <div class="changes">${h.fancy_file_stats(stat)}</div> | |
108 | </div> |
|
108 | </div> | |
109 | %endfor |
|
109 | %endfor | |
110 | </div> |
|
110 | </div> | |
111 | % if c.limited_diff: |
|
111 | % if c.limited_diff: | |
112 | <h5>${_('Changeset was too big and was cut off...')}</h5> |
|
112 | <h5>${_('Changeset was too big and was cut off...')}</h5> | |
113 | % endif |
|
113 | % endif | |
114 | </div> |
|
114 | </div> | |
115 | </div> |
|
115 | </div> | |
116 | ## REVIEWERS |
|
116 | ## REVIEWERS | |
117 | <div style="float:left; border-left:1px dashed #eee"> |
|
117 | <div style="float:left; border-left:1px dashed #eee"> | |
118 | <h4>${_('Pull request reviewers')}</h4> |
|
118 | <h4>${_('Pull request reviewers')}</h4> | |
119 | <div id="reviewers" style="padding:0px 0px 5px 10px"> |
|
119 | <div id="reviewers" style="padding:0px 0px 5px 10px"> | |
120 | ## members goes here ! |
|
120 | ## members goes here ! | |
121 | <div class="group_members_wrap" style="min-height:45px"> |
|
121 | <div class="group_members_wrap" style="min-height:45px"> | |
122 | <ul id="review_members" class="group_members"> |
|
122 | <ul id="review_members" class="group_members"> | |
123 | %for member,status in c.pull_request_reviewers: |
|
123 | %for member,status in c.pull_request_reviewers: | |
124 | <li id="reviewer_${member.user_id}"> |
|
124 | <li id="reviewer_${member.user_id}"> | |
125 | <div class="reviewers_member"> |
|
125 | <div class="reviewers_member"> | |
126 | <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'))}"> |
|
126 | <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'))}"> | |
127 | <img src="${h.url(str('/images/icons/flag_status_%s.png' % (status[0][1].status if status else 'not_reviewed')))}"/> |
|
127 | <img src="${h.url(str('/images/icons/flag_status_%s.png' % (status[0][1].status if status else 'not_reviewed')))}"/> | |
128 | </div> |
|
128 | </div> | |
129 | <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(member.email,14)}"/> </div> |
|
129 | <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(member.email,14)}"/> </div> | |
130 | <div style="float:left">${member.full_name} (${_('owner') if c.pull_request.user_id == member.user_id else _('reviewer')})</div> |
|
130 | <div style="float:left">${member.full_name} (${_('owner') if c.pull_request.user_id == member.user_id else _('reviewer')})</div> | |
131 | <input type="hidden" value="${member.user_id}" name="review_members" /> |
|
131 | <input type="hidden" value="${member.user_id}" name="review_members" /> | |
132 | %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): |
|
132 | %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): | |
133 | <span class="delete_icon action_button" onclick="removeReviewer(${member.user_id})"></span> |
|
133 | <span class="delete_icon action_button" onclick="removeReviewer(${member.user_id})"></span> | |
134 | %endif |
|
134 | %endif | |
135 | </div> |
|
135 | </div> | |
136 | </li> |
|
136 | </li> | |
137 | %endfor |
|
137 | %endfor | |
138 | </ul> |
|
138 | </ul> | |
139 | </div> |
|
139 | </div> | |
140 | %if not c.pull_request.is_closed(): |
|
140 | %if not c.pull_request.is_closed(): | |
141 | <div class='ac'> |
|
141 | <div class='ac'> | |
142 | %if h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.author.user_id == c.rhodecode_user.user_id: |
|
142 | %if h.HasPermissionAny('hg.admin', 'repository.admin')() or c.pull_request.author.user_id == c.rhodecode_user.user_id: | |
143 | <div class="reviewer_ac"> |
|
143 | <div class="reviewer_ac"> | |
144 | ${h.text('user', class_='yui-ac-input')} |
|
144 | ${h.text('user', class_='yui-ac-input')} | |
145 | <span class="help-block">${_('Add reviewer to this pull request.')}</span> |
|
145 | <span class="help-block">${_('Add reviewer to this pull request.')}</span> | |
146 | <div id="reviewers_container"></div> |
|
146 | <div id="reviewers_container"></div> | |
147 | </div> |
|
147 | </div> | |
148 | <div style="padding:0px 10px"> |
|
148 | <div style="padding:0px 10px"> | |
149 | <span id="update_pull_request" class="ui-btn xsmall">${_('save')}</span> |
|
149 | <span id="update_pull_request" class="ui-btn xsmall">${_('save')}</span> | |
150 | </div> |
|
150 | </div> | |
151 | %endif |
|
151 | %endif | |
152 | </div> |
|
152 | </div> | |
153 | %endif |
|
153 | %endif | |
154 | </div> |
|
154 | </div> | |
155 | </div> |
|
155 | </div> | |
156 | </div> |
|
156 | </div> | |
157 | <script> |
|
157 | <script> | |
158 | var _USERS_AC_DATA = ${c.users_array|n}; |
|
158 | var _USERS_AC_DATA = ${c.users_array|n}; | |
159 | var _GROUPS_AC_DATA = ${c.users_groups_array|n}; |
|
159 | var _GROUPS_AC_DATA = ${c.users_groups_array|n}; | |
160 | AJAX_COMMENT_URL = "${url('pullrequest_comment',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id)}"; |
|
160 | AJAX_COMMENT_URL = "${url('pullrequest_comment',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id)}"; | |
161 | AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}"; |
|
161 | AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}"; | |
162 | AJAX_UPDATE_PULLREQUEST = "${url('pullrequest_update',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id)}" |
|
162 | AJAX_UPDATE_PULLREQUEST = "${url('pullrequest_update',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id)}" | |
163 | </script> |
|
163 | </script> | |
164 |
|
164 | |||
165 | ## diff block |
|
165 | ## diff block | |
166 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> |
|
166 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> | |
167 | %for fid, change, f, stat in c.files: |
|
167 | %for fid, change, f, stat in c.files: | |
168 | ${diff_block.diff_block_simple([c.changes[fid]])} |
|
168 | ${diff_block.diff_block_simple([c.changes[fid]])} | |
169 | %endfor |
|
169 | %endfor | |
170 | % if c.limited_diff: |
|
170 | % if c.limited_diff: | |
171 | <h4>${_('Changeset was too big and was cut off...')}</h4> |
|
171 | <h4>${_('Changeset was too big and was cut off...')}</h4> | |
172 | % endif |
|
172 | % endif | |
173 |
|
173 | |||
174 |
|
174 | |||
175 | ## template for inline comment form |
|
175 | ## template for inline comment form | |
176 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
|
176 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> | |
177 | ${comment.comment_inline_form()} |
|
177 | ${comment.comment_inline_form()} | |
178 |
|
178 | |||
179 | ## render comments and inlines |
|
179 | ## render comments and inlines | |
180 | ${comment.generate_comments()} |
|
180 | ${comment.generate_comments(include_pr=True)} | |
181 |
|
181 | |||
182 | % if not c.pull_request.is_closed(): |
|
182 | % if not c.pull_request.is_closed(): | |
183 | ## main comment form and it status |
|
183 | ## main comment form and it status | |
184 | ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, |
|
184 | ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, | |
185 | pull_request_id=c.pull_request.pull_request_id), |
|
185 | pull_request_id=c.pull_request.pull_request_id), | |
186 | c.current_changeset_status, |
|
186 | c.current_changeset_status, | |
187 | close_btn=True, change_status=c.allowed_to_change_status)} |
|
187 | close_btn=True, change_status=c.allowed_to_change_status)} | |
188 | %endif |
|
188 | %endif | |
189 |
|
189 | |||
190 | <script type="text/javascript"> |
|
190 | <script type="text/javascript"> | |
191 | YUE.onDOMReady(function(){ |
|
191 | YUE.onDOMReady(function(){ | |
192 | PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA); |
|
192 | PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA); | |
193 |
|
193 | |||
194 | YUE.on(YUQ('.show-inline-comments'),'change',function(e){ |
|
194 | YUE.on(YUQ('.show-inline-comments'),'change',function(e){ | |
195 | var show = 'none'; |
|
195 | var show = 'none'; | |
196 | var target = e.currentTarget; |
|
196 | var target = e.currentTarget; | |
197 | if(target.checked){ |
|
197 | if(target.checked){ | |
198 | var show = '' |
|
198 | var show = '' | |
199 | } |
|
199 | } | |
200 | var boxid = YUD.getAttribute(target,'id_for'); |
|
200 | var boxid = YUD.getAttribute(target,'id_for'); | |
201 | var comments = YUQ('#{0} .inline-comments'.format(boxid)); |
|
201 | var comments = YUQ('#{0} .inline-comments'.format(boxid)); | |
202 | for(c in comments){ |
|
202 | for(c in comments){ | |
203 | YUD.setStyle(comments[c],'display',show); |
|
203 | YUD.setStyle(comments[c],'display',show); | |
204 | } |
|
204 | } | |
205 | var btns = YUQ('#{0} .inline-comments-button'.format(boxid)); |
|
205 | var btns = YUQ('#{0} .inline-comments-button'.format(boxid)); | |
206 | for(c in btns){ |
|
206 | for(c in btns){ | |
207 | YUD.setStyle(btns[c],'display',show); |
|
207 | YUD.setStyle(btns[c],'display',show); | |
208 | } |
|
208 | } | |
209 | }) |
|
209 | }) | |
210 |
|
210 | |||
211 | YUE.on(YUQ('.line'),'click',function(e){ |
|
211 | YUE.on(YUQ('.line'),'click',function(e){ | |
212 | var tr = e.currentTarget; |
|
212 | var tr = e.currentTarget; | |
213 | injectInlineForm(tr); |
|
213 | injectInlineForm(tr); | |
214 | }); |
|
214 | }); | |
215 |
|
215 | |||
216 | // inject comments into they proper positions |
|
216 | // inject comments into they proper positions | |
217 | var file_comments = YUQ('.inline-comment-placeholder'); |
|
217 | var file_comments = YUQ('.inline-comment-placeholder'); | |
218 | renderInlineComments(file_comments); |
|
218 | renderInlineComments(file_comments); | |
219 |
|
219 | |||
220 | YUE.on(YUD.get('update_pull_request'),'click',function(e){ |
|
220 | YUE.on(YUD.get('update_pull_request'),'click',function(e){ | |
221 | updateReviewers(); |
|
221 | updateReviewers(); | |
222 | }) |
|
222 | }) | |
223 | }) |
|
223 | }) | |
224 | </script> |
|
224 | </script> | |
225 |
|
225 | |||
226 | </div> |
|
226 | </div> | |
227 |
|
227 | |||
228 | </%def> |
|
228 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now