Skip to content

Commit 8688c41

Browse files
committed
/doc/*: Show information about ballot sets
- Legacy-Id: 2166
1 parent b287f7c commit 8688c41

4 files changed

Lines changed: 25 additions & 5 deletions

File tree

ietf/idrfc/idrfc_wrapper.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,7 @@ class BallotWrapper:
532532
_idinternal = None
533533
ballot = None
534534
ballot_active = False
535-
536535
_positions = None
537-
538536
position_values = ["Discuss", "Yes", "No Objection", "Abstain", "Recuse", "No Record"]
539537

540538
def __init__(self, idinternal):
@@ -544,6 +542,7 @@ def __init__(self, idinternal):
544542
self.ballot_active = self.ballot.ballot_issued and (str(idinternal.cur_state) in BALLOT_ACTIVE_STATES) and str(idinternal.draft.status)=="Active";
545543
else:
546544
self.ballot_active = self.ballot.ballot_issued and (str(idinternal.cur_state) in BALLOT_ACTIVE_STATES)
545+
self._ballot_set = None
547546

548547
def approval_text(self):
549548
return self.ballot.approval_text
@@ -559,6 +558,15 @@ def deferred_by(self):
559558
return self.ballot.defer_by
560559
def deferred_date(self):
561560
return self.ballot.defer_date
561+
def is_ballot_set(self):
562+
if not self._ballot_set:
563+
self._ballot_set = self._idinternal.ballot_set()
564+
return len(list(self._ballot_set)) > 1
565+
def ballot_set_other(self):
566+
if not self.is_ballot_set():
567+
return []
568+
else:
569+
return self._ballot_set.exclude(draft=self._idinternal)
562570

563571
def _init(self):
564572
try:

ietf/idrfc/testurl.list

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
200 /doc/rfc822/
3131
200 /doc/rfc822/_debug.data
3232

33+
# ballot sets
34+
200 /doc/rfc3550/_ballot.data
35+
200 /doc/rfc3551/_ballot.data
36+
200 /doc/draft-irtf-dtnrg-ltp/_ballot.data
37+
3338
# file formats
3439
200 /doc/rfc9/ # PDF only
3540
200 /doc/rfc2490/ # TXT+PDF+PS

ietf/idrfc/views_doc.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,19 @@ def document_ballot(request, name):
202202
r = re.compile("^rfc([1-9][0-9]*)$")
203203
m = r.match(name)
204204
if m:
205-
id = get_object_or_404(IDInternal, rfc_flag=1, draft=int(m.group(1)))
205+
rfc_number = int(m.group(1))
206+
rfci = get_object_or_404(RfcIndex, rfc_number=rfc_number)
207+
id = get_object_or_404(IDInternal, rfc_flag=1, draft=rfc_number)
208+
doc = RfcWrapper(rfci, idinternal=id)
206209
else:
207210
id = get_object_or_404(IDInternal, rfc_flag=0, draft__filename=name)
211+
doc = IdWrapper(id)
208212
try:
209213
if not id.ballot.ballot_issued:
210214
raise Http404
211215
except BallotInfo.DoesNotExist:
212216
raise Http404
213217

214218
ballot = BallotWrapper(id)
215-
return render_to_response('idrfc/doc_ballot.html', {'ballot':ballot}, context_instance=RequestContext(request))
219+
return render_to_response('idrfc/doc_ballot.html', {'ballot':ballot, 'doc':doc}, context_instance=RequestContext(request))
216220

ietf/templates/idrfc/doc_ballot.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% comment %}
2-
Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
2+
Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
33
All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
44

55
Redistribution and use in source and binary forms, with or without
@@ -65,6 +65,9 @@
6565
<td class="right">
6666

6767
<h2 style="margin-top:12px;">Discusses and other comments</h2>
68+
69+
{% if ballot.is_ballot_set %}<p>Other documents in this ballot set: {% for x in ballot.ballot_set_other%}{{x|urlize_ietf_docs}}{% if not forloop.last %}, {% endif %}{% endfor %}</p>{% endif %}
70+
6871
{% if doc.in_ietf_process and doc.ietf_process.has_active_iesg_ballot %}
6972
<p>Summary: <i>{{ doc.ietf_process.iesg_ballot_needed }}</i></p>
7073
{% endif %}

0 commit comments

Comments
 (0)