changeset 1772:c83d3d42ab92 beta

- diff.css merge to main style.css - css fixes for diffs - JS fixes for diff and inline comments
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 10 Dec 2011 00:48:05 +0200
parents 5948ab03e639
children e8caed093994
files rhodecode/lib/diffs.py rhodecode/public/css/diff.css rhodecode/public/css/style.css rhodecode/public/js/rhodecode.js rhodecode/templates/base/root.html rhodecode/templates/changeset/changeset.html rhodecode/templates/changeset/changeset_file_comment.html
diffstat 7 files changed, 155 insertions(+), 161 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/diffs.py	Fri Dec 09 13:45:48 2011 +0200
+++ b/rhodecode/lib/diffs.py	Sat Dec 10 00:48:05 2011 +0200
@@ -408,7 +408,7 @@
                                     % {'a_id': anchor_old_id,
                                        'old_lineno_cls': old_lineno_class})
 
-                    _html.append('''<pre>%(link)s</pre>''' \
+                    _html.append('''%(link)s''' \
                         % {'link':
                         _link_to_if(cond_old, change['old_lineno'], '#%s' \
                                                                 % anchor_old)})
@@ -421,7 +421,7 @@
                                     % {'a_id': anchor_new_id,
                                        'new_lineno_cls': new_lineno_class})
 
