diff --git a/ietf/doc/tests.py b/ietf/doc/tests.py index d74688f3f6..1229df46c5 100644 --- a/ietf/doc/tests.py +++ b/ietf/doc/tests.py @@ -403,6 +403,30 @@ def test_docs_for_ad(self): self.assertContains(r, discuss_other.doc.name) self.assertContains(r, block_other.doc.name) + def test_docs_for_iesg(self): + ad1 = RoleFactory(name_id='ad',group__type_id='area',group__state_id='active').person + ad2 = RoleFactory(name_id='ad',group__type_id='area',group__state_id='active').person + + draft = IndividualDraftFactory(ad=ad1) + draft.action_holders.set([PersonFactory()]) + draft.set_state(State.objects.get(type='draft-iesg', slug='lc')) + rfc = IndividualRfcFactory(ad=ad2) + conflrev = DocumentFactory(type_id='conflrev',ad=ad1) + conflrev.set_state(State.objects.get(type='conflrev', slug='iesgeval')) + statchg = DocumentFactory(type_id='statchg',ad=ad2) + statchg.set_state(State.objects.get(type='statchg', slug='iesgeval')) + charter = CharterFactory(name='charter-ietf-ames',ad=ad1) + charter.set_state(State.objects.get(type='charter', slug='iesgrev')) + + r = self.client.get(urlreverse('ietf.doc.views_search.docs_for_iesg')) + self.assertEqual(r.status_code, 200) + self.assertContains(r, draft.name) + self.assertContains(r, escape(draft.action_holders.first().name)) + self.assertNotContains(r, rfc.name) + self.assertContains(r, conflrev.name) + self.assertContains(r, statchg.name) + self.assertContains(r, charter.name) + def test_auth48_doc_for_ad(self): """Docs in AUTH48 state should have a decoration""" ad = RoleFactory(name_id='ad', group__type_id='area', group__state_id='active').person diff --git a/ietf/doc/urls.py b/ietf/doc/urls.py index 6e2f03a3dc..0fa1a04b49 100644 --- a/ietf/doc/urls.py +++ b/ietf/doc/urls.py @@ -53,6 +53,7 @@ url(r'^ad/?$', views_search.ad_workload), url(r'^ad/(?P[^/]+)/?$', views_search.docs_for_ad), url(r'^ad2/(?P[\w.-]+)/$', RedirectView.as_view(url='/doc/ad/%(name)s/', permanent=True)), + url(r'^for_iesg/?$', views_search.docs_for_iesg), url(r'^rfc-status-changes/?$', views_status_change.rfc_status_changes), url(r'^start-rfc-status-change/(?:%(name)s/)?$' % settings.URL_REGEXPS, views_status_change.start_rfc_status_change), url(r'^bof-requests/?$', views_bofreq.bof_requests), diff --git a/ietf/doc/utils_search.py b/ietf/doc/utils_search.py index 59b64ad307..cfc8a872f8 100644 --- a/ietf/doc/utils_search.py +++ b/ietf/doc/utils_search.py @@ -299,10 +299,10 @@ def num(i): "ad-eval", "lc-req", "lc", + "goaheadw", "writeupw", # "defer", # probably not a useful state to show, since it's rare "iesg-eva", - "goaheadw", "approved", "ann", ], diff --git a/ietf/doc/views_search.py b/ietf/doc/views_search.py index 9e9b5e88dd..3433a9ca31 100644 --- a/ietf/doc/views_search.py +++ b/ietf/doc/views_search.py @@ -752,6 +752,90 @@ def sort_key(doc): ) +def docs_for_iesg(request): + def sort_key(doc): + dt = doc_type(doc) + dt_key = list(AD_WORKLOAD.keys()).index(dt) + ds = doc_state(doc) + ds_key = AD_WORKLOAD[dt].index(ds) if ds in AD_WORKLOAD[dt] else 99 + return dt_key * 100 + ds_key + + results, meta = prepare_document_table( + request, + Document.objects.filter( + ad__in=Person.objects.filter( + Q( + role__name__in=("pre-ad", "ad"), + role__group__type="area", + role__group__state="active", + ) + ) + ).exclude( + type_id="rfc", + ).exclude( + type_id="draft", + states__type="draft", + states__slug__in=["repl", "rfc"], + ).exclude( + type_id="draft", + states__type="draft-iesg", + states__slug__in=["idexists", "rfcqueue"], + ).exclude( + type_id="conflrev", + states__type="conflrev", + states__slug__in=["appr-noprob-sent", "appr-reqnopub-sent", "withdraw", "dead"], + ).exclude( + type_id="statchg", + states__type="statchg", + states__slug__in=["appr-sent", "dead"], + ).exclude( + type_id="charter", + states__type="charter", + states__slug__in=["notrev", "infrev", "approved", "replaced"], + ), + max_results=1000, + show_ad_and_shepherd=True, + ) + results.sort(key=lambda d: sort_key(d)) + + # filter out some results + results = [ + r + for r in results + if not ( + r.type_id == "charter" + and ( + r.group.state_id == "abandon" + or r.get_state_slug("charter") == "replaced" + ) + ) + and not ( + r.type_id == "draft" + and ( + r.get_state_slug("draft-iesg") == "dead" + or r.get_state_slug("draft") == "repl" + or r.get_state_slug("draft") == "rfc" + ) + ) + ] + + _calculate_state_name = get_state_name_calculator() + for d in results: + dt = d.type.slug + d.search_heading = _calculate_state_name(dt, doc_state(d)) + if d.search_heading != "RFC": + d.search_heading += f" {doc_type_name(dt)}" + + return render( + request, + "doc/drafts_for_iesg.html", + { + "docs": results, + "meta": meta, + }, + ) + + def drafts_in_last_call(request): lc_state = State.objects.get(type="draft-iesg", slug="lc").pk form = SearchForm({'by':'state','state': lc_state, 'rfcs':'on', 'activedrafts':'on'}) diff --git a/ietf/templates/doc/ad_list.html b/ietf/templates/doc/ad_list.html index a73264c0f3..1d7b6e2b54 100644 --- a/ietf/templates/doc/ad_list.html +++ b/ietf/templates/doc/ad_list.html @@ -29,6 +29,7 @@

