From e0ab2902d60b327f8e2baee4a23b73b34563fc45 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Sun, 28 Oct 2018 14:58:21 +0100 Subject: [PATCH] Moves the terms of service into a dialog Signed-off-by: Michael Weimann --- apps/files_sharing/css/mobile.scss | 3 --- apps/files_sharing/css/public.scss | 9 ++++----- apps/files_sharing/js/public.js | 16 +++++++++++++++- apps/files_sharing/templates/public.php | 19 +++++++++++++------ 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/apps/files_sharing/css/mobile.scss b/apps/files_sharing/css/mobile.scss index 3d2f5c7ac7e..2ac11ebcf08 100644 --- a/apps/files_sharing/css/mobile.scss +++ b/apps/files_sharing/css/mobile.scss @@ -50,8 +50,6 @@ table td.filename .nametext { padding-right: 14px; background-position: center; } - - .disclaimer, .note { padding: 0 20px; } @@ -59,5 +57,4 @@ table td.filename .nametext { #emptycontent { margin-top: 10vh; } - } diff --git a/apps/files_sharing/css/public.scss b/apps/files_sharing/css/public.scss index 713d2968e8f..835c7f1e9e8 100644 --- a/apps/files_sharing/css/public.scss +++ b/apps/files_sharing/css/public.scss @@ -93,12 +93,7 @@ thead { } #emptycontent { - &.has-disclaimer, &.has-note { - margin-top: 10vh; - } - - &.has-disclaimer.has-note { margin-top: 5vh; } } @@ -192,6 +187,10 @@ thead { } } +#show-terms-dialog { + cursor: pointer; +} + // hide the primary on public share on mobile @media only screen and (max-width: 768px) { #body-public { diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 2bd550a3b5c..c7169b3ce12 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -89,7 +89,7 @@ OCA.Sharing.PublicApp = { displayName: t('files', 'Delete'), iconClass: 'icon-delete', } - ] + ] } ); this.files = OCA.Files.Files; @@ -297,10 +297,24 @@ OCA.Sharing.PublicApp = { } }); + self._bindShowTermsAction(); + // legacy window.FileList = this.fileList; }, + /** + * Binds the click action for the "terms of service" action. + * Shows an OC info dialog on click. + * + * @private + */ + _bindShowTermsAction: function() { + $('#show-terms-dialog').on('click', function() { + OC.dialogs.info($('#disclaimerText').val(), t('files_sharing', 'Terms of service')); + }); + }, + _showTextPreview: function (data, previewHeight) { var textDiv = $('
').addClass('text-preview'); textDiv.text(data); diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index cc83f963ee2..4d4d96bbdcc 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -21,6 +21,7 @@ + getIniWrapper()->getBytes('upload_max_filesize'); $post_max_size = OC::$server->getIniWrapper()->getBytes('post_max_size'); @@ -84,15 +85,13 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
+ class="has-note">

t('Upload files to %s', [$_['shareOwner']])) ?>

- -

- +

t('Note')); ?>

@@ -101,8 +100,16 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size); t('Select or drop files')) ?> -
    -
+ + +
+ t('By uploading files, you agree to the %s.', [ + '' . $l->t('terms of service') . '' + ]); + ?> +
+