Skip to content

Commit 860a3f8

Browse files
committed
Merged in [10862] from rjsparks@nostrum.com:
Group concluded working groups by area. Fixes ietf-tools#1670. - Legacy-Id: 10881 Note: SVN reference [10862] has been migrated to Git commit c332e52
2 parents f542eeb + c332e52 commit 860a3f8

2 files changed

Lines changed: 90 additions & 36 deletions

File tree

ietf/group/info.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -296,25 +296,28 @@ def chartering_groups(request):
296296
group_types=group_types))
297297

298298
def concluded_groups(request):
299-
group_types = GroupTypeName.objects.filter(slug__in=("wg", "rg"))
299+
sections = OrderedDict()
300300

301-
for t in group_types:
302-
t.concluded_groups = Group.objects.filter(type=t, state__in=("conclude", "bof-conc")).select_related("state", "charter").order_by("acronym")
301+
sections['WGs'] = Group.objects.filter(type='wg', state="conclude").select_related("state", "charter").order_by("parent__name","acronym")
302+
sections['RGs'] = Group.objects.filter(type='rg', state="conclude").select_related("state", "charter").order_by("parent__name","acronym")
303+
sections['BOFs'] = Group.objects.filter(type='wg', state="bof-conc").select_related("state", "charter").order_by("parent__name","acronym")
303304

305+
for name, groups in sections.items():
306+
304307
# add start/conclusion date
305-
d = dict((g.pk, g) for g in t.concluded_groups)
308+
d = dict((g.pk, g) for g in groups)
306309

307-
for g in t.concluded_groups:
310+
for g in groups:
308311
g.start_date = g.conclude_date = None
309312

310-
for e in ChangeStateGroupEvent.objects.filter(group__in=t.concluded_groups, state="active").order_by("-time"):
313+
for e in ChangeStateGroupEvent.objects.filter(group__in=groups, state="active").order_by("-time"):
311314
d[e.group_id].start_date = e.time
312315

313-
for e in ChangeStateGroupEvent.objects.filter(group__in=t.concluded_groups, state="conclude").order_by("time"):
316+
for e in ChangeStateGroupEvent.objects.filter(group__in=groups, state="conclude").order_by("time"):
314317
d[e.group_id].conclude_date = e.time
315318

316319
return render(request, 'group/concluded_groups.html',
317-
dict(group_types=group_types))
320+
dict(sections=sections))
318321

319322
def get_group_materials(group):
320323
# return Document.objects.filter(group=group, type__in=group.features.material_types, session=None).exclude(states__slug="deleted")

ietf/templates/group/concluded_groups.html

Lines changed: 79 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,60 +6,111 @@
66
<link rel="stylesheet" href="{% static "jquery.tablesorter/css/theme.bootstrap.min.css" %}">
77
{% endblock %}
88

9+
{% block morecss %}
10+
11+
.fixed { position: fixed; }
12+
13+
.bs-docs-sidebar .nav .nav>li>a { padding-left: 20px; }
14+
15+
.bs-docs-sidebar .nav ul.nav { display: none; }
16+
17+
.bs-docs-sidebar .nav>.active>ul.nav { display: block; }
18+
19+
{% endblock %}
20+
21+
{% block bodyAttrs %}data-spy="scroll" data-target="#navscroller"{% endblock %}
22+
923
{% block title %}Concluded groups{% endblock %}
1024

1125
{% block content %}
1226
{% origin %}
27+
<div class="col-md-10">
1328
<h1>Concluded groups</h1>
1429

1530
<p class="alert alert-info">Note that the information on historical groups may be inaccurate.</p>
1631

17-
{% for t in group_types %}
18-
<h2>{{ t.name }}s</h2>
32+
{% for label, groups in sections.items %}
33+
<div class="anchor-target" id="{{label}}">
34+
<div class="panel panel-default">
35+
<div class="panel-heading">{{label}}</div>
36+
<div class="panel-body">
1937

