Changeset - d9116644696b
[Not reviewed]
default
0 2 0
Mads Kiilerich (mads) - 6 years ago 2020-06-11 23:04:31
mads@kiilerich.com
Grafted from: 7cc529bf0f69
diff: allow commenting on meta lines (Issue #329)

There is no good reason it only should be possible to comment on content lines.
Other lines might not have an obvious locator, but we can live with that as
long as each comment only apply in one place.

With this, we actually want the comment bubble on all lines with bubble markup,
so we can loosen the css selector.
2 files changed with 9 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/front-end/kallithea-diff.less
Show inline comments
 
@@ -168,10 +168,7 @@ BIN_FILENODE = 6
 
  left: -8px;
 
  box-sizing: border-box;
 
}
 
/* comment bubble, only visible when in a commentable diff */
 
.commentable-diff tr.line.add:hover td .add-bubble,
 
.commentable-diff tr.line.del:hover td .add-bubble,
 
.commentable-diff tr.line.unmod:hover td .add-bubble {
 
.commentable-diff tr.line:hover td .add-bubble {
 
  display: block;
 
  z-index: 1;
 
}
kallithea/lib/diffs.py
Show inline comments
 
@@ -77,6 +77,7 @@ def as_html(table_class='code-difftable'
 
    })
 

	
 
    for file_info in parsed_lines:
 
        count_no_lineno = 0  # counter to allow comments on lines without new/old line numbers
 
        for chunk in file_info['chunks']:
 
            _html_empty = False
 
            for change in chunk:
 
@@ -127,7 +128,13 @@ def as_html(table_class='code-difftable'
 
                    ###########################################################
 
                    # NO LINE NUMBER
 
                    ###########################################################
 
                    _html.append('''\t<td class="%(olc)s" colspan="2">''' % {
 
                    anchor = "%(filename)s_%(count_no_lineno)s" % {
 
                        'filename': _safe_id(file_info['filename']),
 
                        'count_no_lineno': count_no_lineno,
 
                    }
 
                    count_no_lineno += 1
 
                    _html.append('''\t<td id="%(anchor)s" class="%(olc)s" colspan="2">''' % {
 
                        'anchor': anchor,
 
                        'olc': no_lineno_class,
 
                    })
 
                    _html.append('''</td>\n''')
0 comments (0 inline, 0 general)