From c1c892e3ac02e110543f62dfaabf048801e3e550 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Sun, 12 Oct 2014 18:47:35 +0000 Subject: [PATCH] Merged in [8303] from rjsparks@nostrum.com:\n Only show comment/discuss document version on the ballot page when the text is for a version of the document other than the current one. Fixes bug #1482. - Legacy-Id: 8389 Note: SVN reference [8303] has been migrated to Git commit 75f46e78e51c7312e9e31e1330f5f1f4eee58deb --- ietf/doc/models.py | 3 +++ ietf/templates/doc/document_ballot_content.html | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ietf/doc/models.py b/ietf/doc/models.py index 18275c6c3..22de90016 100644 --- a/ietf/doc/models.py +++ b/ietf/doc/models.py @@ -640,6 +640,9 @@ class DocEvent(models.Model): doc = models.ForeignKey('doc.Document') desc = models.TextField() + def for_current_revision(self): + return self.time >= self.doc.time + def get_dochistory(self): return DocHistory.objects.filter(time__lte=self.time,doc__name=self.doc.name).order_by('-time').first() diff --git a/ietf/templates/doc/document_ballot_content.html b/ietf/templates/doc/document_ballot_content.html index 0a9cf0e19..0e83883fe 100644 --- a/ietf/templates/doc/document_ballot_content.html +++ b/ietf/templates/doc/document_ballot_content.html @@ -63,12 +63,13 @@

{% if p.old_ad %}[{% endif %}{{ p.ad.plain_name }}{% if p.old_ad %}]{% endif %}

{% if p.pos.blocking and p.discuss %} -

{{ p.pos.name }} ({{ p.discuss_time|date:"Y-m-d" }} for -{{ p.get_dochistory.rev }})

+

{{ p.pos.name }} ({{ p.discuss_time|date:"Y-m-d" }}{% if not p.for_current_revision %} for -{{ p.get_dochistory.rev }}{% endif %})

+
{{ p.discuss|wrap_text:80 }}
{% endif %} {% if p.comment %} -

Comment ({{ p.comment_time|date:"Y-m-d" }} for -{{ p.get_dochistory.rev }})

+

Comment ({{ p.comment_time|date:"Y-m-d" }}{% if not p.for_current_revision %} for -{{ p.get_dochistory.rev }}{% endif %})

{{ p.comment|wrap_text:80 }}
{% endif %} {% endfor %}