frontpage: Cleanup urls for showing description

In a module, when URL is not avialable for a shortcut, send None instead
of an implementation specific detail on how to show description.  This
allows use to change the implementation of how description is shown
without changes to modules.
This commit is contained in:
Sunil Mohan Adapa 2016-09-02 20:01:25 +05:30
parent 7d2f9549a0
commit 3fe6ea6014
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
8 changed files with 17 additions and 14 deletions

View File

@ -29,6 +29,9 @@ def get_shortcuts():
def add_shortcut(id, label, url, icon, details=None):
"""Add shortcut to front page."""
if not url:
url = '?selected={id}'.format(id=id)
shortcuts[id] = {
'id': id,
'label': label,

View File

@ -74,8 +74,8 @@ def setup(helper, old_version=None):
def add_shortcut():
frontpage.add_shortcut('minetest', title, '?selected=minetest',
'glyphicon-th-large', description)
frontpage.add_shortcut('minetest', title, None, 'glyphicon-th-large',
description)
def enable():

View File

@ -79,8 +79,8 @@ def setup(helper, old_version=None):
def add_shortcut():
frontpage.add_shortcut('mumble', title, '?selected=mumble',
'glyphicon-headphones', description)
frontpage.add_shortcut('mumble', title, None, 'glyphicon-headphones',
description)
def enable():

View File

@ -83,8 +83,8 @@ def setup(helper, old_version=None):
def add_shortcut():
frontpage.add_shortcut('privoxy', title, '?selected=privoxy',
'glyphicon-cloud-upload', description)
frontpage.add_shortcut('privoxy', title, None, 'glyphicon-cloud-upload',
description)
def enable():

View File

@ -87,8 +87,8 @@ def setup(helper, old_version=None):
def add_shortcut():
frontpage.add_shortcut('quassel', title, '?selected=quassel',
'glyphicon-retweet', description)
frontpage.add_shortcut('quassel', title, None, 'glyphicon-retweet',
description)
def enable():

View File

@ -77,8 +77,8 @@ def setup(helper, old_version=None):
def add_shortcut():
frontpage.add_shortcut('radicale', title, '?selected=radicale',
'glyphicon-calendar', description)
frontpage.add_shortcut('radicale', title, None, 'glyphicon-calendar',
description)
def enable():

View File

@ -91,8 +91,8 @@ def setup(helper, old_version=None):
def add_shortcut():
frontpage.add_shortcut('repro', title, '?selected=repro',
'glyphicon-phone-alt', description)
frontpage.add_shortcut('repro', title, None, 'glyphicon-phone-alt',
description)
def enable():

View File

@ -93,8 +93,8 @@ def setup(helper, old_version=None):
def add_shortcut():
frontpage.add_shortcut('jwchat', _('Chat Client (JWChat)'), '/jwchat',
'glyphicon-comment')
frontpage.add_shortcut('xmpp', title, '?selected=xmpp',
'glyphicon-comment', description)
frontpage.add_shortcut('xmpp', title, None, 'glyphicon-comment',
description)
class EjabberdServiceView(ServiceView):