mirror of
https://github.com/correl/codereview.git
synced 2024-12-29 11:09:20 +00:00
38 lines
1.5 KiB
HTML
38 lines
1.5 KiB
HTML
<table class="diff">
|
|
<caption>
|
|
{% if diff.a %}{{ diff.a.path }}{% else %}(New File){% endif %}
|
|
{% if diff.a.path != diff.b.path %}
|
|
=>
|
|
{% if diff.b %}{{ diff.b.path }}{% else %}(Deleted){% endif %}
|
|
{% endif %}
|
|
</caption>
|
|
{% for change in diff.changes %}
|
|
{% if change.type == '@' %}
|
|
<tr class="break">
|
|
<td colspan="3">{{ change.text }}</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr class="{% if change.type == '+' %}add{% endif %}{% if change.type == '-' %}del{% endif %}">
|
|
<td class="number">{% if change.type != '+' %}{{ change.line_a }}{% endif %}</td>
|
|
<td class="number">{% if change.type != '-' %}{{ change.line_b }}{% endif %}</td>
|
|
<td class="text">{{ change.text }}</td>
|
|
</tr>
|
|
|
|
{# TODO: Load in annotations somehow #}
|
|
{% if review %}
|
|
{% for comment in review.comment_set.all %}
|
|
{% if change.type != '+' and change.line_a == comment.line_a or change_type != '-' and change.line_b == comment.line_b %}
|
|
<tr class="annotation">
|
|
<td colspan="3">
|
|
<div class="annotation">
|
|
<strong>{{ comment.author }} @ {{ comment.created }}:</strong>
|
|
<p>{{ comment.text }}</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</table>
|