Skip to content

Commit

Permalink
Show RSOC from the Group menu. Fixes #3024. Commit ready for merge.
Browse files Browse the repository at this point in the history
 - Legacy-Id: 18296
  • Loading branch information
rjsparks committed Jul 28, 2020
1 parent 3ba391d commit 328c92f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ietf/doc/templatetags/active_groups_menu.py
@@ -1,16 +1,23 @@
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)) # 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 })

5 changes: 5 additions & 0 deletions ietf/templates/base/menu_active_groups.html
Expand Up @@ -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>

0 comments on commit 328c92f

Please sign in to comment.