%def name="render_line(line_num, tokens,
annotation=None,
bgcolor=None)">
<%
from rhodecode.lib.codeblocks import render_tokenstream
# avoid module lookup for performance
html_escape = h.html_escape
%>
|
## newline at end is necessary for highlight to work when line is empty
## and for copy pasting code to work as expected
${render_tokenstream(tokens)|n}${'\n'}
|
%def>
<%def name="render_annotation_lines(annotation, lines, color_hasher)">
<%
rowspan = len(lines) + 1 # span the line's and annotation
%>
%if not annotation:
|
|
%else:
${h.gravatar_with_user(annotation.author, 16) | n}
${h.truncate(annotation.message, len(lines) * 30)}
|
r${annotation.revision}
|
%endif
%for line_num, tokens in lines:
${render_line(line_num, tokens,
bgcolor=color_hasher(annotation and annotation.raw_id or ''),
annotation=annotation,
)}
%endfor
%def>