diff --git a/plinth/frontpage.py b/plinth/frontpage.py index 2999ee9d6..29fc06fa1 100644 --- a/plinth/frontpage.py +++ b/plinth/frontpage.py @@ -46,6 +46,7 @@ def add_shortcut(shortcut_id, label, login_required=False, 'login_required': login_required, 'details': details, 'configure_url': configure_url, + 'hidden': False } @@ -65,3 +66,12 @@ def remove_shortcut(shortcut_id): shortcuts = {shortcut_id: shortcut for shortcut_id, shortcut in shortcuts.items() if not match(shortcut)} + + +def hide_shortcut(shortcut_id): + """ + Makes the shortcut hidden + """ + global shortcuts + if shortcut_id in shortcuts.keys(): + shortcuts[shortcut_id]['hidden'] = True diff --git a/plinth/templates/index.html b/plinth/templates/index.html index 232fc7092..66b3cda2c 100644 --- a/plinth/templates/index.html +++ b/plinth/templates/index.html @@ -27,7 +27,7 @@ {% if shortcuts %} {% for shortcut in shortcuts %} - {% if user.is_authenticated or shortcut.login_required is False %} + {% if shortcut.hidden is False and user.is_authenticated or shortcut.login_required is False %}