Skip to content

Commit cb02df1

Browse files
committed
Show counts on the active groups page and on the active wgs page. Fixes ietf-tools#2060. Commit ready for merge.
- Legacy-Id: 15709
1 parent 4337496 commit cb02df1

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

ietf/group/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
from django.conf import settings
4646
from django.contrib.auth.decorators import login_required
4747
from django.db.models.aggregates import Max
48-
from django.db.models import Q
48+
from django.db.models import Q, Count
4949
from django.http import HttpResponse, HttpResponseForbidden, Http404, HttpResponseRedirect, JsonResponse
5050
from django.shortcuts import render, redirect, get_object_or_404
5151
from django.template.loader import render_to_string
@@ -301,7 +301,7 @@ def active_groups(request, group_type=None):
301301
raise Http404
302302

303303
def active_group_types(request):
304-
grouptypes = GroupTypeName.objects.filter(slug__in=['wg','rg','ag','team','dir','review','area','program'])
304+
grouptypes = GroupTypeName.objects.filter(slug__in=['wg','rg','ag','team','dir','review','area','program']).filter(group__state='active').annotate(group_count=Count('group'))
305305
return render(request, 'group/active_groups.html', {'grouptypes':grouptypes})
306306

307307
def active_dirs(request):

ietf/templates/group/active_groups.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ <h1>Active groups</h1>
1414
<table class="table table-condensed table-striped tablesorter">
1515
<thead>
1616
<tr>
17-
<th>Type</th>
18-
<th>Description</th>
17+
<th class="col-md-2">Type</th>
18+
<th class="col-md-1">Count</th>
19+
<th class="col-md-9">Description</th>
1920
</tr>
2021
</thead>
2122
<tbody>
2223
{% for typename in grouptypes %}
2324
<tr>
2425
<td><a href="{% url "ietf.group.views.active_groups" group_type=typename.slug%}">{{ typename.name }}</a></td>
26+
<td>{{ typename.group_count }}</td>
2527
<td>{{ typename.desc }}</td>
2628
</tr>
2729
{% endfor %}

ietf/templates/group/active_wgs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h3>{{ area.acronym }} area-specific web page{{ area.urls|pluralize}}</h3>
4747
{% endif %}
4848

4949
{% if area.groups %}
50-
<h3>{{ area.acronym }} active WG{{ area.groups|pluralize}}</h3>
50+
<h3>{{ area.acronym }} active WG{{ area.groups|pluralize}} ({{area.groups.count}})</h3>
5151
<table class="table table-condensed table-striped tablesorter">
5252
<thead>
5353
<tr>

0 commit comments

Comments
 (0)