diff --git a/plinth/modules/datetime/__init__.py b/plinth/modules/datetime/__init__.py index 1ca8f6244..0c200169a 100644 --- a/plinth/modules/datetime/__init__.py +++ b/plinth/modules/datetime/__init__.py @@ -27,21 +27,36 @@ from plinth import cfg from plinth import service as service_module +version = 1 + +is_essential = True + depends = ['system'] +title = _('Date & Time') + +description = [ + _('Network time server is a program that maintians the system time ' + 'in synchronization with servers on the Internet.') +] + service = None def init(): """Intialize the date/time module.""" menu = cfg.main_menu.get('system:index') - menu.add_urlname(_('Date & Time'), 'glyphicon-time', - 'datetime:index', 900) + menu.add_urlname(title, 'glyphicon-time', 'datetime:index', 900) global service service = service_module.Service( - 'ntp', _('Network Time Server'), - is_external=False, enabled=is_enabled()) + 'ntp', title, is_external=False, enabled=is_enabled()) + + +def setup(helper, old_version=None): + """Install and configure the module.""" + helper.install(['ntp']) + helper.call('post', service.notify_enabled, None, True) def is_enabled(): diff --git a/plinth/modules/datetime/templates/datetime.html b/plinth/modules/datetime/templates/datetime.html index bce9499f2..d0a7aa407 100644 --- a/plinth/modules/datetime/templates/datetime.html +++ b/plinth/modules/datetime/templates/datetime.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "app.html" %} {% comment %} # # This file is part of Plinth. @@ -21,16 +21,7 @@ {% load bootstrap %} {% load i18n %} -{% block content %} - -
- {% blocktrans trimmed %} - Network time server is a program that maintians the system time - in synchronization with servers on the Internet. - {% endblocktrans %} -
+{% block configuration %}