Changeset - efc00d363d1e
[Not reviewed]
beta
0 4 0
Marcin Kuzminski - 13 years ago 2013-03-01 15:25:36
marcin@python-works.com
collapsable diff container in changeset, makes quick review easier
4 files changed with 47 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/public/css/style.css
Show inline comments
 
@@ -235,25 +235,24 @@ a.permalink:hover {
 
h1:hover > a.permalink,
 
h2:hover > a.permalink,
 
h3:hover > a.permalink,
 
h4:hover > a.permalink,
 
h5:hover > a.permalink,
 
h6:hover > a.permalink,
 
div:hover > a.permalink {
 
    visibility: visible;
 
}
 

	
 
#header {
 
}
 

	
 
#header ul#logged-user {
 
    margin-bottom: 5px !important;
 
    -webkit-border-radius: 0px 0px 8px 8px;
 
    -khtml-border-radius: 0px 0px 8px 8px;
 
    -moz-border-radius: 0px 0px 8px 8px;
 
    border-radius: 0px 0px 8px 8px;
 
    height: 37px;
 
    background-color: #003B76;
 
    background-repeat: repeat-x;
 
    background-image: -khtml-gradient(linear, left top, left bottom, from(#003B76), to(#00376E) );
 
    background-image: -moz-linear-gradient(top, #003b76, #00376e);
 
    background-image: -ms-linear-gradient(top, #003b76, #00376e);
 
@@ -4630,24 +4629,41 @@ PULL REQUESTS
 
    padding:2px;
 
}
 
.perm-gravatar-ac {
 
    vertical-align:middle;
 
    padding:2px;
 
    width: 14px;
 
    height: 14px;
 
}
 

	
 
/*****************************************************************************
 
                                  DIFFS CSS
 
******************************************************************************/
 
.diff-collapse{
 
	text-align: center;
 
}
 
.diff-collapse-button{
 
	cursor: pointer;
 
	color: #666;
 
	font-size: 16px;
 
}
 
.diff-container {
 
	margin-bottom: -15px;
 
}
 

	
 
.diff-container.hidden{
 
	display: none;
 
	overflow: hidden;
 
}
 

	
 

	
 
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;
rhodecode/public/js/rhodecode.js
Show inline comments
 
@@ -2152,12 +2152,35 @@ var MultiSelectWidget = function(selecte
 
	YUE.addListener(['add_element','remove_element',
 
	               'add_all_elements','remove_all_elements'],'click',
 
	               prompts_action_callback)
 
	if (form_id !== undefined) {
 
		YUE.addListener(form_id,'submit',function(){
 
		    var choosen = YUD.get(selected_container);
 
		    for (var i = 0; i < choosen.options.length; i++) {
 
		        choosen.options[i].selected = 'selected';
 
		    }
 
		});
 
	}
 
}
 

	
 

	
 
// global hooks after DOM is loaded
 

	
 
YUE.onDOMReady(function(){
 
	YUE.on(YUQ('.diff-collapse-button'), 'click', function(e){
 
		var button = e.currentTarget;
 
		var t = YUD.get(button).getAttribute('target');
 
	    console.log(t);
 
		if(YUD.hasClass(t, 'hidden')){
 
			YUD.removeClass(t, 'hidden');
 
			YUD.get(button).innerHTML = "&uarr; {0} &uarr;".format(_TM['collapse diff']);
 
		}
 
		else if(!YUD.hasClass(t, 'hidden')){
 
			YUD.addClass(t, 'hidden');
 
			YUD.get(button).innerHTML = "&darr; {0} &darr;".format(_TM['expand diff']);
 
		}
 
	});
 
	
 
	
 
	
 
});
 

	
rhodecode/templates/base/root.html
Show inline comments
 
@@ -42,24 +42,26 @@
 
                'add another comment':'${_("add another comment")}',
 
                'Stop following this repository':"${_('Stop following this repository')}",
 
                'Start following this repository':"${_('Start following this repository')}",
 
                'Group':"${_('Group')}",
 
                'members':"${_('members')}",
 
                'loading...':"${_('loading...')}",
 
                'search truncated': "${_('search truncated')}",
 
                'no matching files': "${_('no matching files')}",
 
                'Open new pull request': "${_('Open new pull request')}",
 
                'Open new pull request for selected changesets':  "${_('Open new pull request for selected changesets')}",
 
                'Show selected changes __S -> __E': "${_('Show selected changes __S -> __E')}",
 
                'Selection link': "${_('Selection link')}",
 
                'collapse diff': "${_('collapse diff')}",
 
                'expand diff': "${_('expand diff')}",
 
            };
 
            var _TM = TRANSLATION_MAP;
 

	
 
            var TOGGLE_FOLLOW_URL  = "${h.url('toggle_following')}";
 

	
 
            </script>
 
            <script type="text/javascript" src="${h.url('/js/yui.2.9.js', ver=c.rhodecode_version)}"></script>
 
            <!--[if lt IE 9]>
 
               <script language="javascript" type="text/javascript" src="${h.url('/js/excanvas.min.js')}"></script>
 
            <![endif]-->
 
            <script type="text/javascript" src="${h.url('/js/yui.flot.js', ver=c.rhodecode_version)}"></script>
 
            <script type="text/javascript" src="${h.url('/js/native.history.js', ver=c.rhodecode_version)}"></script>
rhodecode/templates/changeset/diff_block.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
##usage:
 
## <%namespace name="diff_block" file="/changeset/diff_block.html"/>
 
## ${diff_block.diff_block(change)}
 
##
 
<%def name="diff_block(change)">
 

	
 
<div class="diff-collapse">
 
    <span target="${'diff-container-%s' % (id(change))}" class="diff-collapse-button">&uarr; ${_('collapse diff')} &uarr;</span>
 
</div>
 
<div class="diff-container" id="${'diff-container-%s' % (id(change))}">
 
%for FID,(cs1, cs2, change, path, diff, stats) in change.iteritems():
 
    ##%if op !='removed':
 
    <div id="${FID}_target" style="clear:both;margin-top:25px"></div>
 
    <div id="${FID}" class="diffblock  margined comm">
 
        <div class="code-header">
 
            <div class="changeset_header">
 
                <div class="changeset_file">
 
                    ${h.link_to_if(change!='removed',h.safe_unicode(path),h.url('files_home',repo_name=c.repo_name,
 
                    revision=cs2,f_path=h.safe_unicode(path)))}
 
                </div>
 
                <div class="diff-actions">
 
                  <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(path),diff2=cs2,diff1=cs1,diff='diff',fulldiff=1)}" class="tooltip" title="${h.tooltip(_('show full diff for this file'))}"><img class="icon" src="${h.url('/images/icons/page_white_go.png')}"/></a>
 
