Port /idtracker/status/ and /idtracker/status/last-call/ overview of
drafts in IESG process to new schema in /doc/iesg/ and /doc/iesg/last-call/ - Legacy-Id: 5638
This commit is contained in:
parent
851107ce8e
commit
8da7c6f56d
|
@ -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<name>[A-Za-z0-9.-]+)/$', views_search.drafts_for_ad, name="drafts_for_ad"),
|
||||
url(r'^iesg/(?P<last_call_only>[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"),
|
||||
|
|
|
@ -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
|
||||
|
|
67
ietf/templates/doc/drafts_in_iesg_process.html
Normal file
67
ietf/templates/doc/drafts_in_iesg_process.html
Normal file
|
@ -0,0 +1,67 @@
|
|||
{% extends "base.html" %}
|
||||
{# Copyright The IETF Trust 2007, All Rights Reserved #}
|
||||
|
||||
{% load ietf_filters %}
|
||||
|
||||
{% block pagehead %}
|
||||
{% if last_call_only %}<link rel="alternate" type="application/atom+xml" href="/feed/last-call/">{% 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 %}
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
{% for state, docs in grouped_docs %}
|
||||
<h2 id="{{ state.slug }}">{{ state.name }}</h2>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="area">Area</th>
|
||||
<th class="date">{% if state.slug == "lc" %}Expires at{% else %}Date{% endif %}</th>
|
||||
</tr>
|
||||
|
||||
{% for doc in docs %}
|
||||
<tr class="doc">
|
||||
<td class="area">{% if doc.area_acronym %}{{ doc.area_acronym.upper }}{% endif %}</td>
|
||||
<td class="date">
|
||||
{% if state.slug == "lc" %}
|
||||
{% if doc.lc_expires %}{{ doc.lc_expires|date:"M j, Y" }}{% endif %}
|
||||
{% else %}
|
||||
{{ doc.time|date:"M j, Y" }}
|
||||
{% endif %}
|
||||
</td>
|
||||
|
||||
<td>{{ doc.title }} ({{ doc.intended_std_level.name }})</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><a href="{% url doc_view doc.name %}">{{ doc.name }}</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>AD:</td>
|
||||
<td><a href="mailto:{{ doc.ad.email_address|urlencode }}">{{ doc.ad.plain_name }}</a></td>
|
||||
</tr>
|
||||
|
||||
{% if doc.note %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Note:</td>
|
||||
<td>{{ doc.note|linebreaksbr|urlize }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in a new issue