diff --git a/ietf/idrfc/urls.py b/ietf/idrfc/urls.py index 0249802ea..4dba18e93 100644 --- a/ietf/idrfc/urls.py +++ b/ietf/idrfc/urls.py @@ -40,6 +40,7 @@ urlpatterns = patterns('', url(r'^search/$', views_search.search, name="doc_search"), url(r'^in-last-call/$', views_search.drafts_in_last_call, name="drafts_in_last_call"), url(r'^ad/(?P[A-Za-z0-9.-]+)/$', views_search.drafts_for_ad, name="drafts_for_ad"), + url(r'^iesg/(?P[A-Za-z0-9.-]+/)?$', views_search.drafts_in_iesg_process, name="drafts_in_iesg_process"), url(r'^all/$', views_search.index_all_drafts, name="index_all_drafts"), url(r'^active/$', views_search.index_active_drafts, name="index_active_drafts"), diff --git a/ietf/idrfc/views_search.py b/ietf/idrfc/views_search.py index 20b3a8711..d972c9915 100644 --- a/ietf/idrfc/views_search.py +++ b/ietf/idrfc/views_search.py @@ -36,9 +36,7 @@ from django import forms from django.shortcuts import render_to_response from django.db.models import Q from django.template import RequestContext -from django.views.decorators.cache import cache_page from django.http import Http404, HttpResponse, HttpResponseBadRequest, HttpResponseRedirect -from django.conf import settings from ietf.idrfc.expire import expirable_draft from ietf.utils import normalize_draftname @@ -383,6 +381,35 @@ def drafts_in_last_call(request): { 'form':form, 'docs':results, 'meta':meta }, context_instance=RequestContext(request)) +def drafts_in_iesg_process(request, last_call_only=None): + if last_call_only: + states = State.objects.filter(type="draft-iesg", slug__in=("lc", "writeupw", "goaheadw")) + title = "Documents in Last Call" + else: + states = State.objects.filter(type="draft-iesg").exclude(slug__in=('pub', 'dead', 'watching', 'rfcqueue')) + title = "Documents in IESG process" + + grouped_docs = [] + + for s in states.order_by("order"): + docs = Document.objects.filter(type="draft", states=s).distinct().order_by("time").select_related("ad", "group", "group__parent") + if docs: + if s.slug == "lc": + for d in docs: + e = d.latest_event(LastCallDocEvent, type="sent_last_call") + d.lc_expires = e.expires if e else datetime.datetime.min + docs = list(docs) + docs.sort(key=lambda d: d.lc_expires) + + grouped_docs.append((s, docs)) + + #drafts.sort(key=lambda d: (d.cur_state_id, d.status_date or datetime.date.min, d.b_sent_date or datetime.date.min)) + + return render_to_response('doc/drafts_in_iesg_process.html', { + "grouped_docs": grouped_docs, + "title": title, + "last_call_only": last_call_only, + }, context_instance=RequestContext(request)) def index_all_drafts(request): # try to be efficient since this view returns a lot of data diff --git a/ietf/templates/doc/drafts_in_iesg_process.html b/ietf/templates/doc/drafts_in_iesg_process.html new file mode 100644 index 000000000..5aef973c3 --- /dev/null +++ b/ietf/templates/doc/drafts_in_iesg_process.html @@ -0,0 +1,67 @@ +{% extends "base.html" %} +{# Copyright The IETF Trust 2007, All Rights Reserved #} + +{% load ietf_filters %} + +{% block pagehead %} +{% if last_call_only %}{% endif %} +{% endblock %} + +{% block morecss %} +th.area, td.area { text-align: left; padding-right: 0.5em; } +th.date, td.date { text-align: left; padding-right: 0.5em; white-space: nowrap; } +{% endblock %} + +{% block title %}{{ title }}{% endblock %} + +{% block content %} +

{{ title }}

+ +{% for state, docs in grouped_docs %} +

{{ state.name }}

+ + + + + + + + {% for doc in docs %} + + + + + + + + + + + + + + + + + + + + {% if doc.note %} + + + + + + {% endif %} + + {% endfor %} +
Area{% if state.slug == "lc" %}Expires at{% else %}Date{% endif %}
{% if doc.area_acronym %}{{ doc.area_acronym.upper }}{% endif %} + {% if state.slug == "lc" %} + {% if doc.lc_expires %}{{ doc.lc_expires|date:"M j, Y" }}{% endif %} + {% else %} + {{ doc.time|date:"M j, Y" }} + {% endif %} + {{ doc.title }} ({{ doc.intended_std_level.name }})
{{ doc.name }}
AD:{{ doc.ad.plain_name }}
Note:{{ doc.note|linebreaksbr|urlize }}
+{% endfor %} + +{% endblock %}