IESG Dashboard

are only shown to logged-in Area Directors. {% endif %} +

Documents in IESG Processing

{% for dt in metadata %}

{{ dt.type.1 }} State Counts

diff --git a/ietf/templates/doc/drafts_for_iesg.html b/ietf/templates/doc/drafts_for_iesg.html new file mode 100644 index 0000000000..d7a79fb714 --- /dev/null +++ b/ietf/templates/doc/drafts_for_iesg.html @@ -0,0 +1,20 @@ +{% extends "base.html" %} +{# Copyright The IETF Trust 2015, All Rights Reserved #} +{% load origin static %} +{% load cache %} +{% load ietf_filters %} +{% load person_filters %} +{% block pagehead %} + +{% endblock %} +{% block title %}Documents for the IESG{% endblock %} +{% block content %} + {% cache 300 ietf_doc_drafts_for_iesg using="slowpages" %} + {% origin %} +

Documents for the IESG

+ {% include "doc/search/search_results.html" with start_table=True end_table=True %} + {% endcache %} +{% endblock %} +{% block js %} + +{% endblock %} \ No newline at end of file diff --git a/ietf/templates/doc/drafts_in_iesg_process.html b/ietf/templates/doc/drafts_in_iesg_process.html index f128e528a5..d9b09e984e 100644 --- a/ietf/templates/doc/drafts_in_iesg_process.html +++ b/ietf/templates/doc/drafts_in_iesg_process.html @@ -10,6 +10,7 @@ {% block content %} {% origin %}

{{ title }}

+

This view is deprecated, and will soon redirect to a different representation