Added download size on public sharing

This commit is contained in:
Vincent Cloutier 2014-10-15 20:59:07 -04:00 коммит произвёл Lukas Reschke
Родитель 988c85d292
Коммит fad621140b
3 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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