diff --git a/plinth/modules/avahi/__init__.py b/plinth/modules/avahi/__init__.py index 84987cdc7..c4c0970bc 100644 --- a/plinth/modules/avahi/__init__.py +++ b/plinth/modules/avahi/__init__.py @@ -24,24 +24,45 @@ from django.utils.translation import ugettext_lazy as _ from plinth import action_utils from plinth import cfg from plinth import service as service_module +from plinth.utils import format_lazy # pylint: disable=C0103 +version = 1 + +is_essential = True + depends = ['system'] +title = _('Service Discovery') + +description = [ + format_lazy( + _('Service discovery allows other devices on the network to ' + 'discover your {{ box_name }} and services running on it. It ' + 'also allows {{ box_name }} to discover other devices and ' + 'services running on your local network. Service discovery is ' + 'not essential and works only on internal networks. It may be ' + 'disabled to improve security especially when connecting to a ' + 'hostile local network.'), box_name=_(cfg.box_name)) +] + service = None def init(): """Intialize the service discovery module.""" menu = cfg.main_menu.get('system:index') - menu.add_urlname(_('Service Discovery'), 'glyphicon-lamp', - 'avahi:index', 950) + menu.add_urlname(title, 'glyphicon-lamp', 'avahi:index', 950) global service # pylint: disable=W0603 service = service_module.Service( - 'avahi', _('Service Discovery'), ['mdns'], - is_external=False, enabled=is_enabled()) + 'avahi', title, ['mdns'], is_external=False, enabled=is_enabled()) + + +def setup(helper, old_version=False): + """Install and configure the module.""" + helper.install(['avahi-daemon']) def is_enabled(): diff --git a/plinth/modules/avahi/templates/avahi.html b/plinth/modules/avahi/templates/avahi.html index c3d1b98d7..193a1ac07 100644 --- a/plinth/modules/avahi/templates/avahi.html +++ b/plinth/modules/avahi/templates/avahi.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "app.html" %} {% comment %} # # This file is part of Plinth. @@ -21,21 +21,7 @@ {% load bootstrap %} {% load i18n %} -{% block content %} - -
- {% blocktrans trimmed %} - Service discovery allows other devices on the network to - discover your {{ box_name }} and services running on it. It - also allows {{ box_name }} to discover other devices and - services running on your local network. Service discovery is - not essential and works only on internal networks. It may be - disabled to improve security especially when connecting to a - hostile local network. - {% endblocktrans %} -
+{% block configuration %}