# HG changeset patch # User Marcin Kuzminski # Date 2017-02-07 20:54:05 # Node ID 434b986f461b6ed1bd185fa1c798092ab68f6790 # Parent 16beb154030269e07032249f737bb71acd19787a annotations: fixed UI problems in annotation view for newer browsers. diff --git a/rhodecode/lib/codeblocks.py b/rhodecode/lib/codeblocks.py --- a/rhodecode/lib/codeblocks.py +++ b/rhodecode/lib/codeblocks.py @@ -111,7 +111,7 @@ def filenode_as_annotated_lines_tokens(f ] """ - commit_cache = {} # cache commit_getter lookups + commit_cache = {} # cache commit_getter lookups def _get_annotation(commit_id, commit_getter): if commit_id not in commit_cache: diff --git a/rhodecode/public/css/code-block.less b/rhodecode/public/css/code-block.less --- a/rhodecode/public/css/code-block.less +++ b/rhodecode/public/css/code-block.less @@ -969,17 +969,6 @@ table.cb { tr { &.cb-annotate { border-top: 1px solid #eee; - - &+ .cb-line { - border-top: 1px solid #eee; - } - - &:first-child { - border-top: none; - &+ .cb-line { - border-top: none; - } - } } &.cb-hunk { @@ -1114,7 +1103,9 @@ table.cb { background: #ffdddd; } } - + &.cb-annotate-message-spacer { + width:8px; + } &.cb-annotate-info { width: 320px; min-width: 320px; @@ -1122,22 +1113,23 @@ table.cb { padding: 5px 2px; font-size: 13px; - strong.cb-annotate-message { - padding: 5px 0; + .cb-annotate-message { + padding: 2px 0px 0px 0px; white-space: pre-line; - display: inline-block; + overflow: hidden; } .rc-user { float: none; padding: 0 6px 0 17px; - min-width: auto; - min-height: auto; + min-width: unset; + min-height: unset; } } &.cb-annotate-revision { cursor: pointer; text-align: right; + padding: 1px 3px 0px 3px; } } } diff --git a/rhodecode/templates/codeblocks/source.mako b/rhodecode/templates/codeblocks/source.mako --- a/rhodecode/templates/codeblocks/source.mako +++ b/rhodecode/templates/codeblocks/source.mako @@ -1,16 +1,50 @@ <%def name="render_line(line_num, tokens, annotation=None, - bgcolor=None)"> + bgcolor=None, show_annotation=None)"> <% from rhodecode.lib.codeblocks import render_tokenstream # avoid module lookup for performance html_escape = h.html_escape %> - + + % if annotation: + % if show_annotation: + + ${h.gravatar_with_user(annotation.author, 16) | n} +
${h.chop_at_smart(annotation.message, '\n', suffix_if_chopped='...')}
+ + + + + r${annotation.revision} + + + % else: + + + + + % endif + % else: + + % endif + + @@ -27,40 +61,11 @@ <%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: + % for line_num, tokens in lines: ${render_line(line_num, tokens, bgcolor=color_hasher(annotation and annotation.raw_id or ''), - annotation=annotation, + annotation=annotation, show_annotation=loop.first )} - %endfor + % endfor +