Skip to content

Commit

Permalink
feat: Add list of sub-groups to group's "about" page (#5450)
Browse files Browse the repository at this point in the history
* feat: Add list of sub-groups to group's "about" page

Fixes #5441

* Address review comments
  • Loading branch information
larseggert authored Mar 31, 2023
1 parent c5d7725 commit 8b815fc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ietf/group/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand All @@ -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):
Expand Down
33 changes: 33 additions & 0 deletions ietf/templates/group/group_about.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
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" %}
Expand Down Expand Up @@ -401,8 +404,38 @@ <h2 class="mt-3">
</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>
Expand Down

0 comments on commit 8b815fc

Please sign in to comment.