From e324aa040ef5ba8a2a9be05b4b54bc23295dd965 Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Sat, 15 Nov 2014 16:57:10 -0500 Subject: [PATCH] Move ejabberd install info to template file. --- plinth/modules/xmpp/templates/xmpp.html | 36 +++++++++++++++++++++++++ plinth/modules/xmpp/xmpp.py | 12 ++------- 2 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 plinth/modules/xmpp/templates/xmpp.html diff --git a/plinth/modules/xmpp/templates/xmpp.html b/plinth/modules/xmpp/templates/xmpp.html new file mode 100644 index 000000000..2ac856837 --- /dev/null +++ b/plinth/modules/xmpp/templates/xmpp.html @@ -0,0 +1,36 @@ +{% extends "base.html" %} +{% comment %} +# +# This file is part of Plinth. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +{% endcomment %} + +{% load bootstrap %} + +{% block main_block %} + +

XMPP Server Accounts and Configuration

+ +{% if not is_installed %} + +

ejabberd is not installed, please install it. ejabberd comes pre-installed + with {{ cfg.box_name }}. On any Debian-based system (such as + {{ cfg.box_name }}) you may install it using the command + 'aptitude install ejabberd'.

+ +{% endif %} + +{% endblock %} diff --git a/plinth/modules/xmpp/xmpp.py b/plinth/modules/xmpp/xmpp.py index 8f1f98cff..d389d699c 100644 --- a/plinth/modules/xmpp/xmpp.py +++ b/plinth/modules/xmpp/xmpp.py @@ -71,23 +71,15 @@ def index(request): 'xmpp', ['get-installed']).strip() == 'installed' - main = "

XMPP Server Accounts and Configuration

" - if not is_installed: - main += """ -

ejabberd is not installed, please install it. ejabberd comes pre-installed -with FreedomBox. On any Debian-based system (such as FreedomBox) you may install -it using the command 'aptitude install ejabberd'

-""" - if is_installed: sidebar_right = render_to_string('menu_block.html', {'menu': SIDE_MENU}, RequestContext(request)) else: sidebar_right = None - return TemplateResponse(request, 'base.html', + return TemplateResponse(request, 'xmpp.html', {'title': _('XMPP Server'), - 'main': main, + 'is_installed': is_installed, 'sidebar_right': sidebar_right})