20-
{% if t.slug == "wg" %}
38+
{% if label == "WGs" %}
2139
<p>
2240
Some additional concluded WGs may
2341
be present <a href="https://tools.ietf.org/wg/concluded">here</a>.
2442
</p>
25-
{% elif t.slug == "rg" %}
43+
{% elif label == "RGs" %}
2644
<p>
2745
The information below is incomplete and misses a few older RGs.
2846
Please check the <a href="https://irtf.org/groups">IRTF site</a>
2947
for more complete information.
3048
</p>
3149
{% endif %}
3250

33-
{% if not t.concluded_groups %}
51+
{% if not groups %}
3452
<p><b>No groups found.</b></p>
3553
{% else %}
36-
<table class="table table-condensed table-striped tablesorter">
37-
<thead>
38-
<tr>
39-
<th>Group</th>
40-
<th>Name</th>
41-
<th>Start</th>
42-
<th>Concluded</th>
43-
</tr>
44-
</thead>
45-
<tbody>
46-
{% for g in t.concluded_groups %}
47-
<tr>
48-
<td>
49-
<a href="{{ g.about_url }}">{{ g.acronym }}</a>
50-
</td>
51-
<td>{{ g.name }}</td>
52-
<td>{{ g.start_date|date:"Y-m" }}</td>
53-
<td>{{ g.conclude_date|date:"Y-m" }}</td>
54-
</tr>
55-
{% endfor %}
56-
</tbody>
57-
</table>
54+
{% regroup groups by parent as grouped_by_areas %}
55+
{% for area_grouping in grouped_by_areas %}
56+
<div class="anchor-target" id="{{label}}-{{area_grouping.grouper.name|default:'unknown'|slugify}}">
57+
<div class="panel panel-default">
58+
<div class="panel-heading">{{area_grouping.grouper.name|default:'Unknown area'}}</div>
59+
<div class="panel-body">
60+
<table class="table table-condensed table-striped tablesorter">
61+
<thead>
62+
<tr>
63+
<th class="col-md-1">Group</th>
64+
<th class="col-md-7">Name</th>
65+
<th class="col-md-1">Start</th>
66+
<th class="col-md-1">Concluded</th>
67+
</tr>
68+
</thead>
69+
<tbody>
70+
{% for g in area_grouping.list %}
71+
<tr>
72+
<td>
73+
<a href="{{ g.about_url }}">{{ g.acronym }}</a>
74+
</td>
75+
<td>{{ g.name }}</td>
76+
<td>{{ g.start_date|date:"Y-m" }}</td>
77+
<td>{{ g.conclude_date|date:"Y-m" }}</td>
78+
</tr>
79+
{% endfor %}
80+
</tbody>
81+
</table>
82+
</div>
83+
</div>
84+
</div>
85+
{% endfor %}
5886
{% endif %}
87+
</div>
88+
</div>
89+
</div>
5990
{% endfor %}
91+
</div>
6092

93+
<div class="col-md-2 hidden-print bs-docs-sidebar" id="navscroller">
94+
<ul class="nav nav-pills nav-stacked small fixed" >
95+
{% for label, groups in sections.items %}
96+
<li>
97+
<a href="#{{label}}">{{label}}</a>
98+
{% regroup groups by parent as grouped_by_areas %}
99+
<ul class="nav nav-pills nav-stacked">
100+
{% for area_grouping in grouped_by_areas %}
101+
<li>
102+
<a href="#{{label}}-{{area_grouping.grouper.name|default:'unknown'|slugify}}">
103+
{{area_grouping.grouper.name|default:'Unknown area'}}
104+
</a>
105+
</li>
106+
{% endfor %}
107+
</ul>
108+
</li>
109+
{% endfor %}
110+
</ul>
111+
</div>
61112
{% endblock %}
62113

63114
{% block js %}
64115
<script src="{% static "jquery.tablesorter/js/jquery.tablesorter.combined.min.js" %}"></script>
65-
{% endblock %}
116+
{% endblock %}

0 commit comments

Comments
 (0)