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