From 9371ca969f5a7c4ad7db48aa21aa6b5e09d2ef26 Mon Sep 17 00:00:00 2001 From: Deng Hui Date: Sat, 19 Jul 2014 20:41:06 +0000 Subject: [PATCH] add revision number for ballot input Fixes issue #911. commit ready for merge - Legacy-Id: 8136 --- ietf/doc/models.py | 3 +++ ietf/templates/doc/document_ballot_content.html | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ietf/doc/models.py b/ietf/doc/models.py index e5e304245..8fd884866 100644 --- a/ietf/doc/models.py +++ b/ietf/doc/models.py @@ -636,6 +636,9 @@ class DocEvent(models.Model): doc = models.ForeignKey('doc.Document') desc = models.TextField() + def get_dochistory(self): + return DocHistory.objects.filter(time__lte=self.time,doc__name=self.doc.name).order_by('-time').first() + def __unicode__(self): return u"%s %s by %s at %s" % (self.doc.name, self.get_type_display().lower(), self.by.plain_name(), self.time) diff --git a/ietf/templates/doc/document_ballot_content.html b/ietf/templates/doc/document_ballot_content.html index 06ca17a41..cf629aa9a 100644 --- a/ietf/templates/doc/document_ballot_content.html +++ b/ietf/templates/doc/document_ballot_content.html @@ -61,12 +61,12 @@

{% 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 - {{ doc.rev }})

+

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

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

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

+

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

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