Browse Source

Merge branch 'subgroups-ux-enhancements-1' into 'master'

Subgroups UX Enhancements (#450, #567, #381)

Closes #567, #450, and #381

See merge request tildes/tildes!82
merge-requests/82/merge
deing 6 years ago
parent
commit
54a2cc9c67
  1. 6
      tildes/scss/modules/_group.scss
  2. 2
      tildes/tildes/templates/groups.jinja2
  3. 6
      tildes/tildes/templates/topic.jinja2
  4. 11
      tildes/tildes/templates/topic_listing.jinja2
  5. 8
      tildes/tildes/views/topic.py

6
tildes/scss/modules/_group.scss

@ -14,6 +14,12 @@
.group-subscription-count {
margin-bottom: 0.2rem;
}
@for $indent-level from 1 through 4 {
tr.group-level-#{$indent-level} td:first-child {
padding-left: #{$indent-level}rem;
}
}
}
.group-list-description {

2
tildes/tildes/templates/groups.jinja2

@ -22,7 +22,7 @@
</thead>
<tbody>
{% for group in groups %}
<tr>
<tr class="group-level-{{ group.path|length - 1 }}">
<td>
{{ group_linked(group.path) }}
{% if group.short_description %}

6
tildes/tildes/templates/topic.jinja2

@ -26,7 +26,11 @@
{% endblock %}
{% block header_context_link %}
<a class="site-header-context" href="/~{{ topic.group.path }}">~{{ topic.group.path }}</a>
{# Split the link out for each "segment" of the group path #}
<a class="site-header-context" href="/~{{ topic.group.path[0:1] }}">~{{ topic.group.path[0:1] }}</a>
{% for i in range(1, topic.group.path|length) %}
.<a class="site-header-context" href="/~{{ topic.group.path[0:i+1] }}">{{ topic.group.path[i:i+1] }}</a>
{% endfor %}
{% endblock %}
{% block content %}

11
tildes/tildes/templates/topic_listing.jinja2

@ -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>

8
tildes/tildes/views/topic.py

@ -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,
}

Loading…
Cancel
Save