review/templates/diff.html @ 7521b06e6b18
web: add hovering on comments to highlight lines
| author | Steve Losh <steve@stevelosh.com> |
|---|---|
| date | Sun, 13 Jun 2010 02:11:28 -0400 |
| parents | 805b5a153985 |
| children | 444f6ef08d88 |
<div class="diff"> <table> <tbody> {% set annotated_diff = rcset.annotated_diff(filename) %} {# We need to ignore the first item from this generator, because we don't care about providing a line-number prefix (for now!). #} {% set ignore_this_variable = annotated_diff.next() %} {% for line in annotated_diff %} {% if line['skipped'] %} <tr class="skipped"> <td colspan="2" class="skip"> … skipped {{ line['skipped'] }} lines … </td> </tr> {% for comment in line['comments'] %} <tr><td class="comment"> {{ macros.gravatar(comment, utils) }} <div> <div class="author"> <a href="mailto:{{ utils['email'](comment.author) }}"> {{ utils['templatefilters'].person(comment.author) }} </a> said (on a skipped line): </div> <div class="message">{{ comment.message|escape }}</div> </div> </td></tr> {% endfor %} {% else %} <tr class="{{ utils['line_type'](line['content']) }}{% if not read_only %} commentable {% endif %} line-{{ line['number'] }}"> <td class="linenumber">{{ line['number'] }}</td> <td class="code"><code>{{ line['content'][1:]|escape }}</code></td> </tr> {% with %} {% set comments = line['comments'] %} {% for comment in comments %} <tr class="comment"> <td class="comment group" colspan="2"> <span class="commentlines disabled">{{ ','.join(utils['map'](utils['str'], comment.lines)) }}</span> {{ macros.gravatar(comment, utils) }} <div> <div class="author"> <a href="mailto:{{ utils['email'](comment.author) }}"> {{ utils['templatefilters'].person(comment.author) }} </a> said: </div> <div class="message">{{ comment.message }}</div> </div> </td> </tr> {% endfor %} {% endwith %} {% endif %} {% endfor %} </tbody> </table> </div>