Commits

Marcin Kuzminski committed 6ff8bcb

show inline comments option

Comments (0)

Files changed (2)

rhodecode/public/css/style.css

 }
 
 
+.show-inline-comments{
+	position: relative;
+	top:1px
+}
 
 /** comment inline form **/
 

rhodecode/templates/changeset/changeset.html

 	%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,
 					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">
       }
 
       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')){