From 86f713fc974744672db5ae50c9da19c167666f74 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Sun, 21 Mar 2010 00:05:35 +0000 Subject: [PATCH] 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 --- changelog | 7 ++++- ietf/idrfc/idrfc_wrapper.py | 6 ++++ ietf/idtracker/models.py | 41 +++++++++++++++++++++++++++ ietf/templates/idrfc/doc_ballot.html | 3 ++ ietf/templates/idrfc/doc_main_id.html | 2 +- 5 files changed, 57 insertions(+), 2 deletions(-) diff --git a/changelog b/changelog index b2162a939..85dc56e43 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,4 @@ -ietfdb (2.46) +ietfdb (2.47) From Suresh: @@ -10,6 +10,11 @@ ietfdb (2.46) * Added a link to the comment feed next to the nits link + From Bill: + + * Output a summary of what's needed for the document to be approved in + the main and ballot views. + -- Henrik Levkowetz 21 Mar 2010 00:36:05 +0100 ietfdb (2.46) diff --git a/ietf/idrfc/idrfc_wrapper.py b/ietf/idrfc/idrfc_wrapper.py index 46a21fb12..42648b28b 100644 --- a/ietf/idrfc/idrfc_wrapper.py +++ b/ietf/idrfc/idrfc_wrapper.py @@ -373,6 +373,12 @@ class IetfProcessData: self._ballot = BallotWrapper(self._idinternal) return self._ballot + # don't call this unless has_[active_]iesg_ballot returns True + def iesg_ballot_needed( self ): + standardsTrack = 'Standard' in self.intended_maturity_level() or \ + self.intended_maturity_level() == "BCP" + return self.iesg_ballot().ballot.needed( standardsTrack ) + def ad_name(self): name = self._idinternal.token_name # Some old documents have token name as "Surname, Firstname"; diff --git a/ietf/idtracker/models.py b/ietf/idtracker/models.py index 9073a3498..4a3889907 100644 --- a/ietf/idtracker/models.py +++ b/ietf/idtracker/models.py @@ -485,6 +485,47 @@ class BallotInfo(models.Model): # Added by Michael Lee for ad in active_iesg: ret.append({'ad': ad, 'pos': positions.get(ad.id, None)}) return ret + def needed(self, standardsTrack=True): + '''Returns text answering the question "what does this document + need to pass?". The return value is only useful if the document + is currently in IESG evaluation.''' + active_iesg = IESGLogin.active_iesg() + ads = [ad.id for ad in active_iesg] + yes = 0 + noobj = 0 + discuss = 0 + recuse = 0 + for position in self.positions.filter(ad__in=ads): + yes += 1 if position.yes > 0 else 0 + noobj += 1 if position.noobj > 0 else 0 + discuss += 1 if position.discuss > 0 else 0 + recuse += 1 if position.recuse > 0 else 0 + answer = '' + if yes < 1: + answer += "Needs a YES. " + if discuss > 0: + if discuss == 1: + answer += "Has a DISCUSS. " + else: + answer += "Has %d DISCUSSes. " % discuss + if standardsTrack: + # For standards-track, need positions from 2/3 of the + # non-recused current IESG. + needed = ( active_iesg.count() - recuse ) * 2 / 3 + else: + # Info and experimental only need one position. + needed = 1 + have = yes + noobj + discuss + if have < needed: + answer += "Needs %d more positions. " % (needed - have) + else: + answer += "Has enough positions to pass" + if discuss: + answer += " once DISCUSSes are resolved" + answer += ". " + + return answer.rstrip() + class Meta: db_table = 'ballot_info' diff --git a/ietf/templates/idrfc/doc_ballot.html b/ietf/templates/idrfc/doc_ballot.html index faaf0039f..34520e9e0 100644 --- a/ietf/templates/idrfc/doc_ballot.html +++ b/ietf/templates/idrfc/doc_ballot.html @@ -65,6 +65,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Discusses and other comments

+{% if doc.in_ietf_process and doc.ietf_process.has_active_iesg_ballot %} +

Summary: {{ doc.ietf_process.iesg_ballot_needed }}

+{% endif %} {% for pos in ballot.get_texts %}

{{pos.ad_name|escape}}

diff --git a/ietf/templates/idrfc/doc_main_id.html b/ietf/templates/idrfc/doc_main_id.html index 1d7f2d966..acfc04d57 100644 --- a/ietf/templates/idrfc/doc_main_id.html +++ b/ietf/templates/idrfc/doc_main_id.html @@ -46,7 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. State: {{ doc.friendly_state|safe }} {% if doc.rfc_editor_state %}
RFC Editor State: {{ doc.rfc_editor_state|escape }}{% endif %} -{% if doc.in_ietf_process %}{% if doc.ietf_process.telechat_date %}
On agenda of {{ doc.ietf_process.telechat_date }} IESG telechat {% if doc.ietf_process.telechat_returning_item %} (returning item){%endif%}{%endif%}{%endif%} +{% if doc.in_ietf_process %}{% if doc.ietf_process.telechat_date %}
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 %}
({{ doc.ietf_process.iesg_ballot_needed }}){%endif%}{%endif%} Intended status:{% if doc.in_ietf_process %}{{ doc.ietf_process.intended_maturity_level|default:"-" }}{% else %}-{%endif%} Responsible AD:{% if doc.in_ietf_process %}{{ doc.ietf_process.ad_name|default:"-"|escape }}{%else%}-{%endif%}