add revision number for ballot input Fixes issue #911. commit ready for merge

- Legacy-Id: 8136
This commit is contained in:
Deng Hui 2014-07-19 20:41:06 +00:00
parent 02ed2e358a
commit 9371ca969f
2 changed files with 5 additions and 2 deletions

View file

@ -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)

View file

@ -61,12 +61,12 @@
<h2 id="{{ p.ad.plain_name|slugify }}" class="ad-ballot-comment">{% if p.old_ad %}[{% endif %}{{ p.ad.plain_name }}{% if p.old_ad %}]{% endif %}</h2>
{% if p.pos.blocking and p.discuss %}
<p><b>{{ p.pos.name }} ({{ p.discuss_time|date:"Y-m-d" }} for - {{ doc.rev }})</b> <img src="/images/comment.png" width="14" height="12" alt=""/></p>
<p><b>{{ p.pos.name }} ({{ p.discuss_time|date:"Y-m-d" }} for {{ p.get_dochistory.rev }})</b> <img src="/images/comment.png" width="14" height="12" alt=""/></p>
<pre>{{ p.discuss|wrap_text:80 }}</pre>
{% endif %}
{% if p.comment %}
<p><b>Comment ({{ p.comment_time|date:"Y-m-d" }} for - {{ doc.rev }})</b> <img src="/images/comment.png" width="14" height="12" alt=""/></p>
<p><b>Comment ({{ p.comment_time|date:"Y-m-d" }} for - {{ p.get_dochistory.rev }})</b> <img src="/images/comment.png" width="14" height="12" alt=""/></p>
<pre>{{ p.comment|wrap_text:80 }}</pre>
{% endif %}
{% endfor %}