diff --git a/plinth/modules/backups/urls.py b/plinth/modules/backups/urls.py index fc9cdad03..4aace50db 100644 --- a/plinth/modules/backups/urls.py +++ b/plinth/modules/backups/urls.py @@ -5,14 +5,14 @@ URLs for the backups module. from django.urls import re_path -from .views import (AddRemoteRepositoryView, AddRepositoryView, +from .views import (AddRemoteRepositoryView, AddRepositoryView, BackupsView, CreateArchiveView, DeleteArchiveView, DownloadArchiveView, - IndexView, RemoveRepositoryView, RestoreArchiveView, + RemoveRepositoryView, RestoreArchiveView, RestoreFromUploadView, ScheduleView, UploadArchiveView, VerifySshHostkeyView, mount_repository, umount_repository) urlpatterns = [ - re_path(r'^sys/backups/$', IndexView.as_view(), name='index'), + re_path(r'^sys/backups/$', BackupsView.as_view(), name='index'), re_path(r'^sys/backups/(?P[^/]+)/schedule/$', ScheduleView.as_view(), name='schedule'), re_path(r'^sys/backups/create/$', CreateArchiveView.as_view(), diff --git a/plinth/modules/backups/views.py b/plinth/modules/backups/views.py index 4cb7fbfc0..79b3cef19 100644 --- a/plinth/modules/backups/views.py +++ b/plinth/modules/backups/views.py @@ -20,9 +20,9 @@ from django.utils.translation import gettext as _ from django.utils.translation import gettext_lazy from django.views.generic import FormView, TemplateView, View -from plinth import app as app_module from plinth.errors import PlinthError from plinth.modules import backups, storage +from plinth.views import AppView from . import (SESSION_PATH_VARIABLE, api, forms, get_known_hosts_path, is_ssh_hostkey_verified) @@ -34,14 +34,15 @@ logger = logging.getLogger(__name__) @method_decorator(delete_tmp_backup_file, name='dispatch') -class IndexView(TemplateView): +class BackupsView(AppView): """View to show list of archives.""" + + app_id = 'backups' template_name = 'backups.html' def get_context_data(self, **kwargs): """Return additional context for rendering the template.""" context = super().get_context_data(**kwargs) - context['app_info'] = app_module.App.get('backups').info context['repositories'] = [ repository.get_view_content() for repository in get_repositories() ]