Merged in [11112] and [11113] from rjsparks@nostrum.com:
Add a page to show the active status reports all in one place. Fixes #1951. - Legacy-Id: 11143 Note: SVN reference [11112] has been migrated to Git commit1f8cc9a4f1
Note: SVN reference [11113] has been migrated to Git commit61082289fa
This commit is contained in:
commit
50568f0de4
|
@ -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 %}
|
||||
|
|
50
ietf/templates/group/all_status.html
Normal file
50
ietf/templates/group/all_status.html
Normal file
|
@ -0,0 +1,50 @@
|
|||
{% extends "base.html" %}
|
||||
{# Copyright The IETF Trust 2015, All Rights Reserved #}
|
||||
{% load origin %}
|
||||
{% load staticfiles %}
|
||||
{% load bootstrap3 %}
|
||||
{% load ietf_filters %}
|
||||
|
||||
{% block title %}
|
||||
Status updates
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% origin %}
|
||||
<h1>
|
||||
Status updates
|
||||
</h1>
|
||||
|
||||
{% regroup wg_reports by group.parent as area_items %}
|
||||
{% for area_item in area_items %}
|
||||
<h2> {{area_item.grouper.acronym|upper}}
|
||||
<small>{{area_item.grouper.name}}</small> </h2>
|
||||
<table class="table table-striped table-condensed">
|
||||
{% for rpt in area_item.list %}
|
||||
<tr>
|
||||
<td>{{ rpt.group.acronym }}
|
||||
{% if rpt.group.state.slug != "active" %}
|
||||
<span class="label label-success">{{ rpt.group.state.slug|upper }}</span>
|
||||
{% endif %}
|
||||
<br> {{rpt.time|date:"Y-m-d"}}</td>
|
||||
<td><pre class="pasted">{{ rpt.desc|default:"(none)"|escape|urlize }}</pre></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endfor %}
|
||||
|
||||
<h2> IRTF <small>Internet Research Task Force</small> </h2>
|
||||
<table class="table table-striped table-condensed">
|
||||
{% for rpt in rg_reports %}
|
||||
<tr>
|
||||
<td>{{ rpt.group.acronym }}
|
||||
{% if rpt.group.state.slug != "active" %}
|
||||
<span class="label label-success">{{ rpt.group.state.slug|upper }}</span>
|
||||
{% endif %}
|
||||
<br> {{rpt.time|date:"Y-m-d"}}</td>
|
||||
<td><pre class="pasted">{{ rpt.desc|default:"(none)"|escape|urlize }}</pre></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in a new issue