hide files external in personal settings if it's empty

This commit is contained in:
Robin Appelman 2016-08-09 14:19:15 +02:00 committed by Marius Blüm
parent d2edd38155
commit cc422e556b
2 changed files with 6 additions and 1 deletions

View File

@ -945,6 +945,11 @@ MountConfigListView.prototype = _.extend({
$tr.find('.configuration').text(t('files_external', 'Admin defined'));
}
});
var mainForm = $('#files_external');
if (result.length === 0 && mainForm.attr('data-can-create') === 'false') {
mainForm.hide();
$('a[href="#external-storage"]').parent().hide();
}
onCompletion.resolve();
}
});

View File

@ -87,7 +87,7 @@
}
?>
<form id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled']?'true': 'false'; ?>">
<form data-can-create="<?php echo $canCreateMounts?'true':'false' ?>" id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled']?'true': 'false'; ?>">
<h2><?php p($l->t('External Storage')); ?></h2>
<?php if (isset($_['dependencies']) and ($_['dependencies']<>'') and $canCreateMounts) print_unescaped(''.$_['dependencies'].''); ?>
<table id="externalStorage" class="grid" data-admin='<?php print_unescaped(json_encode($_['visibilityType'] === BackendService::VISIBILITY_ADMIN)); ?>'>