diff --git a/plinth/modules/deluge/__init__.py b/plinth/modules/deluge/__init__.py index 40fc0fd40..f5c1b6f37 100644 --- a/plinth/modules/deluge/__init__.py +++ b/plinth/modules/deluge/__init__.py @@ -21,26 +21,46 @@ Plinth module to configure a Deluge web client. from django.utils.translation import ugettext_lazy as _ +from plinth import actions from plinth import action_utils from plinth import cfg from plinth import service as service_module +version = 1 + depends = ['apps'] +title = _('BitTorrent Web Client (Deluge)') + +description = [ + _('Deluge is a BitTorrent client that features a Web UI.'), + + _('When enabled, the Deluge web client will be available from ' + '/deluge path on the web server. The ' + 'default password is \'deluge\', but you should log in and change ' + 'it immediately after enabling this service.') +] + service = None def init(): """Initialize the Deluge module.""" menu = cfg.main_menu.get('apps:index') - menu.add_urlname(_('BitTorrent (Deluge)'), 'glyphicon-magnet', - 'deluge:index', 200) + menu.add_urlname(title, 'glyphicon-magnet', 'deluge:index', 200) global service service = service_module.Service( - 'deluge', _('Deluge BitTorrent'), ['http', 'https'], - is_external=True, enabled=is_enabled()) + 'deluge', title, ['http', 'https'], is_external=True, + enabled=is_enabled()) + + +def setup(helper, old_version=None): + """Install and configure the module.""" + helper.install(['deluged', 'deluge-web']) + helper.call('post', actions.superuser_run, 'deluge', ['enable']) + helper.call('post', service.notify_enabled, None, True) def is_enabled(): diff --git a/plinth/modules/deluge/templates/deluge.html b/plinth/modules/deluge/templates/deluge.html index 51b54c8ef..019c91b64 100644 --- a/plinth/modules/deluge/templates/deluge.html +++ b/plinth/modules/deluge/templates/deluge.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "app.html" %} {% comment %} # # This file is part of Plinth. @@ -21,20 +21,7 @@ {% load bootstrap %} {% load i18n %} -{% block content %} - -
{% trans "Deluge is a BitTorrent client that features a Web UI." %}
- -- {% blocktrans trimmed %} - When enabled, the Deluge web client will be available from - /deluge path on the web server. The - default password is 'deluge', but you should log in and change - it immediately after enabling this service. - {% endblocktrans %} -
+{% block configuration %}