changeset 1686:6ff8bcb783e9 beta

show inline comments option
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 14 Nov 2011 22:58:08 +0200
parents 2e583dbfcf22
children e21ec97aca1f
files rhodecode/public/css/style.css rhodecode/templates/changeset/changeset.html
diffstat 2 files changed, 26 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/public/css/style.css	Mon Nov 14 22:31:05 2011 +0200
+++ b/rhodecode/public/css/style.css	Mon Nov 14 22:58:08 2011 +0200
@@ -3342,6 +3342,10 @@
 }
 
 
+.show-inline-comments{
+	position: relative;
+	top:1px
+}
 
 /** comment inline form **/
 
--- a/rhodecode/templates/changeset/changeset.html	Mon Nov 14 22:31:05 2011 +0200
+++ b/rhodecode/templates/changeset/changeset.html	Mon Nov 14 22:58:08 2011 +0200
@@ -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')){