Merged in [19208] from housley@vigilsec.com:

Provide previous ballot positions for both current and former ADs; add test to cover this situation.
 - Legacy-Id: 19230
Note: SVN reference [19208] has been migrated to Git commit fa37d3db3fad007686165a6ed4ad4c99cfca2c85
This commit is contained in:
Robert Sparks 2021-07-15 20:34:23 +00:00
parent 6b5c0ac499
commit c92281f815
2 changed files with 21 additions and 2 deletions

View file

@ -1529,7 +1529,24 @@ class DocTestCase(TestCase):
r = self.client.get(urlreverse("ietf.doc.views_doc.document_ballot", kwargs=dict(name=doc.name)))
self.assertEqual(r.status_code, 200)
self.assertContains(r, '(%s for -%s)' % (pos.comment_time.strftime('%Y-%m-%d'), oldrev))
# Now simulate a new ballot against the new revision and make sure the "was" position is included
pos2 = BallotPositionDocEvent.objects.create(
doc=doc,
rev=doc.rev,
ballot=ballot,
type="changed_ballot_position",
pos_id="noobj",
comment="Still looks okay to me",
comment_time=datetime.datetime.now(),
balloter=Person.objects.get(user__username="ad"),
by=Person.objects.get(name="(System)"))
r = self.client.get(urlreverse("ietf.doc.views_doc.document_ballot", kwargs=dict(name=doc.name)))
self.assertEqual(r.status_code, 200)
self.assertContains(r, pos2.comment)
self.assertContains(r, '(was %s)' % pos.pos)
def test_document_ballot_needed_positions(self):
# draft
doc = IndividualDraftFactory(intended_std_level_id='ps')

View file

@ -74,7 +74,9 @@
{% for p in positions %}
{% if not p.is_old_pos %}
<h4 class="anchor-target" id="{{ p.balloter.plain_name|slugify }}">{{ p.balloter.plain_name }}
<span class="pull-right"><span class="label label-{{ p.pos|pos_to_label }}">{{p.pos}}</span>
<span class="pull-right">
{% if p.old_positions %}<span class="text-muted small">(was {{ p.old_positions|join:", " }})</span>{% endif %}
<span class="label label-{{ p.pos|pos_to_label }}">{{p.pos}}</span>
{% if user|has_role:"Secretariat" %}
<a href="{% url "ietf.doc.views_ballot.edit_position" name=doc.name ballot_id=ballot.pk %}?balloter={{ p.balloter.pk }}" title="Click to edit the position of {{ p.balloter.plain_name }}" class="btn btn-default btn-xs">Edit</a>
{% endif %}