mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
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:
parent
7d2f9549a0
commit
3fe6ea6014
@ -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,
|
||||
|
||||
@ -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():
|
||||
|
||||
@ -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():
|
||||
|
||||
@ -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():
|
||||
|
||||
@ -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():
|
||||
|
||||
@ -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():
|
||||
|
||||
@ -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():
|
||||
|
||||
@ -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):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user