From 75bc011fe7765cf2e64121e4f7008faec50eea86 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 17 Mar 2020 23:15:06 -0700 Subject: [PATCH] toolbar: Factor out the clients buttons into a separate template - So that it can be reused in frontpage. Tests performed: - Go to an app like Gitweb. Both launch web client button and clients apps button should be visible. Similarly, Deluge should only show launch button. Infinoted should only show clients button. - Go to an app like Gitweb where launch web client button is available. Enabling the app should enable the launch web client button and disabling the app should disable the launch web client button. Signed-off-by: Sunil Mohan Adapa Reviewed-by: Veiko Aasa --- plinth/templates/clients-button.html | 29 ++++++++++++++++++++++++++++ plinth/templates/toolbar.html | 26 +------------------------ 2 files changed, 30 insertions(+), 25 deletions(-) create mode 100644 plinth/templates/clients-button.html diff --git a/plinth/templates/clients-button.html b/plinth/templates/clients-button.html new file mode 100644 index 000000000..674777dfd --- /dev/null +++ b/plinth/templates/clients-button.html @@ -0,0 +1,29 @@ +{% comment %} +# SPDX-License-Identifier: AGPL-3.0-or-later +{% endcomment %} + +{% load i18n %} +{% load plinth_extras %} + +{% if clients %} + {% with client_platforms=clients|clients_get_platforms %} + {% if client_platforms.web|length == 1 %} + + {% trans "Launch web client" %} + + + {% endif %} + + {% if client_platforms.web|length > 1 or client_platforms.other %} + + {% endif %} + {% endwith %} +{% endif %} diff --git a/plinth/templates/toolbar.html b/plinth/templates/toolbar.html index a55281b0b..b082e1885 100644 --- a/plinth/templates/toolbar.html +++ b/plinth/templates/toolbar.html @@ -2,38 +2,14 @@ # SPDX-License-Identifier: AGPL-3.0-or-later {% endcomment %} -{% load bootstrap %} {% load i18n %} -{% load plinth_extras %} -{% load static %} {% block toolbar %}