mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
Add basic front page with shortcuts to web apps
This commit is contained in:
1 parent
b69720e0d4
commit
3eb7dd914a
11 files changed
+229
-7
No files matched your search
@@ -24,6 +24,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from plinth import actions
|
||||
from plinth import action_utils
|
||||
from plinth import cfg
|
||||
from plinth import frontpage
|
||||
from plinth import service as service_module
|
||||
|
||||
|
||||
@@ -59,6 +60,9 @@ def init():
|
||||
managed_services[0], title, ports=['http', 'https'], is_external=True,
|
||||
is_enabled=is_enabled, enable=enable, disable=disable)
|
||||
|
||||
if is_enabled():
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def setup(helper, old_version=None):
|
||||
"""Install and configure the module."""
|
||||
@@ -66,6 +70,11 @@ def setup(helper, old_version=None):
|
||||
helper.install(managed_packages)
|
||||
helper.call('post', actions.superuser_run, 'ttrss', ['setup'])
|
||||
helper.call('post', service.notify_enabled, None, True)
|
||||
helper.call('post', add_shortcut)
|
||||
|
||||
|
||||
def add_shortcut():
|
||||
frontpage.add_shortcut('ttrss', title, '/tt-rss', 'glyphicon-envelope')
|
||||
|
||||
|
||||
def is_enabled():
|
||||
@@ -77,11 +86,13 @@ def is_enabled():
|
||||
def enable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('ttrss', ['enable'])
|
||||
add_shortcut()
|
||||
|
||||
|
||||
def disable():
|
||||
"""Enable the module."""
|
||||
actions.superuser_run('ttrss', ['disable'])
|
||||
frontpage.remove_shortcut('ttrss')
|
||||
|
||||
|
||||
def diagnose():
|
||||
|
||||
Reference in new issue
Block a user