-                    _html.append('''<pre>%(link)s</pre>''' \
+                    _html.append('''%(link)s''' \
                         % {'link':
                         _link_to_if(cond_new, change['new_lineno'], '#%s' \
                                                                 % anchor_new)})
--- a/rhodecode/public/css/diff.css	Fri Dec 09 13:45:48 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-div.diffblock {
-    overflow: auto;
-    padding: 0px;
-    border: 1px solid #ccc;
-    background: #f8f8f8;
-    font-size: 100%;
-    line-height: 100%;
-    /* new */
-    line-height: 125%;
-    -webkit-border-radius: 6px 6px 0px 0px;
-    -moz-border-radius: 6px 6px 0px 0px;
-    border-radius: 6px 6px 0px 0px;     
-}
-
-div.diffblock.margined{
-	margin: 0px 20px 0px 20px;
-}
-
-div.diffblock .code-header{
-	border-bottom: 1px solid #CCCCCC;
-	background: #EEEEEE;
-	padding:10px 0 10px 0;
-}
-div.diffblock .code-header div{
-	margin-left:10px;
-	font-weight: bold;
-	font-size: 14px;
-}
-div.diffblock .code-body{
-	background: #FFFFFF;
-}
-div.diffblock pre.raw{
-	background: #FFFFFF;
-	color:#000000;
-}
-
-table.code-difftable{
-	border-collapse: collapse;
-	width: 99%;
-}
-
-table.code-difftable td {
-    padding: 0 !important; 
-    background: none !important; 
-    border:0 !important;    
-}
-
-
-.code-difftable .context{
-	background:none repeat scroll 0 0 #DDE7EF;
-}
-.code-difftable .add{
-	background:none repeat scroll 0 0 #DDFFDD;
-}
-.code-difftable .add ins{
-	background:none repeat scroll 0 0 #AAFFAA;
-	text-decoration:none;
-}
-
-.code-difftable .del{
-	background:none repeat scroll 0 0 #FFDDDD;
-}
-.code-difftable .del del{
-	background:none repeat scroll 0 0 #FFAAAA;
-	text-decoration:none;
-}
-
-.code-difftable .lineno{
-	background:none repeat scroll 0 0 #EEEEEE !important;
-	padding-left:2px;
-	padding-right:2px;
-	text-align:right;
-	width:30px;
-	-moz-user-select:none;
-	-webkit-user-select: none;
-}
-.code-difftable .lineno-inline{
-    background:none repeat scroll 0 0 #FFF !important;
-    padding-left:2px;
-    padding-right:2px;
-    text-align:right;
-    width:30px;
-    -moz-user-select:none;
-    -webkit-user-select: none;
-}
-.code-difftable .new {
-	border-right: 1px solid #CCC !important;
-}
-.code-difftable .old {
-    border-right: 1px solid #CCC !important;
-}
-
-.code-difftable .lineno-inline.new-inline{
-	
-}
-.code-difftable .lineno-inline.old-inline{
-	border-right: 1px solid #CCC !important;
-}
-
-.code-difftable .lineno pre{
-	color:#747474 !important;
-	font:11px "Bitstream Vera Sans Mono",Monaco,"Courier New",Courier,monospace !important;
-	letter-spacing:-1px;
-	text-align:right;
-	width:20px;
-}
-.code-difftable .lineno a{
-font-weight: 700;
-cursor: pointer;
-}
-.code-difftable .code td{
-	margin:0;
-	padding: 0;
-}
-.code-difftable .code pre{
-	margin:0;
-	padding:0;
-}
-
-.code { 
-	display: block;
-	width: 100%;
-}
-.code-diff {
-    padding: 0px;
-    margin-top: 5px;
-    margin-bottom: 5px;
-    border-left: 2px solid #ccc;
-}
-.code-diff pre, .line pre { 
-	padding: 3px;
-    margin: 0;
-}
-.lineno a { 
-	text-decoration: none; 
-}
-
-.line{
-	padding:0;
-	margin:0;
-}
-
-.diffblock.margined.comm .line:hover{
-    background-color:#FFFFCC !important;
-    cursor: pointer !important;
-    background-image:url("../images/icons/comment_add.png") !important;
-    background-repeat:no-repeat !important;
-    background-position: right !important;
-    background-position: 100% 50% !important;
-}
\ No newline at end of file
--- a/rhodecode/public/css/style.css	Fri Dec 09 13:45:48 2011 +0200
+++ b/rhodecode/public/css/style.css	Sat Dec 10 00:48:05 2011 +0200
@@ -2742,7 +2742,6 @@
     -khtml-border-radius: 4px 4px 4px 4px !important;
     -moz-border-radius: 4px 4px 4px 4px !important;
     border-radius: 4px 4px 4px 4px !important;
-    box-shadow: 0 1px 0 #DADADA !important;
     cursor: pointer !important;
 	padding: 3px 3px 3px 3px;	
 
@@ -3557,8 +3556,11 @@
     -moz-border-radius: 4px;
     border-radius: 4px;
     margin: 3px 3px 5px 5px;
-}
-
+    background-color: #FAFAFA;
+}
+.inline-comments .comment-wrapp{
+	padding:1px;
+}
 .inline-comments .comment .meta {
     background: #f8f8f8;
     padding: 6px;
@@ -3636,4 +3638,137 @@
     clear:both;
     border-bottom: 1px solid #eee;
     padding:5px 0px 5px 38px;
+}
+
+
+/*****************************************************************************
+                                  DIFFS CSS
+******************************************************************************/
+
+div.diffblock {
+    overflow: auto;
+    padding: 0px;
+    border: 1px solid #ccc;
+    background: #f8f8f8;
+    font-size: 100%;
+    line-height: 100%;
+    /* new */
+    line-height: 125%;
+    -webkit-border-radius: 6px 6px 0px 0px;
+    -moz-border-radius: 6px 6px 0px 0px;
+    border-radius: 6px 6px 0px 0px;     
+}
+div.diffblock.margined{
+    margin: 0px 20px 0px 20px;
+}
+div.diffblock .code-header{
+    border-bottom: 1px solid #CCCCCC;
+    background: #EEEEEE;
+    padding:10px 0 10px 0;
+}
+div.diffblock .code-header div{
+    margin-left:10px;
+    font-weight: bold;
+    font-size: 14px;
+}
+div.diffblock .code-body{
+    background: #FFFFFF;
+}
+div.diffblock pre.raw{
+    background: #FFFFFF;
+    color:#000000;
+}
+table.code-difftable{
+    border-collapse: collapse;
+    width: 99%;
+}
+table.code-difftable td {
+    padding: 0 !important; 
+    background: none !important; 
+    border:0 !important;
+    vertical-align: none !important;
+}
+table.code-difftable .context{
+    background:none repeat scroll 0 0 #DDE7EF;
+}
+table.code-difftable .add{
+    background:none repeat scroll 0 0 #DDFFDD;
+}
+table.code-difftable .add ins{
+    background:none repeat scroll 0 0 #AAFFAA;
+    text-decoration:none;
+}
+table.code-difftable .del{
+    background:none repeat scroll 0 0 #FFDDDD;
+}
+table.code-difftable .del del{
+    background:none repeat scroll 0 0 #FFAAAA;
+    text-decoration:none;
+}
+
+/** LINE NUMBERS **/
+table.code-difftable .lineno{
+    background:none repeat scroll 0 0 #EEEEEE !important;
+    padding-left:2px;
+    padding-right:2px;
+    text-align:right;
+    width:30px;
+    -moz-user-select:none;
+    -webkit-user-select: none;
+    border-right: 1px solid #CCC !important;
+    border-left: 0px solid #CCC !important;
+    border-top: 0px solid #CCC !important;
+    border-bottom: none !important;
+    vertical-align: middle !important;
+    
+}
+table.code-difftable .lineno.new {
+}
+table.code-difftable .lineno.old {
+}
+table.code-difftable .lineno a{
+    color:#747474 !important;
+    font:11px "Bitstream Vera Sans Mono",Monaco,"Courier New",Courier,monospace !important;
+    letter-spacing:-1px;
+    text-align:right;
+    float:right;
+    width:20px;
+    padding-right: 2px;
+    cursor: pointer;
+}
+
+table.code-difftable .lineno-inline{
+    background:none repeat scroll 0 0 #FFF !important;
+    padding-left:2px;
+    padding-right:2px;
+    text-align:right;
+    width:30px;
+    -moz-user-select:none;
+    -webkit-user-select: none;
+}
+
+/** CODE **/
+table.code-difftable .code { 
+    display: block;
+    width: 100%;
+}
+table.code-difftable .code td{
+    margin:0;
+    padding:0;
+}
+table.code-difftable .code pre{
+    margin:0;
+    padding:0;
+    height: 17px;
+    line-height: 17px;
+}
+
+
+.diffblock.margined.comm .line .code:hover{
+    background-color:#FFFFCC !important;
+    cursor: pointer !important;
+    background-image:url("../images/icons/comment_add.png") !important;
+    background-repeat:no-repeat !important;
+    background-position: right !important;
+    background-position: 0% 50% !important;
 }
