From c332e52cbedccff83e9e5c21b2e1e9257136a2b8 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Sun, 28 Feb 2016 18:23:25 +0000 Subject: [PATCH] Group concluded working groups by area. Fixes #1670. Commit ready for merge. - Legacy-Id: 10862 --- ietf/group/info.py | 19 ++-- ietf/templates/group/concluded_groups.html | 107 +++++++++++++++------ 2 files changed, 90 insertions(+), 36 deletions(-) diff --git a/ietf/group/info.py b/ietf/group/info.py index f0241b39e..e18551af8 100644 --- a/ietf/group/info.py +++ b/ietf/group/info.py @@ -296,25 +296,28 @@ def chartering_groups(request): group_types=group_types)) def concluded_groups(request): - group_types = GroupTypeName.objects.filter(slug__in=("wg", "rg")) + sections = OrderedDict() - for t in group_types: - t.concluded_groups = Group.objects.filter(type=t, state__in=("conclude", "bof-conc")).select_related("state", "charter").order_by("acronym") + sections['WGs'] = Group.objects.filter(type='wg', state="conclude").select_related("state", "charter").order_by("parent__name","acronym") + sections['RGs'] = Group.objects.filter(type='rg', state="conclude").select_related("state", "charter").order_by("parent__name","acronym") + sections['BOFs'] = Group.objects.filter(type='wg', state="bof-conc").select_related("state", "charter").order_by("parent__name","acronym") + for name, groups in sections.items(): + # add start/conclusion date - d = dict((g.pk, g) for g in t.concluded_groups) + d = dict((g.pk, g) for g in groups) - for g in t.concluded_groups: + for g in groups: g.start_date = g.conclude_date = None - for e in ChangeStateGroupEvent.objects.filter(group__in=t.concluded_groups, state="active").order_by("-time"): + for e in ChangeStateGroupEvent.objects.filter(group__in=groups, state="active").order_by("-time"): d[e.group_id].start_date = e.time - for e in ChangeStateGroupEvent.objects.filter(group__in=t.concluded_groups, state="conclude").order_by("time"): + for e in ChangeStateGroupEvent.objects.filter(group__in=groups, state="conclude").order_by("time"): d[e.group_id].conclude_date = e.time return render(request, 'group/concluded_groups.html', - dict(group_types=group_types)) + dict(sections=sections)) def get_group_materials(group): # return Document.objects.filter(group=group, type__in=group.features.material_types, session=None).exclude(states__slug="deleted") diff --git a/ietf/templates/group/concluded_groups.html b/ietf/templates/group/concluded_groups.html index 1489b431f..abe6b9b43 100644 --- a/ietf/templates/group/concluded_groups.html +++ b/ietf/templates/group/concluded_groups.html @@ -6,23 +6,41 @@ {% endblock %} +{% block morecss %} + +.fixed { position: fixed; } + +.bs-docs-sidebar .nav .nav>li>a { padding-left: 20px; } + +.bs-docs-sidebar .nav ul.nav { display: none; } + +.bs-docs-sidebar .nav>.active>ul.nav { display: block; } + +{% endblock %} + +{% block bodyAttrs %}data-spy="scroll" data-target="#navscroller"{% endblock %} + {% block title %}Concluded groups{% endblock %} {% block content %} {% origin %} +

Concluded groups

Note that the information on historical groups may be inaccurate.

- {% for t in group_types %} -

{{ t.name }}s

+ {% for label, groups in sections.items %} +
+
+
{{label}}
+
- {% if t.slug == "wg" %} + {% if label == "WGs" %}

Some additional concluded WGs may be present here.

- {% elif t.slug == "rg" %} + {% elif label == "RGs" %}

The information below is incomplete and misses a few older RGs. Please check the IRTF site @@ -30,36 +48,69 @@

{% endif %} - {% if not t.concluded_groups %} + {% if not groups %}

No groups found.

{% else %} - - - - - - - - - - - {% for g in t.concluded_groups %} - - - - - - - {% endfor %} - -
GroupNameStartConcluded
- {{ g.acronym }} - {{ g.name }}{{ g.start_date|date:"Y-m" }}{{ g.conclude_date|date:"Y-m" }}
+ {% regroup groups by parent as grouped_by_areas %} + {% for area_grouping in grouped_by_areas %} +
+
+
{{area_grouping.grouper.name|default:'Unknown area'}}
+
+ + + + + + + + + + + {% for g in area_grouping.list %} + + + + + + + {% endfor %} + +
GroupNameStartConcluded
+ {{ g.acronym }} + {{ g.name }}{{ g.start_date|date:"Y-m" }}{{ g.conclude_date|date:"Y-m" }}
+
+
+
+ {% endfor %} {% endif %} +
+
+
{% endfor %} +
+ {% endblock %} {% block js %} -{% endblock %} \ No newline at end of file +{% endblock %}