apps: Separate enabled and disabled apps

- Add 'secondary' flag to menu items.

- Mark apps as 'secondary' when disabled.

- Extend TemplateView for apps index.

- Add card-container for disabled apps.

Closes #1309

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy authored and Sunil Mohan Adapa committed 2019-05-07 16:57:55 -07:00
1 parent fe16bf4d26
commit 893bd2b4d6
27 files changed
+295 -103

No files matched your search

+8 -2
View File
@@ -58,8 +58,7 @@ manual_page = 'Mumble'
def init():
"""Intialize the Mumble module."""
menu = main_menu.get('apps')
menu.add_urlname(name, 'mumble', 'mumble:index',
short_description)
menu.add_urlname(name, 'mumble', 'mumble:index', short_description)
global service
setup_helper = globals()['setup_helper']
@@ -70,6 +69,7 @@ def init():
if service.is_enabled():
add_shortcut()
menu.promote_item('mumble:index')
class MumbleServiceView(ServiceView):
@@ -90,6 +90,8 @@ def setup(helper, old_version=None):
], is_external=True, enable=enable, disable=disable)
helper.call('post', service.notify_enabled, None, True)
helper.call('post', add_shortcut)
menu = main_menu.get('apps')
helper.call('post', menu.promote_item, 'mumble:index')
def add_shortcut():
@@ -103,12 +105,16 @@ def enable():
"""Enable the module."""
actions.superuser_run('service', ['enable', managed_services[0]])
add_shortcut()
menu = main_menu.get('apps')
menu.promote_item('mumble:index')
def disable():
"""Disable the module."""
actions.superuser_run('service', ['disable', managed_services[0]])
frontpage.remove_shortcut('mumble')
menu = main_menu.get('apps')
menu.demote_item('mumble:index')
def diagnose():