Add basic front page with shortcuts to web apps

This commit is contained in:
James Valleroy authored and Sunil Mohan Adapa committed 2016-09-02 20:03:24 +05:30
1 parent b69720e0d4
commit 3eb7dd914a
11 files changed
+229 -7

No files matched your search

+11
View File
@@ -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():