From 0c29fa19feb0f49522d799f0beb295f2dc840458 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Fri, 17 Dec 2010 13:29:27 -0500 Subject: [PATCH] Ensured comments are displayed only on the lines they were created for --- templates/components/diff.html | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/templates/components/diff.html b/templates/components/diff.html index 0fd31a7..cb94d21 100644 --- a/templates/components/diff.html +++ b/templates/components/diff.html @@ -19,17 +19,16 @@ {{ change.text }} - {# 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 %} - - - {% include "components/comment.html" %} - - - {% endif %} - {% endfor %} + {% for comment in review.comment_set.all %} + {% if change.type == '+' and change.line_b == comment.line_b or change.type == '-' and change.line_a == comment.line_a or change.line_a == comment.line_a and change.line_b == comment.line_b %} + + + {% include "components/comment.html" %} + + + {% endif %} + {% endfor %} {% endif %} {% endif %} {% endfor %}