\ No newline at end of file
--- a/rhodecode/public/js/rhodecode.js	Fri Dec 09 13:45:48 2011 +0200
+++ b/rhodecode/public/js/rhodecode.js	Sat Dec 10 00:48:05 2011 +0200
@@ -356,7 +356,8 @@
 		  target_tr = YUD.getNextSibling(tr);
 	  }
 	  YUD.insertAfter(form,target_tr);
-	  YUD.get('text_'+lineno).focus();	
+	  YUD.get('text_'+lineno).focus();
+	  tooltip_activate();
 };
 
 var createInlineAddButton = function(tr,label){
--- a/rhodecode/templates/base/root.html	Fri Dec 09 13:45:48 2011 +0200
+++ b/rhodecode/templates/base/root.html	Sat Dec 10 00:48:05 2011 +0200
@@ -11,7 +11,6 @@
         <%def name="css()">
             <link rel="stylesheet" type="text/css" href="${h.url('/css/style.css')}" media="screen"/>
             <link rel="stylesheet" type="text/css" href="${h.url('/css/pygments.css')}"/>
-            <link rel="stylesheet" type="text/css" href="${h.url('/css/diff.css')}"/>
             ## EXTRA FOR CSS
             ${self.css_extra()}
         </%def>
--- a/rhodecode/templates/changeset/changeset.html	Fri Dec 09 13:45:48 2011 +0200
+++ b/rhodecode/templates/changeset/changeset.html	Sat Dec 10 00:48:05 2011 +0200
@@ -132,7 +132,7 @@
 					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">
+                    <span style="float:right;margin-top:-3px">
                       <label>
                       ${_('show inline comments')}
                       ${h.checkbox('',checked="checked",class_="show-inline-comments",id_for=self.fid(filenode.changeset.raw_id,filenode.path))}
@@ -181,6 +181,7 @@
             <div class="clearfix">
                 <div class="comment-help">
                     ${_('Comments parsed using')} <a href="${h.url('rst_help')}">RST</a> ${_('syntax')}
+                    ${_('with')} <span style="color:#003367" class="tooltip" title="${_('Use @username inside this text to send notification to this RhodeCode user')}">@mention</span> ${_('support')}
                 </div>
                     ${h.textarea('text')}
             </div>
@@ -216,6 +217,10 @@
     		  for(c in comments){ 
     		     YUD.setStyle(comments[c],'display',show);
     		  }
+    		  var btns = YUQ('#{0} .inline-comments-button'.format(boxid));
+              for(c in btns){ 
+                  YUD.setStyle(btns[c],'display',show);
+               }    		  
     	  })
           
           YUE.on(YUQ('.line'),'click',function(e){
--- a/rhodecode/templates/changeset/changeset_file_comment.html	Fri Dec 09 13:45:48 2011 +0200
+++ b/rhodecode/templates/changeset/changeset_file_comment.html	Sat Dec 10 00:48:05 2011 +0200
@@ -4,6 +4,7 @@
 ##
 <%def name="comment_block(co)">
   <div class="comment" id="comment-${co.comment_id}">
+    <div class="comment-wrapp">
   	<div class="meta">
   		<span class="user">
   			<img src="${h.gravatar_url(co.author.email, 20)}" />
@@ -27,6 +28,7 @@
   		%endif
   		${h.rst_w_mentions(co.text)|n}
   	</div>
+    </div>
   </div>
 </%def>
 
@@ -38,9 +40,11 @@
   %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>
-              <textarea id="text_{1}" name="text"></textarea>
+          <div class="comment-help">${_('Commenting on line')} {1}. ${_('Comments parsed using')} 
+          <a href="${h.url('rst_help')}">RST</a> ${_('syntax')} ${_('with')} 
+          <span style="color:#003367" class="tooltip" title="${_('Use @username inside this text to send notification to this RhodeCode user')}">@mention</span> ${_('support')}
+          </div>
+          <textarea id="text_{1}" name="text"></textarea>
       </div>
       <div class="comment-button">
       <input type="hidden" name="f_path" value="{0}">