Skip to content

Commit

Permalink
Replaced emoji for special page nav link with text (#12728)
Browse files Browse the repository at this point in the history
* Replaced emoji for special page nav link with text
* Created a template fragment to render notes for menu link to special page
  • Loading branch information
mmmavis authored Aug 28, 2024
1 parent 1f30b2a commit 2eef82e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion network-api/networkapi/templates/tags/horizontal_nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% for entry in menu_pages %}
{% pageurl entry.page as entry_page_url %}
{% if entry.depth < 2 %}
<a class="multipage-link {% if current_page_url == entry_page_url %}active{% endif %} {% if entry.restriction != None %}multipage-{{ entry.restriction }}-restricted{% endif %} {% if not entry.page.live %}multipage-draft{% endif %}" href="{% pageurl entry.page %}">{{ entry.menu_title }}</a>
<a class="multipage-link {% if current_page_url == entry_page_url %}active{% endif %}" href="{% pageurl entry.page %}">{{ entry.menu_title }} {% include "tags/multipage_menu_link_note.html" with menu_entry=entry %}</a>
{% endif %}
{% endfor %}
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% load i18n %}

{% with class="tw-text-red-80 tw-text-sm tw-ml-1" %}
{% comment %}These notes are internal facing only. Only logged in users can see them.{% endcomment %}

{% if menu_entry.restriction == "login" %}
<span class="{{ class }}">(logged in users only)</span>
{% elif menu_entry.restriction == "groups" %}
<span class="{{ class }}">(restricted to specific groups)</span>
{% elif menu_entry.restriction == "password" %}
<span class="{{ class }}">(password protected)</span>
{% endif %}

{% if not menu_entry.page.live %}
<span class="{{ class }}">(draft)</span>
{% endif %}

{% endwith %}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% for entry in menu_pages %}
{% pageurl entry.page as entry_page_url %}
<div class="multipage-link-wrapper">
<a class="multipage-link {% if current_page_url == entry_page_url %}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 class="multipage-link {% if current_page_url == entry_page_url %}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 }} {% include "tags/multipage_menu_link_note.html" with menu_entry=entry %}
</a>
</div>
{% endfor %}
Expand Down
16 changes: 0 additions & 16 deletions source/sass/components/multipage-nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,4 @@
@apply tw-mb-12;
}
}

.multipage-login-restricted::after {
content: "🙈";
}

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

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

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

0 comments on commit 2eef82e

Please sign in to comment.