From ae8356665362277f3ee4e9f717ef8d80bc2f3568 Mon Sep 17 00:00:00 2001 From: fonfon Date: Mon, 15 Dec 2014 15:54:40 +0100 Subject: [PATCH] removed unused 'title' from subsubmenus --- plinth/modules/pagekite/pagekite.py | 11 +++++------ plinth/modules/users/views.py | 14 +++++--------- plinth/modules/xmpp/xmpp.py | 23 ++++++----------------- plinth/templates/subsubmenu.html | 2 +- plinth/templatetags/plinth_extras.py | 6 ++---- plinth/tests/test_templatetags.py | 15 ++++++--------- 6 files changed, 25 insertions(+), 46 deletions(-) diff --git a/plinth/modules/pagekite/pagekite.py b/plinth/modules/pagekite/pagekite.py index 5a78a1ac9..9f435b77e 100644 --- a/plinth/modules/pagekite/pagekite.py +++ b/plinth/modules/pagekite/pagekite.py @@ -34,11 +34,10 @@ from plinth import cfg LOGGER = logging.getLogger(__name__) -subsubmenu = {'title': _('PageKite'), - 'items': [{'url': reverse_lazy('pagekite:index'), - 'text': _('About PageKite')}, - {'url': reverse_lazy('pagekite:configure'), - 'text': _('Configure PageKite')}]} +subsubmenu = [{'url': reverse_lazy('pagekite:index'), + 'text': _('About PageKite')}, + {'url': reverse_lazy('pagekite:configure'), + 'text': _('Configure PageKite')}] def init(): @@ -194,7 +193,7 @@ def _apply_changes(request, old_status, new_status): def _run(arguments, superuser=True): - """Run an given command and raise exception if there was an error""" + """Run a given command and raise exception if there was an error""" command = 'pagekite-configure' if superuser: diff --git a/plinth/modules/users/views.py b/plinth/modules/users/views.py index 773051515..9859aa2d5 100644 --- a/plinth/modules/users/views.py +++ b/plinth/modules/users/views.py @@ -28,18 +28,14 @@ from django.views.generic import ListView from gettext import gettext as _ -# TODO: we do not use the title anymore, and 'items' is also a python keyword. -# For all subsubmenus: let's remove title and just use the items list directly. -# Make sure to update the tests too. -subsubmenu = {'title': _('Users and Groups'), - 'items': [{'url': reverse_lazy('users:index'), - 'text': _('Users')}, - {'url': reverse_lazy('users:create'), - 'text': _('Create User')}]} +subsubmenu = [{'url': reverse_lazy('users:index'), + 'text': _('Users')}, + {'url': reverse_lazy('users:create'), + 'text': _('Create User')}] class ContextMixin(object): - """View to add 'subsubmenu' and 'title' to the context.""" + """Mixin to add 'subsubmenu' and 'title' to the context.""" def get_context_data(self, **kwargs): """Use self.title and the module-level subsubmenu""" context = super(ContextMixin, self).get_context_data(**kwargs) diff --git a/plinth/modules/xmpp/xmpp.py b/plinth/modules/xmpp/xmpp.py index 7adcc01ae..3a67c14a8 100644 --- a/plinth/modules/xmpp/xmpp.py +++ b/plinth/modules/xmpp/xmpp.py @@ -30,23 +30,12 @@ from plinth import service LOGGER = logging.getLogger(__name__) -subsubmenu = { - 'title': _('XMPP'), - 'items': [ - { - 'url': reverse_lazy('xmpp:index'), - 'text': _('About'), - }, - { - 'url': reverse_lazy('xmpp:configure'), - 'text': _('Configure XMPP Server'), - }, - { - 'url': reverse_lazy('xmpp:register'), - 'text': _('Register XMPP Account'), - } - ] -} +subsubmenu = [{'url': reverse_lazy('xmpp:index'), + 'text': _('About')}, + {'url': reverse_lazy('xmpp:configure'), + 'text': _('Configure XMPP Server')}, + {'url': reverse_lazy('xmpp:register'), + 'text': _('Register XMPP Account')}] def init(): diff --git a/plinth/templates/subsubmenu.html b/plinth/templates/subsubmenu.html index f071f471f..521893117 100644 --- a/plinth/templates/subsubmenu.html +++ b/plinth/templates/subsubmenu.html @@ -18,7 +18,7 @@ {% endcomment %}