From 079b4324f6e3fd1cc5a68a22d1d08320f1a0899d Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 15 Oct 2024 16:32:29 -0700 Subject: [PATCH] help, system: Stop using submenu.sorted_items - This fixes a regression in showing menu items on the help:index page. Signed-off-by: Sunil Mohan Adapa --- plinth/modules/help/views.py | 9 ++++++--- plinth/templates/system.html | 4 ++-- plinth/views.py | 7 +++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/plinth/modules/help/views.py b/plinth/modules/help/views.py index a020252b7..cabbb0bfc 100644 --- a/plinth/modules/help/views.py +++ b/plinth/modules/help/views.py @@ -16,7 +16,7 @@ from django.urls import reverse from django.utils.translation import get_language_from_request from django.utils.translation import gettext as _ -from plinth import __version__, cfg +from plinth import __version__, cfg, menu from plinth.modules.upgrades import views as upgrades_views from . import privileged @@ -24,8 +24,11 @@ from . import privileged def index(request): """Serve the index page""" - return TemplateResponse(request, 'help_index.html', - {'title': _('Documentation and FAQ')}) + menu_items = menu.main_menu.active_item(request).sorted_items() + return TemplateResponse(request, 'help_index.html', { + 'title': _('Documentation and FAQ'), + 'menu_items': menu_items + }) def contribute(request): diff --git a/plinth/templates/system.html b/plinth/templates/system.html index 7bef3e372..fbd15a31b 100644 --- a/plinth/templates/system.html +++ b/plinth/templates/system.html @@ -1,4 +1,4 @@ -{% extends 'cards.html' %} +{% extends 'base.html' %} {% comment %} # SPDX-License-Identifier: AGPL-3.0-or-later {% endcomment %} @@ -18,7 +18,7 @@
- {% for section_item in submenu.sorted_items %} + {% for section_item in menu_items %}
{{ section_item.name }}
diff --git a/plinth/views.py b/plinth/views.py index ddd4eb312..5d555f6f2 100644 --- a/plinth/views.py +++ b/plinth/views.py @@ -181,8 +181,11 @@ class AppsIndexView(TemplateView): def system_index(request): """Serve the system index page.""" - return TemplateResponse(request, 'system.html', - {'advanced_mode': get_advanced_mode()}) + menu_items = menu.main_menu.active_item(request).sorted_items() + return TemplateResponse(request, 'system.html', { + 'advanced_mode': get_advanced_mode(), + 'menu_items': menu_items + }) class LanguageSelectionView(FormView):