Skip to content

Commit

Permalink
Merge branch 'master' into wagtail-inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
Pomax committed Jul 18, 2018
2 parents 6c561af + e45a875 commit 39ab167
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
Expand Up @@ -4,7 +4,7 @@
<div class="mb-4 hidden-sm-down">
<div class="pb-2 multipage-nav horizontal-nav" id="multipage-nav">
{% for entry in menu_pages %}
<a class="pb-2 multipage-link horizontal-link mr-4 {% if current.title == entry.page.title %}multipage-link-active{% endif %}" href="{% pageurl entry.page %}">{% if entry.depth == 2 %}→ {% endif %}{{ entry.menu_title }}
<a class="pb-2 multipage-link horizontal-link mr-4 {% if current.title == entry.page.title %}multipage-link-active{% endif %} {% if entry.restriction != None %}multipage-{{entry.restriction}}-restricted{% endif %} {% if not entry.page.live %}multipage-draft{% endif %}" href="{% pageurl entry.page %}">{% if entry.depth == 2 %}→ {% endif %}{{ entry.menu_title }}
</a>
{% endfor %}
</div>
Expand Down
Expand Up @@ -5,7 +5,7 @@
<div class="multipage-nav side-nav" id="multipage-nav">
{% for entry in menu_pages %}
<div>
<a class="multipage-link {% if current.title == entry.page.title %}multipage-link-active{% endif %}" href="{% pageurl entry.page %}">{% if entry.depth == 2 %}→ {% endif %}{{ entry.menu_title }}
<a class="multipage-link {% if current.title == entry.page.title %}multipage-link-active{% endif %} {% if entry.restriction != None %}multipage-{{entry.restriction}}-restricted{% endif %} {% if not entry.page.live %}multipage-draft{% endif %}" href="{% pageurl entry.page %}">{% if entry.depth == 2 %}→ {% endif %}{{ entry.menu_title }}
</a>
</div>
{% endfor %}
Expand Down
Expand Up @@ -7,7 +7,7 @@
<div class="d-flex flex-row primary-menu" id="multipage-nav">
{% for entry in menu_pages %}
<div>
<a class="multipage-link {% if current.title == entry.page.title %}multipage-link-active{% endif %}" href="{% pageurl entry.page %}">{% if entry.depth == 2 %}→ {% endif %}{{ entry.menu_title }}
<a class="multipage-link {% if current.title == entry.page.title %}multipage-link-active{% endif %} {% if entry.restriction != None %}multipage-{{entry.restriction}}-restricted{% endif %} {% if not entry.page.live %}multipage-draft{% endif %}" href="{% pageurl entry.page %}">{% if entry.depth == 2 %}→ {% endif %}{{ entry.menu_title }}
</a>
</div>
{% endfor %}
Expand Down
7 changes: 7 additions & 0 deletions network-api/networkapi/wagtailpages/utils.py
Expand Up @@ -36,10 +36,17 @@ def get_descendants(node, list, authenticated=False, depth=0, max_depth=2):
if header:
title = header
menu_title = title if depth > 0 else 'Overview'
restriction = node.get_view_restrictions().first()
try:
restriction_type = restriction.restriction_type
except AttributeError:
restriction_type = None

list.append({
'page': node,
'menu_title': menu_title,
'depth': depth,
'restriction': restriction_type,
})

nextset = node.get_children().in_menu()
Expand Down
16 changes: 16 additions & 0 deletions source/sass/components/nav.scss
Expand Up @@ -234,6 +234,22 @@
}

#multipage-nav {
.multipage-login-restricted::after {
content: '🙈';
}

.multipage-groups-restricted::after {
content: '👥';
}

.multipage-password-restricted::after {
content: '🔒';
}

.multipage-draft::after {
content: '🐣';
}

&.horizontal-nav {
border-bottom: 1px $light-gray solid;

Expand Down

0 comments on commit 39ab167

Please sign in to comment.