Changeset - c83d3d42ab92
[Not reviewed]
beta
1 6 0
Marcin Kuzminski - 14 years ago 2011-12-09 23:48:05
marcin@python-works.com
- diff.css merge to main style.css
- css fixes for diffs
- JS fixes for diff and inline comments
7 files changed with 155 insertions and 161 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/diffs.py
Show inline comments
 
@@ -408,7 +408,7 @@ class DiffProcessor(object):
 
                                    % {'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 @@ class DiffProcessor(object):
 
                                    % {'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)})
rhodecode/public/css/diff.css
Show inline comments
 
deleted file
rhodecode/public/css/style.css
Show inline comments
 
@@ -2742,7 +2742,6 @@ div.gravatar img {
 
    -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 @@ form.comment-inline-form {
 
    -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 @@ form.comment-inline-form {
 
    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
rhodecode/public/js/rhodecode.js
Show inline comments
 
@@ -356,7 +356,8 @@ var injectInlineForm = function(tr){
 
		  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){
rhodecode/templates/base/root.html
Show inline comments
 
@@ -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>
rhodecode/templates/changeset/changeset.html
Show inline comments
 
@@ -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){
rhodecode/templates/changeset/changeset_file_comment.html
Show inline comments
 
@@ -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}">
0 comments (0 inline, 0 general)