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
 
@@ -3342,6 +3342,10 @@ form.comment-form {
 
}
 
 
 
.show-inline-comments{
 
	position: relative;
 
	top:1px
 
}
 
 
/** comment inline form **/
 
rhodecode/templates/changeset/changeset.html
Show inline comments
 
@@ -113,8 +113,8 @@
 
	%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,
 
@@ -126,6 +126,12 @@
 
					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">
 
@@ -192,6 +198,20 @@
 
      }
 

	
 
      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')){
0 comments (0 inline, 0 general)