From 2e55ce089954bdab483cb1564a4b00b79b705346 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Thu, 13 Jan 2022 18:59:33 +0100 Subject: [PATCH 1/2] Improve layout for the public download page This centers the content inside the pages, while also not hardcoded the size of the footer. Signed-off-by: Carl Schwan --- apps/files_sharing/templates/public.php | 2 +- core/css/public.scss | 31 +++++++++++++++++-------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 832e8a00b1a..33dd6ecd189 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -87,7 +87,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
- () +  ()
diff --git a/core/css/public.scss b/core/css/public.scss index b171dd4970d..31e48f3c7cc 100644 --- a/core/css/public.scss +++ b/core/css/public.scss @@ -1,8 +1,25 @@ -$footer-height: 65px; - #body-public { - .header-right { + min-height: 100vh; + display: flex; + flex-direction: column; + + #content { + flex-grow: 2; + min-height: initial; + /** Center the shared content inside the page */ + &.app-files_sharing { + justify-content: center; + align-items: center; + #app-content { + min-height: inherit; + padding-left: 1rem; + padding-right: 1rem; + } + } + } + + .header-right { #header-primary-action a { color: var(--color-primary-text); } @@ -35,12 +52,6 @@ $footer-height: 65px; } } - #content { - // 100% - footer - min-height: calc(100% - #{$footer-height}); - - } - /** don't apply content header padding on the base layout */ &.layout-base #content { padding-top: 0; @@ -72,8 +83,8 @@ $footer-height: 65px; display: flex; align-items: center; justify-content: center; - height: $footer-height; flex-direction: column; + padding: 0.5rem; p { text-align: center; color: var(--color-text-lighter); From 46c0ceb59c0d42d575fb36e7e982452e946505be Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Thu, 13 Jan 2022 19:29:21 +0100 Subject: [PATCH 2/2] Add non-breaking space in the file size Signed-off-by: Carl Schwan --- apps/files_sharing/lib/Controller/ShareController.php | 2 +- apps/files_sharing/templates/public.php | 4 ++-- .../tests/Controller/ShareControllerTest.php | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index 614dae7ffba..b4a332d7419 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -385,7 +385,7 @@ class ShareController extends AuthPublicShareController { $shareTmpl['protected'] = $share->getPassword() !== null ? 'true' : 'false'; $shareTmpl['dir'] = ''; $shareTmpl['nonHumanFileSize'] = $shareNode->getSize(); - $shareTmpl['fileSize'] = \OCP\Util::humanFileSize($shareNode->getSize()); + $shareTmpl['fileSize'] = str_replace(' ', ' ', \OCP\Util::humanFileSize($shareNode->getSize())); $shareTmpl['hideDownload'] = $share->getHideDownload(); $hideFileList = false; diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 33dd6ecd189..677f015ce81 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -75,7 +75,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);