Merged in [18296] from rjsparks@nostrum.com:

Show RSOC from the Group menu. Fixes #3024.
 - Legacy-Id: 18308
Note: SVN reference [18296] has been migrated to Git commit 328c92f395
This commit is contained in:
Henrik Levkowetz 2020-07-29 14:18:29 +00:00
commit 9dbdbd5078
2 changed files with 16 additions and 2 deletions

View file

@ -1,16 +1,25 @@
# Copyright The IETF Trust 2015-2020, All Rights Reserved
from django import template
from django.template.loader import render_to_string
from django.urls import reverse
from ietf.group.models import Group
from ietf.name.models import GroupTypeName
register = template.Library()
parents = GroupTypeName.objects.filter(slug__in=['ag','area','team','dir','program'])
others = []
for group in Group.objects.filter(acronym__in=('rsoc',), state_id='active'):
group.menu_url = reverse('ietf.group.views.group_home', kwargs=dict(acronym=group.acronym)) # type: ignore
# could use group.about_url() instead
others.append(group)
@register.simple_tag
def active_groups_menu():
global parents
global parents, others
for p in parents:
p.menu_url = '/%s/'%p.slug
return render_to_string('base/menu_active_groups.html', { 'parents': parents })
return render_to_string('base/menu_active_groups.html', { 'parents': parents, 'others': others })

View file

@ -5,4 +5,9 @@
<a href="{{ p.menu_url }}">Active {{ p.name }}s</a>
</li>
{% endfor %}
{% for o in others %}
<li>
<a href="{{o.menu_url}}">{{ o.acronym|upper }}</a>
</li>
{% endfor %}
</ul>