Skip to content

Commit 9dbdbd5

Browse files
committed
Merged in [18296] from rjsparks@nostrum.com:
Show RSOC from the Group menu. Fixes ietf-tools#3024. - Legacy-Id: 18308 Note: SVN reference [18296] has been migrated to Git commit 328c92f
2 parents a4a89b1 + 44d19f0 commit 9dbdbd5

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
1+
# Copyright The IETF Trust 2015-2020, All Rights Reserved
12
from django import template
23
from django.template.loader import render_to_string
4+
from django.urls import reverse
35

6+
from ietf.group.models import Group
47
from ietf.name.models import GroupTypeName
58

69
register = template.Library()
710

811
parents = GroupTypeName.objects.filter(slug__in=['ag','area','team','dir','program'])
912

13+
others = []
14+
for group in Group.objects.filter(acronym__in=('rsoc',), state_id='active'):
15+
group.menu_url = reverse('ietf.group.views.group_home', kwargs=dict(acronym=group.acronym)) # type: ignore
16+
# could use group.about_url() instead
17+
others.append(group)
18+
1019
@register.simple_tag
1120
def active_groups_menu():
12-
global parents
21+
global parents, others
1322
for p in parents:
1423
p.menu_url = '/%s/'%p.slug
15-
return render_to_string('base/menu_active_groups.html', { 'parents': parents })
24+
return render_to_string('base/menu_active_groups.html', { 'parents': parents, 'others': others })
1625

ietf/templates/base/menu_active_groups.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,9 @@
55
<a href="{{ p.menu_url }}">Active {{ p.name }}s</a>
66
</li>
77
{% endfor %}
8+
{% for o in others %}
9+
<li>
10+
<a href="{{o.menu_url}}">{{ o.acronym|upper }}</a>
11+
</li>
12+
{% endfor %}
813
</ul>

0 commit comments

Comments
 (0)