Skip to content

Commit 7abb438

Browse files
committed
Add milestones needing review page for the IESG, replace simple
telechat redirect view with a generic view in urls.py - Legacy-Id: 4591
1 parent 8d07791 commit 7abb438

4 files changed

Lines changed: 54 additions & 8 deletions

File tree

ietf/iesg/urls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
(r'^agenda/documents/$', views.agenda_documents),
6060
(r'^agenda/telechat-(?P<year>\d+)-(?P<month>\d+)-(?P<day>\d+)-docs.tgz', views.telechat_docs_tarfile),
6161
(r'^discusses/$', views.discusses),
62-
(r'^telechatdates/$', views.telechat_dates),
62+
(r'^milestones', views.milestones_needing_review),
63+
(r'^telechatdates/$', 'django.views.generic.simple.redirect_to', { 'url': '/admin/iesg/telechatdate/' }),
6364
url(r'^wgactions/$', views.working_group_actions, name="iesg_working_group_actions"),
6465
url(r'^wgactions/add/$', views.edit_working_group_action, { 'wga_id': None }, name="iesg_add_working_group_action"),
6566
url(r'^wgactions/(?P<wga_id>\d+)/$', views.edit_working_group_action, name="iesg_edit_working_group_action"),

ietf/iesg/views.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
from ietf.idtracker.templatetags.ietf_filters import in_group
5555
from ietf.ipr.models import IprRfc, IprDraft, IprDetail
5656
from ietf.doc.models import Document, TelechatDocEvent
57-
from ietf.group.models import Group
57+
from ietf.group.models import Group, GroupMilestone
5858

5959
def date_threshold():
6060
"""Return the first day of the month that is 185 days ago."""
@@ -509,9 +509,26 @@ def discusses(request):
509509
return direct_to_template(request, 'iesg/discusses.html', {'docs':res})
510510

511511

512-
@group_required('Secretariat')
513-
def telechat_dates(request):
514-
return HttpResponseRedirect("/admin/iesg/telechatdate/")
512+
@role_required('Area Director', 'Secretariat')
513+
def milestones_needing_review(request):
514+
# collect milestones, grouped on AD and group
515+
ads = {}
516+
for m in GroupMilestone.objects.filter(state="review").exclude(group__state="concluded", group__ad=None).distinct().select_related("group", "group__ad"):
517+
groups = ads.setdefault(m.group.ad, {})
518+
milestones = groups.setdefault(m.group, [])
519+
milestones.append(m)
520+
521+
ad_list = []
522+
for ad, groups in ads.iteritems():
523+
ad_list.append(ad)
524+
ad.groups_needing_review = sorted(groups, key=lambda g: g.acronym)
525+
for g, milestones in groups.iteritems():
526+
g.milestones_needing_review = sorted(milestones, key=lambda m: m.due)
527+
528+
return render_to_response('iesg/milestones_needing_review.html',
529+
dict(ads=sorted(ad_list, key=lambda ad: ad.plain_name()),
530+
),
531+
context_instance=RequestContext(request))
515532

516533
def parse_wg_action_file(path):
517534
f = open(path, 'rU')

ietf/templates/base_leftmenu.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,16 @@
4242
<li><a href="{% url doc_search_by_ad name=user.get_profile.person.full_name_as_key %}">My Documents</a></li>
4343
<li><a href="{% url ietf.iesg.views.agenda_documents %}">Next Telechat</a></li>
4444
<li><a href="{% url ietf.iesg.views.discusses %}">Discusses</a></li>
45+
<li><a href="{% url ietf.iesg.views.milestones_needing_review %}">Milestones</a></li>
46+
{# FIXME: this link should be removed when the old WG Actions are completely dead #}
4547
<li><a href="{% url ietf.iesg.views.working_group_actions %}">Working Groups</a></li>
46-
{# FIXME: wgcharter <li><a href="{% url wg_search_by_area name=user|ad_area %}">Working Groups</a></li> #}
4748
{% endif %}
4849
{% if user|in_group:"Secretariat" %}
4950
<li class="sect first">Secretariat</li>
50-
<li><a href="{% url ietf.iesg.views.telechat_dates %}">Telechat Dates</a></li>
51+
<li><a href="/admin/iesg/telechatdate/">Telechat Dates</a></li>
5152
<li><a href="/admin/iesg/telechatagendaitem/">Management Items</a></li>
53+
{# FIXME: this link should be removed when the old WG Actions are completely dead #}
5254
<li><a href="{% url ietf.iesg.views.working_group_actions %}">Working Groups</a></li>
53-
{# FIXME: wgcharter <li><a href="{% url wg_search_in_process %}">Working Groups</a></li> #}
5455
{% endif %}
5556
{% if user %}
5657
{% get_user_managed_streams user as stream_list %}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{% extends "base.html" %}
2+
3+
{% block title %}Milestones Needing Review{% endblock %}
4+
5+
{% block morecss %}
6+
h3.ad { margin-bottom: 0.5em; }
7+
div.milestones-for-group { margin: 0.5em 0; }
8+
{% endblock %}
9+
10+
{% block content %}
11+
<h1>Milestones Needing Review</h1>
12+
13+
{% for ad in ads %}
14+
<h3 class="ad">{{ ad.plain_name }}</h4>
15+
16+
{% for g in ad.groups_needing_review %}
17+
18+
<div class="milestones-for-group">New milestones for <a href="{% url wg_edit_milestones acronym=g.acronym %}">{{ g.name }} ({{ g.acronym }})</a>:</div>
19+
20+
{% with g.milestones_needing_review as milestones %}
21+
{% include "wginfo/milestones.html" %}
22+
{% endwith %}
23+
24+
{% endfor %}
25+
{% endfor %}
26+
27+
{% endblock %}

0 commit comments

Comments
 (0)