Skip to content

Commit 86f713f

Browse files
committed
Merged from source:sprint/77/fenner@2125: Output a summary of what's needed for the document to be approved in the main and ballot views.
- Legacy-Id: 2136
1 parent 76aad4f commit 86f713f

5 files changed

Lines changed: 57 additions & 2 deletions

File tree

changelog

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ietfdb (2.46)
1+
ietfdb (2.47)
22

33
From Suresh:
44

@@ -10,6 +10,11 @@ ietfdb (2.46)
1010

1111
* Added a link to the comment feed next to the nits link
1212

13+
From Bill:
14+
15+
* Output a summary of what's needed for the document to be approved in
16+
the main and ballot views.
17+
1318
-- Henrik Levkowetz <henrik@levkowetz.com> 21 Mar 2010 00:36:05 +0100
1419

1520
ietfdb (2.46)

ietf/idrfc/idrfc_wrapper.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,12 @@ def iesg_ballot(self):
373373
self._ballot = BallotWrapper(self._idinternal)
374374
return self._ballot
375375

376+
# don't call this unless has_[active_]iesg_ballot returns True
377+
def iesg_ballot_needed( self ):
378+
standardsTrack = 'Standard' in self.intended_maturity_level() or \
379+
self.intended_maturity_level() == "BCP"
380+
return self.iesg_ballot().ballot.needed( standardsTrack )
381+
376382
def ad_name(self):
377383
name = self._idinternal.token_name
378384
# Some old documents have token name as "Surname, Firstname";

ietf/idtracker/models.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,47 @@ def active_positions(self):
485485
for ad in active_iesg:
486486
ret.append({'ad': ad, 'pos': positions.get(ad.id, None)})
487487
return ret
488+
def needed(self, standardsTrack=True):
489+
'''Returns text answering the question "what does this document
490+
need to pass?". The return value is only useful if the document
491+
is currently in IESG evaluation.'''
492+
active_iesg = IESGLogin.active_iesg()
493+
ads = [ad.id for ad in active_iesg]
494+
yes = 0
495+
noobj = 0
496+
discuss = 0
497+
recuse = 0
498+
for position in self.positions.filter(ad__in=ads):
499+
yes += 1 if position.yes > 0 else 0
500+
noobj += 1 if position.noobj > 0 else 0
501+
discuss += 1 if position.discuss > 0 else 0
502+
recuse += 1 if position.recuse > 0 else 0
503+
answer = ''
504+
if yes < 1:
505+
answer += "Needs a YES. "
506+
if discuss > 0:
507+
if discuss == 1:
508+
answer += "Has a DISCUSS. "
509+
else:
510+
answer += "Has %d DISCUSSes. " % discuss
511+
if standardsTrack:
512+
# For standards-track, need positions from 2/3 of the
513+
# non-recused current IESG.
514+
needed = ( active_iesg.count() - recuse ) * 2 / 3
515+
else:
516+
# Info and experimental only need one position.
517+
needed = 1
518+
have = yes + noobj + discuss
519+
if have < needed:
520+
answer += "Needs %d more positions. " % (needed - have)
521+
else:
522+
answer += "Has enough positions to pass"
523+
if discuss:
524+
answer += " once DISCUSSes are resolved"
525+
answer += ". "
526+
527+
return answer.rstrip()
528+
488529
class Meta:
489530
db_table = 'ballot_info'
490531

ietf/templates/idrfc/doc_ballot.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@
6565
<td class="right">
6666

6767
<h2 style="margin-top:12px;">Discusses and other comments</h2>
68+
{% if doc.in_ietf_process and doc.ietf_process.has_active_iesg_ballot %}
69+
<p>Summary: <i>{{ doc.ietf_process.iesg_ballot_needed }}</i></p>
70+
{% endif %}
6871

6972
{% for pos in ballot.get_texts %}
7073
<h2 class="ballot_ad">{{pos.ad_name|escape}}</h2>

ietf/templates/idrfc/doc_main_id.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<tr><td>State:</td><td>
4747
{{ doc.friendly_state|safe }}
4848
{% if doc.rfc_editor_state %}<br />RFC Editor State: <a href="http://www.rfc-editor.org/queue2.html#{{doc.draft_name}}">{{ doc.rfc_editor_state|escape }}</a>{% endif %}
49-
{% if doc.in_ietf_process %}{% if doc.ietf_process.telechat_date %}<br/>On agenda of {{ doc.ietf_process.telechat_date }} IESG telechat {% if doc.ietf_process.telechat_returning_item %} (returning item){%endif%}{%endif%}{%endif%}
49+
{% if doc.in_ietf_process %}{% if doc.ietf_process.telechat_date %}<br/>On agenda of {{ doc.ietf_process.telechat_date }} IESG telechat {% if doc.ietf_process.telechat_returning_item %} (returning item){%endif%}{%endif%}{% if doc.ietf_process.has_active_iesg_ballot %}<br/><i>({{ doc.ietf_process.iesg_ballot_needed }})</i>{%endif%}{%endif%}
5050
</td></tr>
5151
<tr><td>Intended status:</td><td>{% if doc.in_ietf_process %}{{ doc.ietf_process.intended_maturity_level|default:"-" }}{% else %}-{%endif%}</td></tr>
5252
<tr><td>Responsible AD:</td><td>{% if doc.in_ietf_process %}{{ doc.ietf_process.ad_name|default:"-"|escape }}{%else%}-{%endif%}</td></tr>

0 commit comments

Comments
 (0)