Show RSOC from the Group menu. Fixes #3024. Commit ready for merge.
- Legacy-Id: 18296
This commit is contained in:
parent
3ba391d11b
commit
328c92f395
|
@ -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,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>
|
||||
|
|
Loading…
Reference in a new issue