Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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