Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weimann <mail@michael-weimann.eu>2018-10-28 16:58:21 +0300
committerMorris Jobke <hey@morrisjobke.de>2018-11-07 12:19:19 +0300
commite0ab2902d60b327f8e2baee4a23b73b34563fc45 (patch)
tree1fa5b342483ffe80c4fc34b590f1f5ad74f3069e /apps/files_sharing
parent95a19bdfdd154b2e785f0de15910795dac4a839a (diff)
Moves the terms of service into a dialog
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/css/mobile.scss3
-rw-r--r--apps/files_sharing/css/public.scss9
-rw-r--r--apps/files_sharing/js/public.js16
-rw-r--r--apps/files_sharing/templates/public.php19
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 = $('<div/>').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 @@
<input type="hidden" name="previewSupported" value="<?php p($_['previewSupported'] ? 'true' : 'false'); ?>" id="previewSupported">
<input type="hidden" name="mimetypeIcon" value="<?php p(\OC::$server->getMimeTypeDetector()->mimeTypeIcon($_['mimetype'])); ?>" id="mimetypeIcon">
<input type="hidden" name="hideDownload" value="<?php p($_['hideDownload'] ? 'true' : 'false'); ?>" id="hideDownload">
+<input type="hidden" id="disclaimerText" value="<?php p($_['disclaimer']) ?>">
<?php
$upload_max_filesize = OC::$server->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);
<div id="public-upload">
<div
id="emptycontent"
- class="<?php if (!empty($_['disclaimer'])) { ?>has-disclaimer<?php } ?> <?php if (!empty($_['note'])) { ?>has-note<?php } ?>">
+ class="<?php if (!empty($_['note'])) { ?>has-note<?php } ?>">
<div id="displayavatar"><div class="avatardiv"></div></div>
<h2><?php p($l->t('Upload files to %s', [$_['shareOwner']])) ?></h2>
<p><span class="icon-folder"></span> <?php p($_['filename']) ?></p>
- <?php if (!empty($_['disclaimer'])) { ?>
- <p class="disclaimer"><?php p($_['disclaimer']); ?></p>
- <?php } ?>
<?php if (empty($_['note']) === false) { ?>
+ <h3><?php p($l->t('Note')); ?></h3>
<p class="note"><?php p($_['note']); ?></p>
<?php } ?>
@@ -101,8 +100,16 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
<a href="#" class="button icon-upload"><?php p($l->t('Select or drop files')) ?></a>
<div id="drop-upload-progress-indicator" style="padding-top: 25px;" class="hidden"><?php p($l->t('Uploading files…')) ?></div>
<div id="drop-upload-done-indicator" style="padding-top: 25px;" class="hidden"><?php p($l->t('Uploaded files:')) ?></div>
- <ul>
- </ul>
+
+ <?php if (!empty($_['disclaimer'])) { ?>
+ <div>
+ <?php
+ echo $l->t('By uploading files, you agree to the %s.', [
+ '<b id="show-terms-dialog">' . $l->t('terms of service') . '</b>'
+ ]);
+ ?>
+ </div>
+ <?php } ?>
</div>
</div>
<?php } ?>