Changeset - 2f2695771579
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 14 years ago 2012-03-09 21:12:00
marcin@python-works.com
ui
2 files changed with 32 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/helpers.py
Show inline comments
 
@@ -739,52 +739,52 @@ def fancy_file_stats(stats):
 

	
 
    :param stats: two element list of added/deleted lines of code
 
    """
 

	
 
    a, d, t = stats[0], stats[1], stats[0] + stats[1]
 
    width = 100
 
    unit = float(width) / (t or 1)
 

	
 
    # needs > 9% of width to be visible or 0 to be hidden
 
    a_p = max(9, unit * a) if a > 0 else 0
 
    d_p = max(9, unit * d) if d > 0 else 0
 
    p_sum = a_p + d_p
 

	
 
    if p_sum > width:
 
        #adjust the percentage to be == 100% since we adjusted to 9
 
        if a_p > d_p:
 
            a_p = a_p - (p_sum - width)
 
        else:
 
            d_p = d_p - (p_sum - width)
 

	
 
    a_v = a if a > 0 else ''
 
    d_v = d if d > 0 else ''
 

	
 
    def cgen(l_type):
 
        mapping = {'tr': 'top-right-rounded-corner',
 
                   'tl': 'top-left-rounded-corner',
 
                   'br': 'bottom-right-rounded-corner',
 
                   'bl': 'bottom-left-rounded-corner'}
 
        mapping = {'tr': 'top-right-rounded-corner-mid',
 
                   'tl': 'top-left-rounded-corner-mid',
 
                   'br': 'bottom-right-rounded-corner-mid',
 
                   'bl': 'bottom-left-rounded-corner-mid'}
 
        map_getter = lambda x: mapping[x]
 

	
 
        if l_type == 'a' and d_v:
 
            #case when added and deleted are present
 
            return ' '.join(map(map_getter, ['tl', 'bl']))
 

	
 
        if l_type == 'a' and not d_v:
 
            return ' '.join(map(map_getter, ['tr', 'br', 'tl', 'bl']))
 

	
 
        if l_type == 'd' and a_v:
 
            return ' '.join(map(map_getter, ['tr', 'br']))
 

	
 
        if l_type == 'd' and not a_v:
 
            return ' '.join(map(map_getter, ['tr', 'br', 'tl', 'bl']))
 

	
 
    d_a = '<div class="added %s" style="width:%s%%">%s</div>' % (
 
        cgen('a'), a_p, a_v
 
    )
 
    d_d = '<div class="deleted %s" style="width:%s%%">%s</div>' % (
 
        cgen('d'), d_p, d_v
 
    )
 
    return literal('<div style="width:%spx">%s%s</div>' % (width, d_a, d_d))
 

	
 

	
rhodecode/public/css/style.css
Show inline comments
 
@@ -164,48 +164,76 @@ div.options a {
 
	border-top-left-radius: 8px;
 
}
 
 
.top-right-rounded-corner {
 
	-webkit-border-top-right-radius: 8px;
 
	-khtml-border-radius-topright: 8px;
 
	-moz-border-radius-topright: 8px;
 
	border-top-right-radius: 8px;
 
}
 
 
.bottom-left-rounded-corner {
 
	-webkit-border-bottom-left-radius: 8px;
 
	-khtml-border-radius-bottomleft: 8px;
 
	-moz-border-radius-bottomleft: 8px;
 
	border-bottom-left-radius: 8px;
 
}
 
 
.bottom-right-rounded-corner {
 
	-webkit-border-bottom-right-radius: 8px;
 
	-khtml-border-radius-bottomright: 8px;
 
	-moz-border-radius-bottomright: 8px;
 
	border-bottom-right-radius: 8px;
 
}
 
 
.top-left-rounded-corner-mid {
 
    -webkit-border-top-left-radius: 4px;
 
    -khtml-border-radius-topleft: 4px;
 
    -moz-border-radius-topleft: 4px;
 
    border-top-left-radius: 4px;
 
}
 
 
.top-right-rounded-corner-mid {
 
    -webkit-border-top-right-radius: 4px;
 
    -khtml-border-radius-topright: 4px;
 
    -moz-border-radius-topright: 4px;
 
    border-top-right-radius: 4px;
 
}
 
 
.bottom-left-rounded-corner-mid {
 
    -webkit-border-bottom-left-radius: 4px;
 
    -khtml-border-radius-bottomleft: 4px;
 
    -moz-border-radius-bottomleft: 4px;
 
    border-bottom-left-radius: 4px;
 
}
 
 
.bottom-right-rounded-corner-mid {
 
    -webkit-border-bottom-right-radius: 4px;
 
    -khtml-border-radius-bottomright: 4px;
 
    -moz-border-radius-bottomright: 4px;
 
    border-bottom-right-radius: 4px;
 
}
 
 
.help-block {
 
    color: #999999;
 
    display: block;
 
    margin-bottom: 0;
 
    margin-top: 5px;
 
}
 
 
#header {
 
	margin: 0;
 
	padding: 0 10px;
 
}
 
 
#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: #eedc94;
 
    background-repeat: repeat-x;
 
    background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1),
 
        to(#eedc94) );
 
    background-image: -moz-linear-gradient(top, #003b76, #00376e);
0 comments (0 inline, 0 general)