Move ejabberd install info to template file.

This commit is contained in:
James Valleroy 2014-11-15 16:57:10 -05:00 committed by Sunil Mohan Adapa
parent 39e441e2b9
commit e324aa040e
2 changed files with 38 additions and 10 deletions

View File

@ -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 <http://www.gnu.org/licenses/>.
#
{% endcomment %}
{% load bootstrap %}
{% block main_block %}
<p>XMPP Server Accounts and Configuration</p>
{% if not is_installed %}
<p>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'.</p>
{% endif %}
{% endblock %}

View File

@ -71,23 +71,15 @@ def index(request):
'xmpp',
['get-installed']).strip() == 'installed'
main = "<p>XMPP Server Accounts and Configuration</p>"
if not is_installed:
main += """
<p>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'</p>
"""
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})