Merged in [19307] from rjsparks@nostrum.com:
Add IAB Administrative Support Group group type. Add IAB groups to the group menu. Clearly delineate group types in the group menu. Fixes #3295 and #3296.
- Legacy-Id: 19328
Note: SVN reference [19307] has been migrated to Git commit d42730300a
This commit is contained in:
commit
ff5707b5f0
|
@ -38,13 +38,14 @@ from ietf.group.models import Group
|
|||
|
||||
register = template.Library()
|
||||
|
||||
area_short_names = {
|
||||
parent_short_names = {
|
||||
'ops':'Ops & Mgmt',
|
||||
'rai':'RAI'
|
||||
'rai':'RAI',
|
||||
'iab':'IAB',
|
||||
}
|
||||
|
||||
parents = Group.objects.filter(
|
||||
models.Q(type="area") | models.Q(type="irtf", acronym="irtf"),
|
||||
models.Q(type="area") | models.Q(type="irtf", acronym="irtf") | models.Q(acronym='iab'),
|
||||
state="active"
|
||||
).order_by('type_id', 'acronym')
|
||||
|
||||
|
@ -53,7 +54,7 @@ def wg_menu():
|
|||
global parents
|
||||
|
||||
for p in parents:
|
||||
p.short_name = area_short_names.get(p.acronym) or p.name
|
||||
p.short_name = parent_short_names.get(p.acronym) or p.name
|
||||
if p.short_name.endswith(" Area"):
|
||||
p.short_name = p.short_name[:-len(" Area")]
|
||||
|
||||
|
@ -61,5 +62,7 @@ def wg_menu():
|
|||
p.menu_url = "/wg/#" + p.acronym
|
||||
elif p.acronym == "irtf":
|
||||
p.menu_url = "/rg/"
|
||||
elif p.acronym == "iab":
|
||||
p.menu_url = "/program/"
|
||||
|
||||
return render_to_string('base/menu_wg.html', { 'parents': parents })
|
||||
|
|
38
ietf/group/migrations/0045_iabasg.py
Normal file
38
ietf/group/migrations/0045_iabasg.py
Normal file
|
@ -0,0 +1,38 @@
|
|||
# Copyright The IETF Trust 2021 All Rights Reserved
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
def forward(apps, schema_editor):
|
||||
GroupFeatures = apps.get_model('group', 'GroupFeatures')
|
||||
Group = apps.get_model('group', 'Group')
|
||||
|
||||
# Copy program to iabasg
|
||||
feat = GroupFeatures.objects.get(pk='program')
|
||||
feat.pk = 'iabasg'
|
||||
feat.save()
|
||||
feat.parent_types.add('ietf')
|
||||
|
||||
# List provided by Cindy on 30Aug2021
|
||||
Group.objects.filter(acronym__in=['iana-evolution','iproc','liaison-oversight','ietfiana','plenary-planning','rfcedprog']).update(type_id='iabasg')
|
||||
|
||||
Group.objects.filter(acronym='model-t').update(parent=Group.objects.get(acronym='iab'))
|
||||
|
||||
def reverse(apps, schema_editor):
|
||||
GroupFeatures = apps.get_model('group', 'GroupFeatures')
|
||||
Group = apps.get_model('group', 'Group')
|
||||
Group.objects.filter(type_id='iabasg').update(type_id='program')
|
||||
# Intentionally not removing the parent of model-t
|
||||
GroupFeatures.objects.filter(pk='iabasg').delete()
|
||||
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('group', '0044_populate_groupfeatures_parent_type_fields'),
|
||||
('name', '0028_iabasg'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(forward, reverse)
|
||||
]
|
|
@ -292,8 +292,8 @@ def active_groups(request, group_type=None):
|
|||
return active_dirs(request)
|
||||
elif group_type == "review":
|
||||
return active_review_dirs(request)
|
||||
elif group_type == "program":
|
||||
return active_programs(request)
|
||||
elif group_type in ("program", "iabasg"):
|
||||
return active_iab(request)
|
||||
else:
|
||||
raise Http404
|
||||
|
||||
|
@ -321,11 +321,11 @@ def active_teams(request):
|
|||
group.chairs = sorted(roles(group, "chair"), key=extract_last_name)
|
||||
return render(request, 'group/active_teams.html', {'teams' : teams })
|
||||
|
||||
def active_programs(request):
|
||||
programs = Group.objects.filter(type="program", state="active").order_by("name")
|
||||
for group in programs:
|
||||
def active_iab(request):
|
||||
iabgroups = Group.objects.filter(type__in=("program","iabasg"), state="active").order_by("-type_id","name")
|
||||
for group in iabgroups:
|
||||
group.leads = sorted(roles(group, "lead"), key=extract_last_name)
|
||||
return render(request, 'group/active_programs.html', {'programs' : programs })
|
||||
return render(request, 'group/active_iabgroups.html', {'iabgroups' : iabgroups })
|
||||
|
||||
def active_areas(request):
|
||||
areas = Group.objects.filter(type="area", state="active").order_by("name")
|
||||
|
@ -1290,12 +1290,13 @@ def group_json(request, acronym):
|
|||
@cache_control(public=True, max_age=30*60)
|
||||
@cache_page(30 * 60)
|
||||
def group_menu_data(request):
|
||||
groups = Group.objects.filter(state="active", type__features__acts_like_wg=True, parent__state="active").order_by("acronym")
|
||||
groups = Group.objects.filter(state="active", parent__state="active").filter(Q(type__features__acts_like_wg=True)|Q(type_id__in=['program','iabasg'])).order_by("-type_id","acronym")
|
||||
|
||||
groups_by_parent = defaultdict(list)
|
||||
for g in groups:
|
||||
url = urlreverse("ietf.group.views.group_home", kwargs={ 'group_type': g.type_id, 'acronym': g.acronym })
|
||||
groups_by_parent[g.parent_id].append({ 'acronym': g.acronym, 'name': escape(g.name), 'url': url })
|
||||
# groups_by_parent[g.parent_id].append({ 'acronym': g.acronym, 'name': escape(g.name), 'url': url })
|
||||
groups_by_parent[g.parent_id].append({ 'acronym': g.acronym, 'name': escape(g.name), 'type': escape(g.type.verbose_name or g.type.name), 'url': url })
|
||||
|
||||
return JsonResponse(groups_by_parent)
|
||||
|
||||
|
|
22
ietf/name/migrations/0028_iabasg.py
Normal file
22
ietf/name/migrations/0028_iabasg.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Copyright The IETF Trust 2021 All Rights Reserved
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
def forward(apps, schema_editor):
|
||||
GroupTypeName = apps.get_model('name', 'GroupTypeName')
|
||||
GroupTypeName.objects.create(slug='iabasg', name='IAB ASG', verbose_name='IAB Administrative Support Group', desc='')
|
||||
|
||||
def reverse(apps, schema_editor):
|
||||
GroupTypeName = apps.get_model('name', 'GroupTypeName')
|
||||
GroupTypeName.objects.filter(slug='iabasg').delete()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('name', '0027_add_bofrequest'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(forward, reverse)
|
||||
]
|
|
@ -37,6 +37,12 @@ body { padding-top: 72px; }
|
|||
.dropdown-submenu > .dropdown-menu li a{
|
||||
line-height: 1.2;
|
||||
}
|
||||
.dropdown-submenu > .dropdown-menu li.separator{
|
||||
font-size: 80%;
|
||||
margin-left: 1em;
|
||||
padding: .5em 0;
|
||||
border-bottom: 1px solid #CCC;
|
||||
}
|
||||
.dropdown-submenu > a:after {
|
||||
display: block;
|
||||
content: " ";
|
||||
|
|
|
@ -224,8 +224,13 @@ $(document).ready(function () {
|
|||
var menu = ['<ul class="dropdown-menu" role="menu">'];
|
||||
|
||||
var groups = data[parentId];
|
||||
var gtype = ""
|
||||
for (var i = 0; i < groups.length; ++i) {
|
||||
var g = groups[i];
|
||||
if (g.type != gtype) {
|
||||
menu.push('<li class="separator">' + g.type + 's</li>')
|
||||
gtype = g.type
|
||||
}
|
||||
menu.push('<li><a href="' + g.url + '">' + g.acronym +' — ' + g.name + '</a></li>');
|
||||
}
|
||||
|
||||
|
|
|
@ -6,22 +6,24 @@
|
|||
<link rel="stylesheet" href="{% static "jquery.tablesorter/css/theme.bootstrap.min.css" %}">
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}Active programs{% endblock %}
|
||||
{% block title %}Active IAB groups{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
{% origin %}
|
||||
<h1>Active programs</h1>
|
||||
{% regroup iabgroups by type as grouped_groups %}
|
||||
{% for grouptype in grouped_groups %}
|
||||
<h1>Active {% firstof grouptype.grouper.verbose_name grouptype.grouper.name %}{{grouptype.list|pluralize}}</h1>
|
||||
<table class="table table-condensed table-striped tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Program</th>
|
||||
<th>{{grouptype.grouper}}</th>
|
||||
<th>Name</th>
|
||||
<th>Lead</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for group in programs %}
|
||||
{% for group in grouptype.list %}
|
||||
<tr>
|
||||
<td><a href="{% url "ietf.group.views.group_home" acronym=group.acronym %}">{{ group.acronym }}</a></td>
|
||||
<td>{{ group.name }}</td>
|
||||
|
@ -34,6 +36,7 @@
|
|||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
@ -66,7 +66,7 @@ urlpatterns = [
|
|||
url(r'^submit/', include('ietf.submit.urls')),
|
||||
url(r'^sync/', include('ietf.sync.urls')),
|
||||
url(r'^templates/', include('ietf.dbtemplate.urls')),
|
||||
url(r'^(?P<group_type>(wg|rg|ag|rag|team|dir|review|area|program|adhoc|ise))/', include(grouptype_urls)),
|
||||
url(r'^(?P<group_type>(wg|rg|ag|rag|team|dir|review|area|program|iabasg|adhoc|ise))/', include(grouptype_urls)),
|
||||
|
||||
# Redirects
|
||||
url(r'^(?P<path>public)/', include('ietf.redirects.urls')),
|
||||
|
|
Loading…
Reference in a new issue