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