Browse Source

Moves the terms of service into a dialog

Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
tags/v15.0.0beta1
Michael Weimann 5 years ago
parent
commit
e0ab2902d6
No account linked to committer's email address

+ 0
- 3
apps/files_sharing/css/mobile.scss View File

@@ -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;
}

}

+ 4
- 5
apps/files_sharing/css/public.scss View File

@@ -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 {

+ 15
- 1
apps/files_sharing/js/public.js View File

@@ -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);

+ 13
- 6
apps/files_sharing/templates/public.php View File

@@ -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 } ?>

Loading…
Cancel
Save