diff --git a/plinth/frontpage.py b/plinth/frontpage.py index 741211158..166f87c90 100644 --- a/plinth/frontpage.py +++ b/plinth/frontpage.py @@ -20,8 +20,9 @@ class Shortcut(app.FollowerComponent): _all_shortcuts = {} def __init__(self, component_id, name, short_description=None, icon=None, - url=None, description=None, configure_url=None, clients=None, - login_required=False, allowed_groups=None): + url=None, description=None, manual_page=None, + configure_url=None, clients=None, login_required=False, + allowed_groups=None): """Initialize the frontpage shortcut component for an app. When a user visits this web interface, they are first shown the @@ -48,6 +49,10 @@ class Shortcut(app.FollowerComponent): the shortcut is activated. This must be provided instead of 'url' and must be 'None' if 'url' is provided. + 'manual_page' is the optional name of the page for this app in the user + manual. If provided, a 'Learn more...' link appears in the app page for + this app. + 'configure_url' is the page to which the user may be redirected if they wish to change the settings for the app or one of its services. This is only used when 'url' is 'None'. It is optionally provided along with @@ -78,6 +83,7 @@ class Shortcut(app.FollowerComponent): self.url = url self.icon = icon self.description = description + self.manual_page = manual_page self.configure_url = configure_url self.clients = clients self.login_required = login_required diff --git a/plinth/tests/test_frontpage.py b/plinth/tests/test_frontpage.py index 95f16135d..f09d84569 100644 --- a/plinth/tests/test_frontpage.py +++ b/plinth/tests/test_frontpage.py @@ -30,6 +30,7 @@ def test_shortcut_init_with_arguments(): assert shortcut.url == '?selected=test-component' assert shortcut.icon is None assert shortcut.description is None + assert shortcut.manual_page is None assert shortcut.configure_url is None assert shortcut.clients is None assert not shortcut.login_required @@ -44,13 +45,14 @@ def test_shortcut_init(): shortcut = Shortcut('test-component', name='test-name', short_description='test-short-description', url='test-url', icon='test-icon', - description='test-description', + description='test-description', manual_page='TestPage', configure_url='test-configure-url', clients=clients, login_required=True, allowed_groups=allowed_groups) assert shortcut.short_description == 'test-short-description' assert shortcut.url == 'test-url' assert shortcut.icon == 'test-icon' assert shortcut.description == 'test-description' + assert shortcut.manual_page == 'TestPage' assert shortcut.configure_url == 'test-configure-url' assert shortcut.clients == clients assert shortcut.login_required