зеркало из https://github.com/nextcloud/server.git
Added download size on public sharing
This commit is contained in:
Родитель
988c85d292
Коммит
fad621140b
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче