Show More
@@ -1,155 +1,154 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | ## usage: |
|
3 | 3 | ## <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
|
4 | 4 | ## ${comment.comment_block(co)} |
|
5 | 5 | ## |
|
6 | 6 | <%def name="comment_block(co)"> |
|
7 | 7 | <div class="comment" id="comment-${co.comment_id}" line="${co.line_no}"> |
|
8 | 8 | <div class="comment-wrapp"> |
|
9 | 9 | <div class="meta"> |
|
10 | 10 | <div style="float:left"> <img src="${h.gravatar_url(co.author.email, 20)}" /> </div> |
|
11 | 11 | <div class="user"> |
|
12 | 12 | ${co.author.username} |
|
13 | 13 | </div> |
|
14 | 14 | <div class="date"> |
|
15 | 15 | ${h.age(co.modified_at)} |
|
16 | 16 | </div> |
|
17 | 17 | %if co.status_change: |
|
18 | 18 | <div style="float:left" class="changeset-status-container"> |
|
19 | 19 | <div style="float:left;padding:0px 2px 0px 2px"><span style="font-size: 18px;">›</span></div> |
|
20 | 20 | <div title="${_('Changeset status')}" class="changeset-status-lbl"> ${co.status_change.status_lbl}</div> |
|
21 | 21 | <div class="changeset-status-ico"><img src="${h.url(str('/images/icons/flag_status_%s.png' % co.status_change.status))}" /></div> |
|
22 | 22 | </div> |
|
23 | 23 | %endif |
|
24 | 24 | %if h.HasPermissionAny('hg.admin', 'repository.admin')() or co.author.user_id == c.rhodecode_user.user_id: |
|
25 | 25 | <div class="buttons"> |
|
26 | 26 | <span onClick="deleteComment(${co.comment_id})" class="delete-comment ui-btn">${_('Delete')}</span> |
|
27 | 27 | </div> |
|
28 | 28 | %endif |
|
29 | 29 | </div> |
|
30 | 30 | <div class="text"> |
|
31 | 31 | ${h.rst_w_mentions(co.text)|n} |
|
32 | 32 | </div> |
|
33 | 33 | </div> |
|
34 | 34 | </div> |
|
35 | 35 | </%def> |
|
36 | 36 | |
|
37 | 37 | |
|
38 | 38 | <%def name="comment_inline_form(changeset)"> |
|
39 | 39 | <div id='comment-inline-form-template' style="display:none"> |
|
40 | 40 | <div class="comment-inline-form ac"> |
|
41 | 41 | %if c.rhodecode_user.username != 'default': |
|
42 | 42 | <div class="overlay"><div class="overlay-text">${_('Submitting...')}</div></div> |
|
43 | 43 | ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=changeset.raw_id),class_='inline-form')} |
|
44 | 44 | <div class="clearfix"> |
|
45 | 45 | <div class="comment-help">${_('Commenting on line {1}.')} |
|
46 | 46 | ${(_('Comments parsed using %s syntax with %s support.') % ( |
|
47 | 47 | ('<a href="%s">RST</a>' % h.url('rst_help')), |
|
48 | 48 | ('<span style="color:#003367" class="tooltip" title="%s">@mention</span>' % _('Use @username inside this text to send notification to this RhodeCode user')) |
|
49 | 49 | ) |
|
50 | 50 | )|n |
|
51 | 51 | } |
|
52 | 52 | </div> |
|
53 | 53 | <div class="mentions-container" id="mentions_container_{1}"></div> |
|
54 | 54 | <textarea id="text_{1}" name="text" class="yui-ac-input"></textarea> |
|
55 | 55 | </div> |
|
56 | 56 | <div class="comment-button"> |
|
57 | 57 | <input type="hidden" name="f_path" value="{0}"> |
|
58 | 58 | <input type="hidden" name="line" value="{1}"> |
|
59 | 59 | ${h.submit('save', _('Comment'), class_='ui-btn save-inline-form')} |
|
60 | 60 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')} |
|
61 | 61 | </div> |
|
62 | 62 | ${h.end_form()} |
|
63 | 63 | %else: |
|
64 | 64 | ${h.form('')} |
|
65 | 65 | <div class="clearfix"> |
|
66 | 66 | <div class="comment-help"> |
|
67 | 67 | ${_('You need to be logged in to comment.')} <a href="${h.url('login_home',came_from=h.url.current())}">${_('Login now')}</a> |
|
68 | 68 | </div> |
|
69 | 69 | </div> |
|
70 | 70 | <div class="comment-button"> |
|
71 | 71 | ${h.reset('hide-inline-form', _('Hide'), class_='ui-btn hide-inline-form')} |
|
72 | 72 | </div> |
|
73 | 73 | ${h.end_form()} |
|
74 | 74 | %endif |
|
75 | 75 | </div> |
|
76 | 76 | </div> |
|
77 | 77 | </%def> |
|
78 | 78 | |
|
79 | 79 | |
|
80 | 80 | ## generates inlines taken from c.comments var |
|
81 | 81 | <%def name="inlines()"> |
|
82 | 82 | <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> |
|
83 | 83 | %for path, lines in c.inline_comments: |
|
84 | 84 | % for line,comments in lines.iteritems(): |
|
85 | 85 | <div style="display:none" class="inline-comment-placeholder" path="${path}" target_id="${h.safeid(h.safe_unicode(path))}"> |
|
86 | 86 | %for co in comments: |
|
87 | 87 | ${comment_block(co)} |
|
88 | 88 | %endfor |
|
89 | 89 | </div> |
|
90 | 90 | %endfor |
|
91 | 91 | %endfor |
|
92 | 92 | |
|
93 | 93 | </%def> |
|
94 | 94 | |
|
95 | 95 | ## MAIN COMMENT FORM |
|
96 | 96 | <%def name="comments(post_url, cur_status)"> |
|
97 | 97 | |
|
98 | 98 | <div class="comments"> |
|
99 | 99 | <div id="inline-comments-container"> |
|
100 | 100 | ## generate inlines for this changeset |
|
101 | 101 | ${inlines()} |
|
102 | 102 | </div> |
|
103 | 103 | |
|
104 | 104 | %for co in c.comments: |
|
105 | 105 | <div id="comment-tr-${co.comment_id}"> |
|
106 | 106 | ${comment_block(co)} |
|
107 | 107 | </div> |
|
108 | 108 | %endfor |
|
109 | 109 | %if c.rhodecode_user.username != 'default': |
|
110 | 110 | <div class="comment-form ac"> |
|
111 | 111 | ${h.form(post_url)} |
|
112 | 112 | <strong>${_('Leave a comment')}</strong> |
|
113 | 113 | <div class="clearfix"> |
|
114 | 114 | <div class="comment-help"> |
|
115 | 115 | ${(_('Comments parsed using %s syntax with %s support.') % (('<a href="%s">RST</a>' % h.url('rst_help')), |
|
116 | 116 | '<span style="color:#003367" class="tooltip" title="%s">@mention</span>' % |
|
117 | 117 | _('Use @username inside this text to send notification to this RhodeCode user')))|n} |
|
118 |
| < |
|
|
118 | | <label for="show_changeset_status_box" class="tooltip" title="${_('Check this to change current status of code-review for this changeset')}"> ${_('change status')}</label> | |
|
119 | 119 | <input style="vertical-align: bottom;margin-bottom:-2px" id="show_changeset_status_box" type="checkbox" name="change_changeset_status" /> |
|
120 | </span> | |
|
121 | 120 | </div> |
|
122 | 121 | <div id="status_block_container" class="status-block" style="display:none"> |
|
123 | 122 | %for status,lbl in c.changeset_statuses: |
|
124 | 123 | <div class=""> |
|
125 | 124 | <img src="${h.url('/images/icons/flag_status_%s.png' % status)}" /> <input ${'checked="checked"' if status == cur_status else ''}" type="radio" name="changeset_status" value="${status}"> <label>${lbl}</label> |
|
126 | 125 | </div> |
|
127 | 126 | %endfor |
|
128 | 127 | </div> |
|
129 | 128 | <div class="mentions-container" id="mentions_container"></div> |
|
130 | 129 | ${h.textarea('text')} |
|
131 | 130 | </div> |
|
132 | 131 | <div class="comment-button"> |
|
133 | 132 | ${h.submit('save', _('Comment'), class_='ui-button')} |
|
134 | 133 | </div> |
|
135 | 134 | ${h.end_form()} |
|
136 | 135 | </div> |
|
137 | 136 | %endif |
|
138 | 137 | </div> |
|
139 | 138 | <script> |
|
140 | 139 | YUE.onDOMReady(function () { |
|
141 | 140 | MentionsAutoComplete('text', 'mentions_container', _USERS_AC_DATA, _GROUPS_AC_DATA); |
|
142 | 141 | |
|
143 | 142 | // changeset status box listener |
|
144 | 143 | YUE.on(YUD.get('show_changeset_status_box'),'change',function(e){ |
|
145 | 144 | if(e.currentTarget.checked){ |
|
146 | 145 | YUD.setStyle('status_block_container','display',''); |
|
147 | 146 | } |
|
148 | 147 | else{ |
|
149 | 148 | YUD.setStyle('status_block_container','display','none'); |
|
150 | 149 | } |
|
151 | 150 | }) |
|
152 | 151 | |
|
153 | 152 | }); |
|
154 | 153 | </script> |
|
155 | 154 | </%def> |
@@ -1,107 +1,104 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 | » |
|
10 | 10 | ${h.link_to(c.repo_name,h.url('changelog_home',repo_name=c.repo_name))} |
|
11 | 11 | » |
|
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 | |
|
23 |
<h3>${_('Title')}: ${c.pull_request.title} |
|
|
24 |
<div class="changeset-status-container" style="float: |
|
|
23 | <h3>${_('Title')}: ${c.pull_request.title} | |
|
24 | <div class="changeset-status-container" style="float:none"> | |
|
25 | 25 | %if c.current_changeset_status: |
|
26 |
<div title="${_(' |
|
|
27 | <div class="changeset-status-ico"><img src="${h.url('/images/icons/flag_status_%s.png' % c.current_changeset_status)}" /></div> | |
|
26 | <div title="${_('Pull request status')}" class="changeset-status-lbl">[${h.changeset_status_lbl(c.current_changeset_status)}]</div> | |
|
27 | <div class="changeset-status-ico" style="padding:4px"><img src="${h.url('/images/icons/flag_status_%s.png' % c.current_changeset_status)}" /></div> | |
|
28 | 28 | %endif |
|
29 | </div> | |
|
30 | <div style="padding:4px 4px 10px 4px"> | |
|
31 | <div>${h.fmt_date(c.pull_request.created_on)}</div> | |
|
29 | </div> | |
|
30 | </h3> | |
|
31 | <div style="white-space:pre-wrap;padding:3px 3px 5px 20px">${h.literal(c.pull_request.description)}</div> | |
|
32 | <div style="padding:4px 4px 10px 20px"> | |
|
33 | <div>${_('Created on')}: ${h.fmt_date(c.pull_request.created_on)}</div> | |
|
32 | 34 | </div> |
|
33 | 35 | |
|
34 | 36 | ## REVIEWERS |
|
35 | 37 | <div> |
|
36 | 38 | <div class="table" style="float:right;width:46%;clear:none"> |
|
37 | 39 | <div id="body" class="diffblock"> |
|
38 | 40 | <div style="white-space:pre-wrap;padding:5px">${_('Pull request reviewers')}</div> |
|
39 | 41 | </div> |
|
40 | 42 | <div style="border: 1px solid #CCC"> |
|
41 | 43 | <div class="group_members_wrap"> |
|
42 | 44 | <ul class="group_members"> |
|
43 | 45 | %for user,status in c.pull_request_reviewers: |
|
44 | 46 | <li> |
|
45 | 47 | <div class="group_member"> |
|
46 | <div style="float:left;padding:3px"> | |
|
48 | <div style="float:left;padding:3px" class="tooltip" title="${h.tooltip(h.changeset_status_lbl(status[0][1].status if status else 'not_reviewed'))}"> | |
|
47 | 49 | <img src="${h.url(str('/images/icons/flag_status_%s.png' % (status[0][1].status if status else 'not_reviewed')))}"/> |
|
48 | 50 | </div> |
|
49 | 51 | <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(user.email,20)}"/> </div> |
|
50 | 52 | <div style="float:left">${user.username}</div> |
|
51 | 53 | </div> |
|
52 | 54 | </li> |
|
53 | 55 | %endfor |
|
54 | 56 | </ul> |
|
55 | 57 | </div> |
|
56 | 58 | </div> |
|
57 | 59 | </div> |
|
58 | 60 | ##DIFF |
|
59 | 61 | <div class="table" style="float:left;width:46%;clear:none"> |
|
60 | 62 | <div id="body" class="diffblock"> |
|
61 |
<div style="white-space:pre-wrap;padding:5px">${ |
|
|
63 | <div style="white-space:pre-wrap;padding:5px">${_('Compare view')}</div> | |
|
62 | 64 | </div> |
|
63 | 65 | <div id="changeset_compare_view_content"> |
|
64 | 66 | ##CS |
|
65 | 67 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Incoming changesets')}</div> |
|
66 | 68 | <%include file="/compare/compare_cs.html" /> |
|
67 | 69 | |
|
68 | 70 | ## FILES |
|
69 | 71 | <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Files affected')}</div> |
|
70 | 72 | <div class="cs_files"> |
|
71 | 73 | %for fid, change, f, stat in c.files: |
|
72 | 74 | <div class="cs_${change}"> |
|
73 | 75 | <div class="node">${h.link_to(h.safe_unicode(f),h.url.current(anchor=fid))}</div> |
|
74 | 76 | <div class="changes">${h.fancy_file_stats(stat)}</div> |
|
75 | 77 | </div> |
|
76 | 78 | %endfor |
|
77 | 79 | </div> |
|
78 | 80 | </div> |
|
79 | 81 | </div> |
|
80 | 82 | </div> |
|
81 | 83 | <script> |
|
82 | 84 | var _USERS_AC_DATA = ${c.users_array|n}; |
|
83 | 85 | var _GROUPS_AC_DATA = ${c.users_groups_array|n}; |
|
84 | 86 | </script> |
|
85 | 87 | |
|
86 | 88 | ## diff block |
|
87 | 89 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> |
|
88 | 90 | %for fid, change, f, stat in c.files: |
|
89 | 91 | ${diff_block.diff_block_simple([c.changes[fid]])} |
|
90 | 92 | %endfor |
|
91 | 93 | |
|
92 | 94 | ## template for inline comment form |
|
93 | 95 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
|
94 | 96 | ##${comment.comment_inline_form(c.changeset)} |
|
95 | 97 | |
|
96 | 98 | ## render comments main comments form and it status |
|
97 | 99 | ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), |
|
98 | 100 | c.current_changeset_status)} |
|
99 | 101 | |
|
100 | 102 | </div> |
|
101 | 103 | |
|
102 | <script type="text/javascript"> | |
|
103 | ||
|
104 | ||
|
105 | </script> | |
|
106 | ||
|
107 | 104 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now