Mercurial > kallithea
comparison rhodecode/templates/pullrequests/pullrequest_show.html @ 2489:a0adf8db1416 beta
Enabled inline comments in pull-requests
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 19 Jun 2012 23:07:23 +0200 |
parents | 1fd3c043c025 |
children | 79818f546538 |
comparison
equal
deleted
inserted
replaced
2488:b5b34d71b23b | 2489:a0adf8db1416 |
---|---|
81 </div> | 81 </div> |
82 </div> | 82 </div> |
83 <script> | 83 <script> |
84 var _USERS_AC_DATA = ${c.users_array|n}; | 84 var _USERS_AC_DATA = ${c.users_array|n}; |
85 var _GROUPS_AC_DATA = ${c.users_groups_array|n}; | 85 var _GROUPS_AC_DATA = ${c.users_groups_array|n}; |
86 AJAX_COMMENT_URL = "${url('pullrequest_comment',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id)}"; | |
87 AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}"; | |
86 </script> | 88 </script> |
87 | 89 |
88 ## diff block | 90 ## diff block |
89 <%namespace name="diff_block" file="/changeset/diff_block.html"/> | 91 <%namespace name="diff_block" file="/changeset/diff_block.html"/> |
90 %for fid, change, f, stat in c.files: | 92 %for fid, change, f, stat in c.files: |
91 ${diff_block.diff_block_simple([c.changes[fid]])} | 93 ${diff_block.diff_block_simple([c.changes[fid]])} |
92 %endfor | 94 %endfor |
93 | 95 |
94 ## template for inline comment form | 96 ## template for inline comment form |
95 <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> | 97 <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
96 ##${comment.comment_inline_form(c.changeset)} | 98 ${comment.comment_inline_form()} |
97 | 99 |
98 ## render comments main comments form and it status | 100 ## render comments main comments form and it status |
99 ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), | 101 ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), |
100 c.current_changeset_status)} | 102 c.current_changeset_status)} |
101 | 103 |
104 | |
105 <script type="text/javascript"> | |
106 YUE.onDOMReady(function(){ | |
107 | |
108 YUE.on(YUQ('.show-inline-comments'),'change',function(e){ | |
109 var show = 'none'; | |
110 var target = e.currentTarget; | |
111 if(target.checked){ | |
112 var show = '' | |
113 } | |
114 var boxid = YUD.getAttribute(target,'id_for'); | |
115 var comments = YUQ('#{0} .inline-comments'.format(boxid)); | |
116 for(c in comments){ | |
117 YUD.setStyle(comments[c],'display',show); | |
118 } | |
119 var btns = YUQ('#{0} .inline-comments-button'.format(boxid)); | |
120 for(c in btns){ | |
121 YUD.setStyle(btns[c],'display',show); | |
122 } | |
123 }) | |
124 | |
125 YUE.on(YUQ('.line'),'click',function(e){ | |
126 var tr = e.currentTarget; | |
127 injectInlineForm(tr); | |
128 }); | |
129 | |
130 // inject comments into they proper positions | |
131 var file_comments = YUQ('.inline-comment-placeholder'); | |
132 renderInlineComments(file_comments); | |
133 }) | |
134 | |
135 </script> | |
136 | |
137 | |
102 </div> | 138 </div> |
103 | 139 |
104 </%def> | 140 </%def> |