Add milestones needing review page for the IESG, replace simple

telechat redirect view with a generic view in urls.py
 - Legacy-Id: 4591
This commit is contained in:
Ole Laursen 2012-07-04 18:16:34 +00:00
parent 8d07791e23
commit 7abb438424
4 changed files with 54 additions and 8 deletions

View file

@ -59,7 +59,8 @@ urlpatterns += patterns('',
(r'^agenda/documents/$', views.agenda_documents),
(r'^agenda/telechat-(?P<year>\d+)-(?P<month>\d+)-(?P<day>\d+)-docs.tgz', views.telechat_docs_tarfile),
(r'^discusses/$', views.discusses),
(r'^telechatdates/$', views.telechat_dates),
(r'^milestones', views.milestones_needing_review),
(r'^telechatdates/$', 'django.views.generic.simple.redirect_to', { 'url': '/admin/iesg/telechatdate/' }),
url(r'^wgactions/$', views.working_group_actions, name="iesg_working_group_actions"),
url(r'^wgactions/add/$', views.edit_working_group_action, { 'wga_id': None }, name="iesg_add_working_group_action"),
url(r'^wgactions/(?P<wga_id>\d+)/$', views.edit_working_group_action, name="iesg_edit_working_group_action"),

View file

@ -54,7 +54,7 @@ from ietf.ietfauth.decorators import group_required, role_required
from ietf.idtracker.templatetags.ietf_filters import in_group
from ietf.ipr.models import IprRfc, IprDraft, IprDetail
from ietf.doc.models import Document, TelechatDocEvent
from ietf.group.models import Group
from ietf.group.models import Group, GroupMilestone
def date_threshold():
"""Return the first day of the month that is 185 days ago."""
@ -509,9 +509,26 @@ def discusses(request):
return direct_to_template(request, 'iesg/discusses.html', {'docs':res})
@group_required('Secretariat')
def telechat_dates(request):
return HttpResponseRedirect("/admin/iesg/telechatdate/")
@role_required('Area Director', 'Secretariat')
def milestones_needing_review(request):
# collect milestones, grouped on AD and group
ads = {}
for m in GroupMilestone.objects.filter(state="review").exclude(group__state="concluded", group__ad=None).distinct().select_related("group", "group__ad"):
groups = ads.setdefault(m.group.ad, {})
milestones = groups.setdefault(m.group, [])
milestones.append(m)
ad_list = []
for ad, groups in ads.iteritems():
ad_list.append(ad)
ad.groups_needing_review = sorted(groups, key=lambda g: g.acronym)
for g, milestones in groups.iteritems():
g.milestones_needing_review = sorted(milestones, key=lambda m: m.due)
return render_to_response('iesg/milestones_needing_review.html',
dict(ads=sorted(ad_list, key=lambda ad: ad.plain_name()),
),
context_instance=RequestContext(request))
def parse_wg_action_file(path):
f = open(path, 'rU')

View file

@ -42,15 +42,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<li><a href="{% url doc_search_by_ad name=user.get_profile.person.full_name_as_key %}">My Documents</a></li>
<li><a href="{% url ietf.iesg.views.agenda_documents %}">Next Telechat</a></li>
<li><a href="{% url ietf.iesg.views.discusses %}">Discusses</a></li>
<li><a href="{% url ietf.iesg.views.milestones_needing_review %}">Milestones</a></li>
{# FIXME: this link should be removed when the old WG Actions are completely dead #}
<li><a href="{% url ietf.iesg.views.working_group_actions %}">Working Groups</a></li>
{# FIXME: wgcharter <li><a href="{% url wg_search_by_area name=user|ad_area %}">Working Groups</a></li> #}
{% endif %}
{% if user|in_group:"Secretariat" %}
<li class="sect first">Secretariat</li>
<li><a href="{% url ietf.iesg.views.telechat_dates %}">Telechat Dates</a></li>
<li><a href="/admin/iesg/telechatdate/">Telechat Dates</a></li>
<li><a href="/admin/iesg/telechatagendaitem/">Management Items</a></li>
{# FIXME: this link should be removed when the old WG Actions are completely dead #}
<li><a href="{% url ietf.iesg.views.working_group_actions %}">Working Groups</a></li>
{# FIXME: wgcharter <li><a href="{% url wg_search_in_process %}">Working Groups</a></li> #}
{% endif %}
{% if user %}
{% get_user_managed_streams user as stream_list %}

View file

@ -0,0 +1,27 @@
{% extends "base.html" %}
{% block title %}Milestones Needing Review{% endblock %}
{% block morecss %}
h3.ad { margin-bottom: 0.5em; }
div.milestones-for-group { margin: 0.5em 0; }
{% endblock %}
{% block content %}
<h1>Milestones Needing Review</h1>
{% for ad in ads %}
<h3 class="ad">{{ ad.plain_name }}</h4>
{% for g in ad.groups_needing_review %}
<div class="milestones-for-group">New milestones for <a href="{% url wg_edit_milestones acronym=g.acronym %}">{{ g.name }} ({{ g.acronym }})</a>:</div>
{% with g.milestones_needing_review as milestones %}
{% include "wginfo/milestones.html" %}
{% endwith %}
{% endfor %}
{% endfor %}
{% endblock %}