Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions ietf/doc/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ietf/doc/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
url(r'^ad/?$', views_search.ad_workload),
url(r'^ad/(?P<name>[^/]+)/?$', views_search.docs_for_ad),
url(r'^ad2/(?P<name>[\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),
Expand Down
84 changes: 84 additions & 0 deletions ietf/doc/views_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'})
Expand Down
1 change: 1 addition & 0 deletions ietf/templates/doc/ad_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ <h1>IESG Dashboard</h1>
are only shown to logged-in Area Directors.
</div>
{% endif %}
<p><a href="{% url 'ietf.doc.views_search.docs_for_iesg' %}">Documents in IESG Processing</a></p>
{% for dt in metadata %}
<h2 class="mt-5" id="{{ dt.type.0 }}">{{ dt.type.1 }} State Counts</h2>
<table class="table table-sm table-striped table-bordered tablesorter navskip">
Expand Down
20 changes: 20 additions & 0 deletions ietf/templates/doc/drafts_for_iesg.html
Original file line number Diff line number Diff line change
@@ -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 %}
<link rel="stylesheet" href="{% static "ietf/css/list.css" %}">
{% endblock %}
{% block title %}Documents for the IESG{% endblock %}
{% block content %}
{% cache 300 ietf_doc_drafts_for_iesg using="slowpages" %}
{% origin %}
<h1 class="mt-4">Documents for the IESG</h1>
{% include "doc/search/search_results.html" with start_table=True end_table=True %}
{% endcache %}
{% endblock %}
{% block js %}
<script src="{% static "ietf/js/list.js" %}"></script>
{% endblock %}
Loading