feat: Add list of sub-groups to group's "about" page (#5450)

* feat: Add list of sub-groups to group's "about" page

Fixes #5441

* Address review comments
This commit is contained in:
Lars Eggert 2023-03-31 10:29:07 +09:00 committed by GitHub
parent c5d7725e3f
commit 8b815fc76d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 0 deletions

View file

@ -544,6 +544,7 @@ def group_about(request, acronym, group_type=None):
can_provide_update = can_provide_status_update(request.user, group)
status_update = group.latest_event(type="status_update")
subgroups = Group.objects.filter(parent=group, state="active").exclude(type__slug__in=["sdo", "individ", "nomcom"]).order_by("type", "acronym")
return render(request, 'group/group_about.html',
construct_group_menu_context(request, group, "about", group_type, {
@ -556,6 +557,7 @@ def group_about(request, acronym, group_type=None):
"charter_submit_url": charter_submit_url,
"editable_roles": group.used_roles or group.features.default_used_roles,
"closing_note": e,
"subgroups": subgroups,
}))
def all_status(request):

View file

@ -12,6 +12,9 @@ height: 100vh;
text-decoration: none;
}
{% endblock %}
{% block pagehead %}
<link rel="stylesheet" href="{% static "ietf/css/list.css" %}">
{% endblock %}
{% block group_content %}
{% origin %}
{% if group.state_id == "conclude" %}
@ -401,8 +404,38 @@ height: 100vh;
</p>
{% endif %}
{% endif %}
{% if subgroups %}
<h2 class="mt-4">
Groups in {{ group.acronym|upper }}
</h2>
<table class="table table-sm table-striped tablesorter">
<thead>
<tr>
<th scope="col" data-sort="group">Group</th>
<th scope="col" data-sort="name">Name</th>
<th scope="col" data-sort="type">Type</th>
</tr>
</thead>
<tbody>
{% for sg in subgroups %}
<tr>
<td>
<div id="{{ sg.acronym }}">
<a href="{% url "ietf.group.views.group_home" acronym=sg.acronym %}">
{{ sg.acronym }}
</a>
</div>
</td>
<td>{{ sg.name }}</td>
<td>{{ sg.type }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock %}
{% block js %}
<script src="{% static "ietf/js/list.js" %}"></script>
<script src="{% static 'ietf/js/d3.js' %}"></script>
<script src="{% static 'ietf/js/document_relations.js' %}"></script>
<script src="{% static 'ietf/js/highcharts.js' %}"></script>