diff --git a/plinth/modules/upgrades/__init__.py b/plinth/modules/upgrades/__init__.py index 2e5110a16..795b88e1b 100644 --- a/plinth/modules/upgrades/__init__.py +++ b/plinth/modules/upgrades/__init__.py @@ -21,14 +21,32 @@ Plinth module for upgrades from django.utils.translation import ugettext_lazy as _ +from plinth import actions from plinth import cfg +version = 1 + +is_essential = 1 + depends = ['system'] +title = _('Software Upgrades') + +description = [ + _('Upgrades install the latest software and security updates. When ' + 'automatic upgrades are enabled, upgrades are automatically run every ' + 'night. You don\'t normally need to start the upgrade process.') +] + def init(): """Initialize the module.""" menu = cfg.main_menu.get('system:index') - menu.add_urlname(_('Software Upgrades'), 'glyphicon-refresh', - 'upgrades:index', 21) + menu.add_urlname(title, 'glyphicon-refresh', 'upgrades:index', 21) + + +def setup(helper, old_version=None): + """Install and configure the module.""" + helper.install(['unattended-upgrades']) + helper.call('post', actions.superuser_run, 'upgrades', ['enable-auto']) diff --git a/plinth/modules/upgrades/templates/upgrades.html b/plinth/modules/upgrades/templates/upgrades.html index 15b0167b2..4cc47be98 100644 --- a/plinth/modules/upgrades/templates/upgrades.html +++ b/plinth/modules/upgrades/templates/upgrades.html @@ -1,4 +1,4 @@ -{% extends 'base.html' %} +{% extends 'app.html' %} {% comment %} # # This file is part of Plinth. @@ -29,17 +29,7 @@ {% endblock %} -{% block content %} - -
- {% blocktrans trimmed %} - Upgrades install the latest software and security updates. When automatic - upgrades are enabled, upgrades are automatically run every night. You - don't normally need to start the upgrade process. - {% endblocktrans %} -
+{% block configuration %}{% blocktrans trimmed %} diff --git a/plinth/modules/upgrades/templates/upgrades_configure.html b/plinth/modules/upgrades/templates/upgrades_configure.html index 1ee94ec32..4a4e1c3fe 100644 --- a/plinth/modules/upgrades/templates/upgrades_configure.html +++ b/plinth/modules/upgrades/templates/upgrades_configure.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "app.html" %} {% comment %} # # This file is part of Plinth. @@ -21,9 +21,7 @@ {% load bootstrap %} {% load i18n %} -{% block content %} - -