mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
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:
1 parent
fe16bf4d26
commit
893bd2b4d6
27 files changed
+295
-103
No files matched your search
@@ -66,8 +66,7 @@ manual_page = 'Privoxy'
|
||||
def init():
|
||||
"""Intialize the module."""
|
||||
menu = main_menu.get('apps')
|
||||
menu.add_urlname(name, 'privoxy', 'privoxy:index',
|
||||
short_description)
|
||||
menu.add_urlname(name, 'privoxy', 'privoxy:index', short_description)
|
||||
|
||||
global service
|
||||
setup_helper = globals()['setup_helper']
|
||||
@@ -78,6 +77,7 @@ def init():
|
||||
|
||||
if service.is_enabled():
|
||||
add_shortcut()
|
||||
menu.promote_item('privoxy:index')
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
@@ -91,6 +91,8 @@ def setup(helper, old_version=None):
|
||||
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, 'privoxy:index')
|
||||
|
||||
|
||||
def add_shortcut():
|
||||
@@ -104,12 +106,16 @@ def enable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('service', ['enable', managed_services[0]])
|
||||
add_shortcut()
|
||||
menu = main_menu.get('apps')
|
||||
menu.promote_item('privoxy:index')
|
||||
|
||||
|
||||
def disable():
|
||||
"""Disable the module."""
|
||||
actions.superuser_run('service', ['disable', managed_services[0]])
|
||||
frontpage.remove_shortcut('privoxy')
|
||||
menu = main_menu.get('apps')
|
||||
menu.demote_item('privoxy:index')
|
||||
|
||||
|
||||
class PrivoxyServiceView(ServiceView):
|
||||
|
||||
Reference in new issue
Block a user