Changeset - 6ff8bcb783e9
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 14 years ago 2011-11-14 21:58:08
marcin@python-works.com
show inline comments option
2 files changed with 26 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/public/css/style.css
Show inline comments
 
@@ -3333,24 +3333,28 @@ form.comment-form {
 
.add-another-button {
 
    margin-left: 10px;
 
    margin-top: 10px;
 
    margin-bottom: 10px;
 
}
 
 
.comment .buttons {
 
    position: absolute;
 
    right:40px;
 
}
 
 
 
.show-inline-comments{
 
	position: relative;
 
	top:1px
 
}
 
 
/** comment inline form **/
 
 
.comment-inline-form .clearfix{
 
    background: #EEE;
 
    -webkit-border-radius: 4px;
 
    -moz-border-radius: 4px;
 
    border-radius: 4px;
 
    padding: 5px;
 
}
 
 
div.comment-inline-form {
rhodecode/templates/changeset/changeset.html
Show inline comments
 
@@ -104,37 +104,43 @@
 
	                %endfor
 
	                % if c.cut_off:
 
	                  ${_('Changeset was too big and was cut off...')}
 
	                % endif
 
	        </div>         
 
	    </div>
 
	    
 
    </div>
 
    	
 
	%for change,filenode,diff,cs1,cs2,stat in c.changes:
 
		%if change !='removed':
 
		<div style="clear:both;height:10px"></div>
 
		<div class="diffblock  margined">
 
			<div id="${self.fid(filenode.changeset.raw_id,filenode.path)}" class="code-header">
 
		<div class="diffblock  margined" id="${self.fid(filenode.changeset.raw_id,filenode.path)}">
 
			<div class="code-header">
 
				<div class="changeset_header">
 
					<span class="changeset_file">
 
						${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)))}
 
					</span>
 
					&raquo; <span>${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'))}</span>
 
					&raquo; <span>${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'))}</span>
 
					&raquo; <span>${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'))}</span>
 
                    <span style="float:right">
 
                      <label>
 
                      ${_('show inline comments')}
 
                      ${h.checkbox('',checked="checked",class_="show-inline-comments",id_for=self.fid(filenode.changeset.raw_id,filenode.path))}
 
                      </label>
 
                    </span>
 
				</div>
 
			</div>
 
			<div class="code-body">
 
                <div class="full_f_path" path="${filenode.path}"></div>        
 
				%if diff:
 
					${diff|n}
 
				%else:
 
					${_('No changes in this file')}
 
				%endif
 
			</div>
 
		</div>
 
		%endif
 
@@ -183,24 +189,38 @@
 
      var deleteComment = function(comment_id){
 

	
 
          var url = "${url('changeset_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}".replace('__COMMENT_ID__',comment_id);
 
          var postData = '_method=delete';
 
          var success = function(o){
 
              var n = YUD.get('comment-'+comment_id);
 
              n.parentNode.removeChild(n);
 
          }
 
          ajaxPOST(url,postData,success);
 
      }
 

	
 
      YUE.onDOMReady(function(){
 
    	  
 
    	  YUE.on(YUQ('.show-inline-comments'),'change',function(e){
 
    		  var show = 'none';
 
    		  var target = e.currentTarget;
 
    		  if(target.checked){
 
    			  var show = ''
 
    		  }
 
    		  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'),'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){
0 comments (0 inline, 0 general)