Skip to content

Commit 328c92f

Browse files
committed
Show RSOC from the Group menu. Fixes ietf-tools#3024. Commit ready for merge.
- Legacy-Id: 18296
1 parent 3ba391d commit 328c92f

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
from django import template
22
from django.template.loader import render_to_string
3+
from django.urls import reverse
34

5+
from ietf.group.models import Group
46
from ietf.name.models import GroupTypeName
57

68
register = template.Library()
79

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

12+
others = []
13+
for group in Group.objects.filter(acronym__in=('rsoc',), state_id='active'):
14+
group.menu_url = reverse('ietf.group.views.group_home', kwargs=dict(acronym=group.acronym)) # could use group.about_url() instead
15+
others.append(group)
16+
1017
@register.simple_tag
1118
def active_groups_menu():
12-
global parents
19+
global parents, others
1320
for p in parents:
1421
p.menu_url = '/%s/'%p.slug
15-
return render_to_string('base/menu_active_groups.html', { 'parents': parents })
22+
return render_to_string('base/menu_active_groups.html', { 'parents': parents, 'others': others })
1623

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)