summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorVincent Cloutier <vincent1cloutier@gmail.com>2014-10-15 20:59:07 -0400
committerLukas Reschke <lukas@owncloud.com>2014-11-14 16:26:59 +0100
commitfad621140b3fd94c12ddd3b13b37d4c56c5276ff (patch)
tree4176eb03371d9a7f337afe722002d9a7a82cef7b /apps/files_sharing
parent988c85d2922a03346389e3656dc71dfee514e645 (diff)
downloadnextcloud-server-fad621140b3fd94c12ddd3b13b37d4c56c5276ff.tar.gz
nextcloud-server-fad621140b3fd94c12ddd3b13b37d4c56c5276ff.zip
Added download size on public sharing
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/controllers/sharecontroller.php1
-rw-r--r--apps/files_sharing/templates/public.php2
-rw-r--r--apps/files_sharing/tests/controller/sharecontroller.php3
3 files changed, 4 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/controllers/sharecontroller.php b/apps/files_sharing/lib/controllers/sharecontroller.php
index ec99b93826f..a3d5b6d44a0 100644
--- a/apps/files_sharing/lib/controllers/sharecontroller.php
+++ b/apps/files_sharing/lib/controllers/sharecontroller.php
@@ -173,6 +173,7 @@ class ShareController extends Controller {
$shareTmpl['server2serversharing'] = Helper::isOutgoingServer2serverShareEnabled();
$shareTmpl['protected'] = isset($linkItem['share_with']) ? 'true' : 'false';
$shareTmpl['dir'] = $dir;
+ $shareTmpl['fileSize'] = \OCP\Util::humanFileSize(\OC\Files\Filesystem::filesize($file));
// Show file list
if (Filesystem::is_dir($originalSharePath)) {
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index 6b875d3c2b7..57c8707e962 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -87,7 +87,7 @@ $previewSupported = OC\Preview::isMimeSupported($_['mimetype']) ? 'true' : 'fals
<div class="directDownload">
<a href="<?php p($_['downloadURL']); ?>" id="download" class="button">
<img class="svg" alt="" src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"/>
- <?php p($l->t('Download %s', array($_['filename'])))?>
+ <?php p($l->t('Download %s', array($_['filename'])))?> (<?php p($_['fileSize']) ?>)
</a>
</div>
<div class="directLink">
diff --git a/apps/files_sharing/tests/controller/sharecontroller.php b/apps/files_sharing/tests/controller/sharecontroller.php
index 357184ba692..8dcb2475564 100644
--- a/apps/files_sharing/tests/controller/sharecontroller.php
+++ b/apps/files_sharing/tests/controller/sharecontroller.php
@@ -154,7 +154,8 @@ class ShareControllerTest extends \PHPUnit_Framework_TestCase {
'server2serversharing' => true,
'protected' => 'true',
'dir' => '/',
- 'downloadURL' => null
+ 'downloadURL' => null,
+ 'fileSize' => '33 B'
);
$expectedResponse = new TemplateResponse($this->container['AppName'], 'public', $sharedTmplParams, 'base');
$this->assertEquals($expectedResponse, $response);