Revamp the menu structure some, and remove a bunch of unneeded files.

Commit ready for merge.
 - Legacy-Id: 19485
This commit is contained in:
Lars Eggert 2021-10-28 14:23:04 +00:00
parent 962253f994
commit 126892d8a2
6 changed files with 29 additions and 99 deletions

View file

@ -1,30 +0,0 @@
from django import template
from django.contrib.auth.models import AnonymousUser
from ietf.ietfauth.utils import has_role
from ietf.group.models import Group
from ietf.name.models import StreamName
register = template.Library()
@register.inclusion_tag('base/streams_menu.html', takes_context=True)
def streams_menu(context):
editable_streams = []
user = context["request"].user if "request" in context else AnonymousUser()
if user.is_authenticated:
streams = StreamName.objects.exclude(slug="legacy")
if has_role(user, "Secretariat"):
editable_streams.extend(streams)
else:
acronyms = Group.objects.filter(acronym__in=(s.slug for s in streams),
role__name="chair",
role__person__user=user).distinct().values_list("acronym", flat=True)
for s in streams:
if s.slug in acronyms:
editable_streams.append(s)
return { 'editable_streams': editable_streams }

View file

@ -42,6 +42,7 @@ parent_short_names = {
'ops':'Ops & Mgmt',
'rai':'RAI',
'iab':'IAB',
'art':'Apps & Realtime',
}
parents = Group.objects.filter(
@ -67,4 +68,4 @@ def wg_menu():
elif p.acronym == 'ietfadminllc':
p.menu_url = "/adm/"
return render_to_string('base/menu_wg.html', { 'parents': parents })
return render_to_string('base/menu_wg.html', { 'parents': parents })

View file

@ -1,5 +1,5 @@
{# Copyright The IETF Trust 2015-2019, All Rights Reserved #}{% load origin %}{% origin %}
{% load ietf_filters managed_groups wg_menu streams_menu active_groups_menu group_filters %}
{% load ietf_filters managed_groups wg_menu active_groups_menu group_filters %}
{% if flavor != "top" %}
{% include "base/menu_user.html" %}
@ -12,16 +12,11 @@
{% if flavor == "top" %}
</a>
<ul class="dropdown-menu" role="menu">
<li class="dropdown-header visible-lg-block">By area/parent</li>
{% endif %}
<li><a href="{% url "ietf.group.views.active_groups" group_type="wg" %}">Active WGs</a></li>
<li><a href="{% url "ietf.group.views.active_groups" group_type="rg" %}">Active RGs</a></li>
<li class="dropdown-submenu group-menu"><a href="{% url "ietf.group.views.active_groups" %}">Other</a>{% active_groups_menu %} </li>
{% if flavor == "top" %}<li class="divider hidden-xs"></li>{% endif %}
<li {%if flavor == "top" %}class="dropdown-header visible-lg-block"{% else %}class="nav-header hidden-nojs"{% endif %}>By area/parent</li>
{% wg_menu %}
{# <li class="hidden-lg hidden-nojs"><a href="#" data-toggle="modal" data-target="#navmodal">Jump to group</a></li> #}
<li class="dropdown-submenu group-menu"><a href="{% url "ietf.group.views.active_groups" %}">Other</a>{% active_groups_menu %} </li>
{% if flavor == "top" %}<li class="divider hidden-xs"></li>{% endif %}
<li {%if flavor == "top" %}class="dropdown-header hidden-xs"{% else %}class="nav-header"{% endif %}>New work</li>
@ -88,9 +83,6 @@
<li><a href="{% url "ietf.nomcom.views.private_index" g.nomcom_set.first.year %}">{{ g.acronym|capfirst }}</a></li>
{% endfor %}
{% endif %}
{% else %}
<li><a rel="nofollow" href="/accounts/login/?next={{ request.get_full_path|urlencode }}">Sign in to track docs</a></li>
{% endif %}
@ -112,16 +104,28 @@
<ul class="dropdown-menu" role="menu">
{% endif %}
{% if flavor == "top" %}
<li class="dropdown-header visible-lg-block">Next meeting</li>
{% endif %}
<li><a href="/meeting/agenda/">Agenda</a></li>
<li><a href="/meeting/materials/">Materials</a></li>
<li><a href="/meeting/floor-plan/">Floor plan</a></li>
<li><a href="https://www.ietf.org/how/meetings/register/">Registration</a></li>
<li><a href="{% url 'ietf.meeting.views.important_dates' %}">Important dates</a></li>
<li><a href="https://www.ietf.org/how/meetings/past/">Proceedings</a></li>
<li><a href="/meeting/upcoming">Upcoming</a></li>
<li><a href="/meeting/past">Past</a></li>
<li><a href="/secr/sreq/">Request a session</a></li>
<li><a href="/meeting/requests">Session requests</a></li>
{% if flavor == "top" %}
<li class="divider hidden-xs"></li>
<li class="dropdown-header visible-lg-block">Upcoming meetings</li>
{% endif %}
<li><a href="/meeting/upcoming">Upcoming meetings</a></li>
{% if flavor == "top" %}
<li class="divider hidden-xs"></li>
<li class="dropdown-header visible-lg-block">Past meetings</li>
{% endif %}
<li><a href="/meeting/past">Past meetings</a></li>
<li><a href="https://www.ietf.org/how/meetings/past/">Meeting proceedings</a></li>
{% if flavor == "top" %}</ul>{% endif %}
</li>

View file

@ -1,6 +1,12 @@
{# Copyright The IETF Trust 2015, All Rights Reserved #}{% load origin %}{% origin %}
{% for p in parents %}
<li class="hidden-nojs dropdown-submenu group-menu group-parent-{{ p.id }}">
<a href="{{ p.menu_url }}">{{ p.short_name }}</a>
<a href="{{ p.menu_url }}">
{% if p.short_name == "IETF Administration LLC" %}
IETF LLC
{% else %}
{{ p.short_name }}
{% endif %}
</a>
</li>
{% endfor %}
{% endfor %}

View file

@ -1,43 +0,0 @@
{# Copyright The IETF Trust 2015, All Rights Reserved #}{% load origin %}{% origin %}
<div class="table-responsive">
{% spaceless %}
<table class="table table-condensed">
<thead>
<tr>
{% for area in areas %}
<th class="text-center">{{area.acronym|upper}}</th>
{% endfor %}
<th class="text-center">IRTF</th>
</tr>
</thead>
<tbody>
<tr>
{% for area in areas %}
<td>
<div class="btn-group-vertical btn-block">
{% for group in area.active_groups %}
<div class="btn-group btn-group-xs btn-group-justified">
<a href="{% url "ietf.group.views.group_home" group_type=group.type_id acronym=group.acronym %}" class="btn btn-default">
{{group.acronym}}
</a>
</div>
{% endfor %}
</div>
</td>
{% endfor %}
<td>
<div class="btn-group-vertical btn-block">
{% for group in rgs %}
<div class="btn-group btn-group-xs btn-group-justified">
<a href="{% url "ietf.group.views.group_home" group_type=group.type_id acronym=group.acronym %}" class="btn btn-default">
{{group.acronym}}
</a>
</div>
{% endfor %}
</div>
</td>
</tr>
</tbody>
</table>
{% endspaceless %}
</div>

View file

@ -1,8 +0,0 @@
{# Copyright The IETF Trust 2015, All Rights Reserved #}{% load origin %}{% origin %}
{% load ietf_filters %}
{% if editable_streams %}
<li class="sect">Streams</li>
{% for stream in editable_streams %}
<li{% if forloop.last %} style="margin-bottom: 2px;"{% endif %}><a href="{% url "ietf.group.views.stream_edit" stream.slug %}">{{ stream.name }} stream</a></li>
{% endfor %}
{% endif %}