2010-12-02 15:08:50 +00:00
|
|
|
<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 %}
|
2010-12-14 04:29:13 +00:00
|
|
|
<tr id="{{ review.pk }}_{{ forloop.parentloop.counter0 }}_{% if change.type != '+' %}{{ change.line_a }}{% else %}0{% endif %}_{% if change.type != '-' %}{{ change.line_b }}{% else %}0{% endif %}"
|
|
|
|
class="{% if change.type == '+' %}add{% endif %}{% if change.type == '-' %}del{% endif %}">
|
2010-12-02 15:08:50 +00:00
|
|
|
<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>
|
2010-12-09 05:06:17 +00:00
|
|
|
|
|
|
|
{# TODO: Load in annotations somehow #}
|
2010-12-13 05:33:04 +00:00
|
|
|
{% 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 %}
|
2010-12-09 05:06:17 +00:00
|
|
|
<tr class="annotation">
|
|
|
|
<td colspan="3">
|
2010-12-16 01:55:50 +00:00
|
|
|
{% include "components/comment.html" %}
|
2010-12-09 05:06:17 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endif %}
|
2010-12-13 05:33:04 +00:00
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2010-12-02 15:08:50 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|