Browse Source
Add subgroups list in group sidebar (fixes #567)
merge-requests/82/head
deing
6 years ago
No known key found for this signature in database
GPG Key ID: DA34C790D267C164
2 changed files with
19 additions and
0 deletions
-
tildes/tildes/templates/topic_listing.jinja2
-
tildes/tildes/views/topic.py
|
|
|
@ -224,6 +224,17 @@ |
|
|
|
{{ group.sidebar_rendered_html|safe }} |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
{% if subgroups %} |
|
|
|
<ul class="nav"> |
|
|
|
<li>Subgroups</li> |
|
|
|
<ul class="nav"> |
|
|
|
{% for subgroup in subgroups %} |
|
|
|
<li class="nav-item">{{ group_linked(subgroup.path) }}</li> |
|
|
|
{% endfor %} |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
{% if wiki_pages or wiki_has_index %} |
|
|
|
<ul class="nav"> |
|
|
|
<li>Group wiki pages</li> |
|
|
|
|
|
|
|
@ -157,10 +157,17 @@ def get_group_topics( |
|
|
|
groups = [ |
|
|
|
group for group in request.query(Group).all() if group.path != "test" |
|
|
|
] |
|
|
|
subgroups = None |
|
|
|
else: |
|
|
|
# otherwise, just topics from the single group that we're looking at |
|
|
|
groups = [request.context] |
|
|
|
|
|
|
|
subgroups = [ |
|
|
|
group |
|
|
|
for group in request.query(Group).all() |
|
|
|
if group.is_subgroup_of(request.context) |
|
|
|
] |
|
|
|
|
|
|
|
default_settings = _get_default_settings(request, order) |
|
|
|
|
|
|
|
if order is missing: |
|
|
|
@ -245,6 +252,7 @@ def get_group_topics( |
|
|
|
"unfiltered": unfiltered, |
|
|
|
"wiki_pages": wiki_pages, |
|
|
|
"wiki_has_index": wiki_has_index, |
|
|
|
"subgroups": subgroups, |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|