diff --git a/rhodecode/templates/changeset/changeset.html b/rhodecode/templates/changeset/changeset.html --- a/rhodecode/templates/changeset/changeset.html +++ b/rhodecode/templates/changeset/changeset.html @@ -114,38 +114,52 @@ ${h.link_to_if(change!='removed',h.safe_unicode(filenode.path),h.url('files_home',repo_name=c.repo_name, revision=filenode.changeset.raw_id,f_path=h.safe_unicode(filenode.path)))} - %if 1: » ${h.link_to(_('diff'), h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='diff'))} » ${h.link_to(_('raw diff'), h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw'))} » ${h.link_to(_('download diff'), h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='download'))} - %endif -
- %if diff: - ${diff|n} - %else: - ${_('No changes in this file')} - %endif +
+
+ %if diff: + ${diff|n} + %else: + ${_('No changes in this file')} + %endif
%endif %endfor <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> + ## template for inline comment form + ${comment.comment_inline_form()}
-
${len(c.comments)} comment(s)
+
${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})
+ + %for path, lines in c.inline_comments: +
+ % for line,comments in lines.iteritems(): +
+ %for co in comments: + ${comment.comment_block(co)} + %endfor +
+ %endfor +
+ %endfor + %for co in c.comments: ${comment.comment_block(co)} %endfor %if c.rhodecode_user.username != 'default':
${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=c.changeset.raw_id))} - Leave a comment + ${_('Leave a comment')}
${_('Comments parsed using RST syntax')}
${h.textarea('text')} @@ -167,7 +181,34 @@ n.parentNode.removeChild(n); } ajaxPOST(url,postData,success); - } + } + + YUE.onDOMReady(function(){ + YUE.on(YUQ('.line'),'mouseenter',function(e){ + var tr = e.currentTarget; + if(YUD.hasClass(tr,'form-open') || YUD.hasClass(tr,'context')){ + return + } + YUD.addClass(tr,'highlight'); + }); + YUE.on(YUQ('.line'),'mouseleave',function(e){ + YUD.removeClass(e.currentTarget,'highlight'); + }); + + YUE.on(YUQ('.line'),'click',function(e){ + var tr = e.currentTarget; + if(YUD.hasClass(tr,'form-open') || YUD.hasClass(tr,'context')){ + return + } + YUD.addClass(tr,'form-open'); + var node = tr.parentNode.parentNode.parentNode.getElementsByClassName('full_f_path')[0]; + var f_path = YUD.getAttribute(node,'path'); + var lineno = getLineNo(tr); + var form = createInlineForm(tr, f_path, lineno); + YUD.insertAfter(form,tr); + }) + }) +