From 6b7f04b63e2cff58e8db8300257038da5e53bf59 Mon Sep 17 00:00:00 2001 From: juliandescottes Date: Tue, 1 Aug 2017 22:39:27 +0200 Subject: [PATCH] browse backups dialog: add styling for empty session list --- src/css/dialogs-browse-backups.css | 15 +++++++++++++++ .../dialogs/backups/steps/SelectSession.js | 2 +- .../dialogs/backups/steps/SessionDetails.js | 5 ++++- src/templates/dialogs/browse-backups.html | 8 ++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/css/dialogs-browse-backups.css b/src/css/dialogs-browse-backups.css index f846ec9..ae66f5b 100644 --- a/src/css/dialogs-browse-backups.css +++ b/src/css/dialogs-browse-backups.css @@ -56,6 +56,21 @@ height: 90px; } +.browse-backups .session-list-empty, +.browse-backups .snapshot-list-empty { + position: absolute; + left: 50%; + width: 200px; + margin-top: 100px; + margin-left: -130px; + padding: 30px; + + font-size: 16px; + text-align: center; + border: 1px solid; + color: #bbb; +} + .browse-backups .session-item { transition: all 500ms; } diff --git a/src/js/controller/dialogs/backups/steps/SelectSession.js b/src/js/controller/dialogs/backups/steps/SelectSession.js index 97ad554..a66f178 100644 --- a/src/js/controller/dialogs/backups/steps/SelectSession.js +++ b/src/js/controller/dialogs/backups/steps/SelectSession.js @@ -39,7 +39,7 @@ pskl.app.backupService.list().then(function (sessions) { var html = ''; if (sessions.length === 0) { - html = 'No session found ...'; + html = pskl.utils.Template.get('session-list-empty'); } else { var sessionItemTemplate = pskl.utils.Template.get('session-list-item'); var html = ''; diff --git a/src/js/controller/dialogs/backups/steps/SessionDetails.js b/src/js/controller/dialogs/backups/steps/SessionDetails.js index cadc5ae..d84f7d7 100644 --- a/src/js/controller/dialogs/backups/steps/SessionDetails.js +++ b/src/js/controller/dialogs/backups/steps/SessionDetails.js @@ -26,7 +26,10 @@ pskl.app.backupService.getSnapshotsBySessionId(sessionId).then(function (snapshots) { var html = ''; if (snapshots.length === 0) { - html = 'No snapshot found...'; + // This should normally never happen, all sessions have at least one snapshot and snapshots + // can not be individually deleted. + console.warn('Could not retrieve snapshots for a session'); + html = pskl.utils.Template.get('snapshot-list-empty'); } else { var sessionItemTemplate = pskl.utils.Template.get('snapshot-list-item'); var html = ''; diff --git a/src/templates/dialogs/browse-backups.html b/src/templates/dialogs/browse-backups.html index 8c37e80..06455fa 100644 --- a/src/templates/dialogs/browse-backups.html +++ b/src/templates/dialogs/browse-backups.html @@ -27,6 +27,10 @@ + + + +