Add a page to show the active status reports all in one place. Fixes #1951. Commit ready for merge.
- Legacy-Id: 11112
This commit is contained in:
parent
0bb8c23909
commit
1f8cc9a4f1
|
@ -39,6 +39,8 @@ from tempfile import mkstemp
|
|||
import datetime
|
||||
from collections import OrderedDict
|
||||
|
||||
import debug # pyflakes:ignore
|
||||
|
||||
from django import forms
|
||||
from django.shortcuts import render, redirect
|
||||
from django.template.loader import render_to_string
|
||||
|
@ -505,6 +507,30 @@ def group_about(request, acronym, group_type=None):
|
|||
"status_update": status_update,
|
||||
}))
|
||||
|
||||
def all_status(request):
|
||||
wgs = Group.objects.filter(type='wg',state__in=['active','bof'])
|
||||
rgs = Group.objects.filter(type='rg',state__in=['active','proposed'])
|
||||
|
||||
wg_reports = []
|
||||
for wg in wgs:
|
||||
e = wg.latest_event(type='status_update')
|
||||
if e:
|
||||
wg_reports.append(e)
|
||||
|
||||
wg_reports.sort(key=lambda x: (x.group.parent.acronym,datetime.datetime.now()-x.time))
|
||||
|
||||
rg_reports = []
|
||||
for rg in rgs:
|
||||
e = rg.latest_event(type='status_update')
|
||||
if e:
|
||||
rg_reports.append(e)
|
||||
|
||||
return render(request, 'group/all_status.html',
|
||||
{ 'wg_reports': wg_reports,
|
||||
'rg_reports': rg_reports,
|
||||
}
|
||||
)
|
||||
|
||||
def group_about_status(request, acronym, group_type=None):
|
||||
group = get_group_or_404(acronym, group_type)
|
||||
status_update = group.latest_event(type='status_update')
|
||||
|
|
|
@ -1124,6 +1124,13 @@ class StatusUpdateTests(TestCase):
|
|||
response = self.client.post(url,dict(txt=test_file,submit_response="1"))
|
||||
self.assertEqual(response.status_code, 302)
|
||||
self.assertEqual(chair.group.latest_event(type='status_update').desc,'This came from a file.')
|
||||
|
||||
def test_view_all_status_updates(self):
|
||||
GroupEventFactory(type='status_update',desc='blah blah blah',group__type_id='wg')
|
||||
GroupEventFactory(type='status_update',desc='blah blah blah',group__type_id='rg')
|
||||
url = urlreverse('ietf.group.info.all_status')
|
||||
response = self.client.get(url)
|
||||
self.assertEqual(response.status_code,200)
|
||||
|
||||
class GroupParentLoopTests(TestCase):
|
||||
|
||||
|
@ -1165,4 +1172,4 @@ class GroupParentLoopTests(TestCase):
|
|||
signal.alarm(0)
|
||||
|
||||
# If we get here, then there is not an infinite loop
|
||||
return
|
||||
return
|
||||
|
|
|
@ -10,6 +10,7 @@ urlpatterns = patterns('',
|
|||
(r'^chartering/create/(?P<group_type>(wg|rg))/$', 'ietf.group.edit.edit', {'action': "charter"}, "group_create"),
|
||||
(r'^concluded/$', 'ietf.group.info.concluded_groups'),
|
||||
(r'^email-aliases/$', 'ietf.group.info.email_aliases'),
|
||||
(r'^all-status/$', 'ietf.group.info.all_status'),
|
||||
(r'^(?P<acronym>[a-zA-Z0-9-._]+)/$', 'ietf.group.info.group_home', None, "group_home"),
|
||||
(r'^(?P<acronym>[a-zA-Z0-9-._]+)/', include('ietf.group.urls_info_details')),
|
||||
)
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
<p><a href="mailto:irtf-chair@irtf.org">{{ irtf.chair.person.plain_name }}</a></p>
|
||||
|
||||
<h2>Active research groups</h2>
|
||||
<a class="btn btn-default" href="{% url "ietf.group.info.all_status" %}">Status Reports</a>
|
||||
|
||||
<table class="table table-striped table-condensed tablesorter">
|
||||
<thead>
|
||||
|
@ -40,4 +41,4 @@
|
|||
|
||||
{% block js %}
|
||||
<script src="{% static "jquery.tablesorter/js/jquery.tablesorter.combined.min.js" %}"></script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
<a class="btn btn-default" href="{% url "ietf.group.info.concluded_groups" %}">Concluded WGs</a>
|
||||
<a class="btn btn-default" href="https://www.ietf.org/dyn/wg/charter/history/">Historic charters</a>
|
||||
<a class="btn btn-default" href="{% url "ietf.group.info.all_status" %}">Status Reports</a>
|
||||
|
||||
{% for area in areas %}
|
||||
<h2 class="anchor-target" id="{{area.acronym}}">{{ area.name }} ({{ area.acronym }})</h2>
|
||||
|
@ -93,4 +94,4 @@
|
|||
|
||||
{% block js %}
|
||||
<script src="{% static "jquery.tablesorter/js/jquery.tablesorter.combined.min.js" %}"></script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue