Skip to content

Commit c92281f

Browse files
committed
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 fa37d3d
1 parent 6b5c0ac commit c92281f

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

ietf/doc/tests.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,24 @@ def test_document_ballot(self):
15291529
r = self.client.get(urlreverse("ietf.doc.views_doc.document_ballot", kwargs=dict(name=doc.name)))
15301530
self.assertEqual(r.status_code, 200)
15311531
self.assertContains(r, '(%s for -%s)' % (pos.comment_time.strftime('%Y-%m-%d'), oldrev))
1532-
1532+
1533+
# Now simulate a new ballot against the new revision and make sure the "was" position is included
1534+
pos2 = BallotPositionDocEvent.objects.create(
1535+
doc=doc,
1536+
rev=doc.rev,
1537+
ballot=ballot,
1538+
type="changed_ballot_position",
1539+
pos_id="noobj",
1540+
comment="Still looks okay to me",
1541+
comment_time=datetime.datetime.now(),
1542+
balloter=Person.objects.get(user__username="ad"),
1543+
by=Person.objects.get(name="(System)"))
1544+
1545+
r = self.client.get(urlreverse("ietf.doc.views_doc.document_ballot", kwargs=dict(name=doc.name)))
1546+
self.assertEqual(r.status_code, 200)
1547+
self.assertContains(r, pos2.comment)
1548+
self.assertContains(r, '(was %s)' % pos.pos)
1549+
15331550
def test_document_ballot_needed_positions(self):
15341551
# draft
15351552
doc = IndividualDraftFactory(intended_std_level_id='ps')

ietf/templates/doc/document_ballot_content.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ <h4><span class="label label-{{ n|pos_to_label }}"> {{ n.name }}</span></h4>
7474
{% for p in positions %}
7575
{% if not p.is_old_pos %}
7676
<h4 class="anchor-target" id="{{ p.balloter.plain_name|slugify }}">{{ p.balloter.plain_name }}
77-
<span class="pull-right"><span class="label label-{{ p.pos|pos_to_label }}">{{p.pos}}</span>
77+
<span class="pull-right">
78+
{% if p.old_positions %}<span class="text-muted small">(was {{ p.old_positions|join:", " }})</span>{% endif %}
79+
<span class="label label-{{ p.pos|pos_to_label }}">{{p.pos}}</span>
7880
{% if user|has_role:"Secretariat" %}
7981
<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>
8082
{% endif %}

0 commit comments

Comments
 (0)