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
This commit is contained in:
parent
e4d43d8e52
commit
c1c892e3ac
|
@ -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()
|
||||
|
||||
|
|
|
@ -63,12 +63,13 @@
|
|||
<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 -{{ p.get_dochistory.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" }}{% if not p.for_current_revision %} for -{{ p.get_dochistory.rev }}{% endif %})</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 -{{ p.get_dochistory.rev }})</b> <img src="/images/comment.png" width="14" height="12" alt=""/></p>
|
||||
<p><b>Comment ({{ p.comment_time|date:"Y-m-d" }}{% if not p.for_current_revision %} for -{{ p.get_dochistory.rev }}{% endif %})</b> <img src="/images/comment.png" width="14" height="12" alt=""/></p>
|
||||
<pre>{{ p.comment|wrap_text:80 }}</pre>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in a new issue