Merged in [15709] from rjsparks@nostrum.com:
Show counts on the active groups page and on the active wgs page. Fixes #2060.
- Legacy-Id: 15755
Note: SVN reference [15709] has been migrated to Git commit cb02df1681
This commit is contained in:
commit
44e28707cc
|
@ -45,7 +45,7 @@ from django import forms
|
|||
from django.conf import settings
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.db.models.aggregates import Max
|
||||
from django.db.models import Q
|
||||
from django.db.models import Q, Count
|
||||
from django.http import HttpResponse, HttpResponseForbidden, Http404, HttpResponseRedirect, JsonResponse
|
||||
from django.shortcuts import render, redirect, get_object_or_404
|
||||
from django.template.loader import render_to_string
|
||||
|
@ -301,7 +301,7 @@ def active_groups(request, group_type=None):
|
|||
raise Http404
|
||||
|
||||
def active_group_types(request):
|
||||
grouptypes = GroupTypeName.objects.filter(slug__in=['wg','rg','ag','team','dir','review','area','program'])
|
||||
grouptypes = GroupTypeName.objects.filter(slug__in=['wg','rg','ag','team','dir','review','area','program']).filter(group__state='active').annotate(group_count=Count('group'))
|
||||
return render(request, 'group/active_groups.html', {'grouptypes':grouptypes})
|
||||
|
||||
def active_dirs(request):
|
||||
|
|
|
@ -14,14 +14,16 @@
|
|||
<table class="table table-condensed table-striped tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th class="col-md-2">Type</th>
|
||||
<th class="col-md-1">Count</th>
|
||||
<th class="col-md-9">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for typename in grouptypes %}
|
||||
<tr>
|
||||
<td><a href="{% url "ietf.group.views.active_groups" group_type=typename.slug%}">{{ typename.name }}</a></td>
|
||||
<td>{{ typename.group_count }}</td>
|
||||
<td>{{ typename.desc }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% if area.groups %}
|
||||
<h3>{{ area.acronym }} active WG{{ area.groups|pluralize}}</h3>
|
||||
<h3>{{ area.acronym }} active WG{{ area.groups|pluralize}} ({{area.groups.count}})</h3>
|
||||
<table class="table table-condensed table-striped tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
Loading…
Reference in a new issue