From aa6136deae2f4be58bc5e42ccb550ea437b9f39d Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Tue, 8 Aug 2023 21:37:36 +0300 Subject: [PATCH] feat: Show docs that an AD hasn't balloted on that need ballots to progress (#6075) --- ietf/doc/views_search.py | 46 +++++++++++++------ ietf/templates/doc/drafts_for_ad.html | 29 +++++++++++- ietf/templates/doc/search/status_columns.html | 6 +-- 3 files changed, 61 insertions(+), 20 deletions(-) diff --git a/ietf/doc/views_search.py b/ietf/doc/views_search.py index d9ff11929..6645333cc 100644 --- a/ietf/doc/views_search.py +++ b/ietf/doc/views_search.py @@ -58,7 +58,7 @@ from ietf.doc.models import ( Document, DocHistory, DocAlias, State, IESG_BALLOT_ACTIVE_STATES, IESG_STATCHG_CONFLREV_ACTIVE_STATES, IESG_CHARTER_ACTIVE_STATES ) from ietf.doc.fields import select2_id_doc_name_json -from ietf.doc.utils import get_search_cache_key, augment_events_with_revision +from ietf.doc.utils import get_search_cache_key, augment_events_with_revision, needed_ballot_positions from ietf.group.models import Group from ietf.idindex.index import active_drafts_index_by_group from ietf.name.models import DocTagName, DocTypeName, StreamName @@ -707,18 +707,20 @@ def docs_for_ad(request, name): for d in results: d.search_heading = ad_dashboard_group(d) - # - # Additional content showing docs with blocking positions by this ad + + # Additional content showing docs with blocking positions by this AD, + # and docs that the AD hasn't balloted on that are lacking ballot positions to progress blocked_docs = [] + not_balloted_docs = [] if ad in get_active_ads(): - possible_docs = Document.objects.filter(Q(states__type="draft-iesg", - states__slug__in=IESG_BALLOT_ACTIVE_STATES) | - Q(states__type="charter", - states__slug__in=IESG_CHARTER_ACTIVE_STATES) | - Q(states__type__in=("statchg", "conflrev"), - states__slug__in=IESG_STATCHG_CONFLREV_ACTIVE_STATES), - docevent__ballotpositiondocevent__pos__blocking=True, - docevent__ballotpositiondocevent__balloter=ad).distinct() + iesg_docs = Document.objects.filter(Q(states__type="draft-iesg", + states__slug__in=IESG_BALLOT_ACTIVE_STATES) | + Q(states__type="charter", + states__slug__in=IESG_CHARTER_ACTIVE_STATES) | + Q(states__type__in=("statchg", "conflrev"), + states__slug__in=IESG_STATCHG_CONFLREV_ACTIVE_STATES)).distinct() + possible_docs = iesg_docs.filter(docevent__ballotpositiondocevent__pos__blocking=True, + docevent__ballotpositiondocevent__balloter=ad) for doc in possible_docs: ballot = doc.active_ballot() if not ballot: @@ -739,12 +741,26 @@ def docs_for_ad(request, name): if blocked_docs: blocked_docs.sort(key=lambda d: min(p.time for p in d.blocking_positions if p.balloter==ad), reverse=True) - for d in blocked_docs: - if d.get_base_name() == 'charter-ietf-shmoo-01-04.txt': - print('Is in list') + possible_docs = iesg_docs.exclude( + Q(docevent__ballotpositiondocevent__balloter=ad) + ) + for doc in possible_docs: + ballot = doc.active_ballot() + if ( + not ballot + or doc.get_state_slug("draft") == "repl" + or (doc.telechat_date() and doc.telechat_date() > timezone.now().date()) + ): + continue + + iesg_ballot_summary = needed_ballot_positions( + doc, list(ballot.active_balloter_positions().values()) + ) + if re.search(r"\bNeeds\s+\d+", iesg_ballot_summary): + not_balloted_docs.append(doc) return render(request, 'doc/drafts_for_ad.html', { - 'form':form, 'docs':results, 'meta':meta, 'ad_name': ad.plain_name(), 'blocked_docs': blocked_docs + 'form':form, 'docs':results, 'meta':meta, 'ad_name': ad.plain_name(), 'blocked_docs': blocked_docs, 'not_balloted_docs': not_balloted_docs }) def drafts_in_last_call(request): lc_state = State.objects.get(type="draft-iesg", slug="lc").pk diff --git a/ietf/templates/doc/drafts_for_ad.html b/ietf/templates/doc/drafts_for_ad.html index e02fed18c..28ebb2225 100644 --- a/ietf/templates/doc/drafts_for_ad.html +++ b/ietf/templates/doc/drafts_for_ad.html @@ -52,8 +52,35 @@ {% endfor %} -

Documents for {{ ad_name }}

{% endif %} + {% if not_balloted_docs %} +

Missing ballot positions for {{ ad_name }}

+ + + + + + + + + + {% for doc in not_balloted_docs %} + + + {% include "doc/search/status_columns.html" %} + + + {% endfor %} + +
DocumentStatusResponsible AD
{{ doc.displayname_with_link }} + {% if doc.ad %} + {% person_link doc.ad %} + {% else %} + (None) + {% endif %} +
+ {% endif %} +

Documents for {{ ad_name }}

{% include "doc/search/search_results.html" with start_table=True end_table=True %} {% endblock %} {% block js %} diff --git a/ietf/templates/doc/search/status_columns.html b/ietf/templates/doc/search/status_columns.html index 556cbb799..2b6a7f8c2 100644 --- a/ietf/templates/doc/search/status_columns.html +++ b/ietf/templates/doc/search/status_columns.html @@ -3,9 +3,7 @@ {% origin %} {% load ietf_filters ballot_icon person_filters %} - {% if doc.ballot %} -
{% ballot_icon doc %}
- {% endif %} +
{% ballot_icon doc %}
{% if not doc.get_state_slug == "rfc" %} {% if '::' in doc.friendly_state %} {{ doc.friendly_state|safe }} @@ -92,4 +90,4 @@ Updated by {{ doc.updated_by_list|join:", "|urlize_ietf_docs }} {% endif %} {% endif %} - + \ No newline at end of file