@@ -28,25 +31,25 @@
 
                  ${h.checkbox('',checked="checked",class_="show-inline-comments",id_for=h.FID(cs2,path))}
 
                  </label>
 
                </span>
 
            </div>
 
        </div>
 
        <div class="code-body">
 
            <div class="full_f_path" path="${h.safe_unicode(path)}"></div>
 
            ${diff|n}
 
        </div>
 
    </div>
 
    ##%endif
 
%endfor
 

	
 
</div>
 
</%def>
 

	
 
<%def name="diff_block_simple(change)">
 

	
 
  %for op,filenode_path,diff in change:
 
    <div id="${h.FID('',filenode_path)}_target" style="clear:both;margin-top:25px"></div>
 
    <div id="${h.FID('',filenode_path)}" class="diffblock  margined comm">
 
      <div class="code-header">
 
          <div class="changeset_header">
 
              <div class="changeset_file">
 
                  ${h.safe_unicode(filenode_path)} |
 
                  <a class="spantag" href="${h.url('files_home', repo_name=c.repo_name, f_path=filenode_path, revision=c.org_ref)}" title="${_('show file at latest version in this repo')}">${c.org_ref_type}@${h.short_id(c.org_ref) if c.org_ref_type=='rev' else c.org_ref}</a> -&gt;
0 comments (0 inline, 0 general)