diff options
-rw-r--r-- | apps/files_sharing/lib/controllers/sharecontroller.php | 1 | ||||
-rw-r--r-- | apps/files_sharing/templates/public.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/tests/controller/sharecontroller.php | 3 |
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); |