Skip to content

Commit

Permalink
Merge pull request #6207 from escattone/fix-1783
Browse files Browse the repository at this point in the history
fix contributor tools menus on mobile
  • Loading branch information
escattone authored Aug 30, 2024
2 parents 080cefb + 28e75b2 commit 18c7daa
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
7 changes: 1 addition & 6 deletions kitsune/sumo/jinja2/includes/common_macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -701,24 +701,19 @@ <h4 class="mzp-c-menu-item-title">{{ _('Inbox') }}</h4>
</li>
{% endmacro %}

{% macro for_contributors_sidebar(user, default_language, li_only=False, active=None, menu="contributor-discussions", locale=None, is_collapsible=False) -%}
{% macro for_contributors_sidebar(user, default_language, active=None, menu="contributor-discussions", locale=None, is_collapsible=False) -%}
{% if user.is_authenticated %}
<nav class="sidebar-nav" id="for-contributors-sidebar">
<span class="details-heading"></span>
{% if not li_only %}
<ul class="sidebar-nav--list">
{% endif %}
{% if menu == "contributor-tools" %}
<li class="sidebar-subheading sidebar-nav--heading-item hide-on-mobile">{{ _('Contributor tools') }}</li>
{{ _tools_nav_links(user, default_language, active, context="sidebar-menu", locale=locale, is_collapsible=is_collapsible) }}
{% else %}
<li class="sidebar-subheading sidebar-nav--heading-item">{{ _('Contributor discussions') }}</li>
{{ _discussion_nav_links(user, default_language, active, context="sidebar-menu") }}
{% endif %}

{% if not li_only %}
</ul>
{% endif %}
</nav>
{% endif %}
{%- endmacro %}
Expand Down
1 change: 0 additions & 1 deletion kitsune/sumo/static/sumo/js/protocol-details-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export default function detailsInit() {
if (sidebarList && mq.matches) {
window.Mzp.Details.init('.details-heading');
swapMobileSubnavText();

} else {
window.Mzp.Details.destroy('.details-heading');
}
Expand Down
2 changes: 1 addition & 1 deletion kitsune/wiki/jinja2/wiki/new_document.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h1 class="sumo-page-heading">{{ _('Create a New Knowledge Base Article') }}</h1
{% block side_top %}
<nav id="doc-tools">
<ul class="sidebar-nav sidebar-folding">
{{ for_contributors_sidebar(user, settings.WIKI_DEFAULT_LANGUAGE, True) }}
{{ for_contributors_sidebar(user, settings.WIKI_DEFAULT_LANGUAGE) }}
</ul>
</nav>
{% endblock %}
2 changes: 1 addition & 1 deletion kitsune/wiki/jinja2/wiki/recent_revisions.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% block side_top %}
<nav id="doc-tools">
<ul class="sidebar-nav sidebar-folding">
{{ for_contributors_sidebar(user, settings.WIKI_DEFAULT_LANGUAGE, True, menu="contributor-tools", locale=locale, is_collapsible=True, active="wiki.revisions") }}
{{ for_contributors_sidebar(user, settings.WIKI_DEFAULT_LANGUAGE, menu="contributor-tools", locale=locale, is_collapsible=True, active="wiki.revisions") }}
</ul>
</nav>
{% endblock %}
Expand Down

0 comments on commit 18c7daa

Please sign in to comment.