Changeset - 3efc47f59639
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 14 years ago 2011-11-20 22:53:25
marcin@python-works.com
inline comment form is displayed now under all comments.
3 files changed with 13 insertions and 6 deletions:
0 comments (0 inline, 0 general)
rhodecode/public/css/style.css
Show inline comments
 
@@ -3453,12 +3453,15 @@ form.comment-inline-form {
 
.inline-comments .comments-number{
 
    padding:0px 0px 10px 0px;
 
    font-weight: bold;
 
    color: #666;
 
    font-size: 16px;
 
}
 
.inline-comments-button .add-comment{
 
	margin:10px 5px !important;
 
}
 
.notifications{
 
	width:22px;
 
    padding:2px;
 
	float:right;
 
    -webkit-border-radius: 4px;
 
    -moz-border-radius: 4px;
rhodecode/templates/changeset/changeset.html
Show inline comments
 
@@ -214,42 +214,46 @@
 
    		  var boxid = YUD.getAttribute(target,'id_for');
 
    		  var comments = YUQ('#{0} .inline-comments'.format(boxid));
 
    		  for(c in comments){ 
 
    		     YUD.setStyle(comments[c],'display',show);
 
    		  }
 
    	  })
 
    	  
 

	
 
          
 
          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);
 
        	  var target_tr = tr;
 
        	  if(YUD.hasClass(YUD.getNextSibling(tr),'inline-comments')){
 
        		  target_tr = YUD.getNextSibling(tr);
 
        	  }
 
        	  YUD.insertAfter(form,target_tr);
 
        	  YUD.get('text_'+lineno).focus()
 
          });
 
          
 
          // inject comments into they proper positions
 
          var file_comments = YUQ('.inline-comment-placeholder');
 
          
 
          for (f in file_comments){
 
        	  var box = file_comments[f];
 
        	  var inlines = box.children;
 
        	  for(var i=0; i<inlines.length; i++){
 
        		  try{
 

	
 
          		    var inline = inlines[i];
 
          		    var lineno = YUD.getAttribute(inlines[i],'line');
 
          		    var lineid = "{0}_{1}".format(YUD.getAttribute(inline,'target_id'),lineno);
 
                    var target_line = YUD.get(lineid);
 
                    var comments = new YAHOO.util.Element(tableTr('inline-comments',inline.innerHTML))
 
                    YUD.insertAfter(comments,target_line.parentNode);
 
                    var comment = new YAHOO.util.Element(tableTr('inline-comments',inline.innerHTML))
 
                    YUD.insertAfter(comment,target_line.parentNode);
 
        		  }catch(e){}
 
        	  }
 
          }
 
      })
 
      
 
    </script> 
rhodecode/templates/changeset/changeset_file_comment.html
Show inline comments
 
@@ -37,13 +37,13 @@
 
  <div class="comment-inline-form">
 
  %if c.rhodecode_user.username != 'default':
 
      ${h.form(h.url('changeset_comment', repo_name=c.repo_name, revision=c.changeset.raw_id))}
 
      <div class="clearfix">
 
          <div class="comment-help">${_('Commenting on line')} {1} ${_('comments parsed using')} 
 
          <a href="${h.url('rst_help')}">RST</a> ${_('syntax')}</div>
 
              ${h.textarea('text')}
 
              <textarea id="text_{1}" name="text"></textarea>
 
      </div>
 
      <div class="comment-button">
 
      <input type="hidden" name="f_path" value="{0}">
 
      <input type="hidden" name="line" value="{1}">            
 
      ${h.submit('save', _('Comment'), class_='ui-button-small')}
 
      ${h.reset('hide-inline-form', _('Hide'), class_='ui-button-small hide-inline-form')}
0 comments (0 inline, 0 general)