Changeset - 3954bdaf6243
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 15 years ago 2011-04-14 01:07:18
marcin@python-works.com
fixed possible float division, and changeset ranges bug introduced in stat changeset.
2 files changed with 4 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/helpers.py
Show inline comments
 
@@ -641,14 +641,15 @@ def repo_link(groups_and_repos):
 
        return literal(' » '.join(map(make_link, groups)) + \
 
                       " » " + repo_name)
 

	
 

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

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

	
 
    if p_sum > width:
rhodecode/templates/changeset/changeset_range.html
Show inline comments
 
@@ -50,22 +50,22 @@
 
            </table>
 
	        </div>
 
	        <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Files affected')}</div>
 
	        <div class="cs_files">
 
	               %for cs in c.cs_ranges:
 
	                   <div class="cur_cs">r${cs}</div>
 
	                %for change,filenode,diff,cs1,cs2 in c.changes[cs.raw_id]:
 
	                %for change,filenode,diff,cs1,cs2,st in c.changes[cs.raw_id]:
 
	                    <div class="cs_${change}">${h.link_to(h.safe_unicode(filenode.path),h.url.current(anchor=h.repo_name_slug('C%s-%s' % (cs.short_id,h.safe_unicode(filenode.path)))))}</div>
 
	                %endfor
 
	               %endfor 
 
	        </div>         
 
	    </div>
 
	    
 
    </div>
 
   %for cs in c.cs_ranges:    	
 
	%for change,filenode,diff,cs1,cs2 in c.changes[cs.raw_id]:
 
	%for change,filenode,diff,cs1,cs2,st in c.changes[cs.raw_id]:
 
		%if change !='removed':
 
		<div style="clear:both;height:10px"></div>
 
		<div class="diffblock">
 
			<div id="${h.repo_name_slug('C%s-%s' % (cs.short_id,h.safe_unicode(filenode.path)))}" class="code-header">
 
				<div class="changeset_header">
 
					<span class="changeset_file">
0 comments (0 inline, 0 general)