   <%
        # FIXME: split stat and diff
        n_add = patch.additions
        n_del = patch.deletions
        n_total = n_add + n_del
        n_plus = min(n_add * 5 // n_total, n_add) if n_total else 0
        n_minus = min(n_del * 5 // n_total, n_del) if n_total else 0
        n_normal = 5 - n_plus - n_minus
    %>
    % if position == 'stats':
        <span class="diffstat">
            <a href="#diff-${index}" class="tooltipped leftwards"
                title="${n_add} addition${'s' if n_add > 1 el