]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix mind-boggling emptycontent logic
authorkondou <kondou@ts.unde.re>
Mon, 21 Oct 2013 17:49:09 +0000 (19:49 +0200)
committerkondou <kondou@ts.unde.re>
Mon, 21 Oct 2013 17:49:27 +0000 (19:49 +0200)
apps/files/index.php
apps/files/js/filelist.js
apps/files/templates/index.php

index 22240deadcaa6af3586e569abd8a4c88fd61f53e..c2c0ba02a9904456dde19ae03564f8ad5ba3c623 100644 (file)
@@ -119,7 +119,8 @@ if ($needUpgrade) {
        }
 
        $isCreatable = \OC\Files\Filesystem::isCreatable($dir . '/');
-       $emptyContent = (!isset($files) or count($files) > 0 or $ajaxLoad);
+       $fileHeader = (!isset($files) or count($files) > 0);
+       $emptyContent = $isCreatable or $fileHeader or $ajaxLoad;
 
        OCP\Util::addscript('files', 'fileactions');
        OCP\Util::addscript('files', 'files');
@@ -145,6 +146,7 @@ if ($needUpgrade) {
        $tmpl->assign('disableSharing', false);
        $tmpl->assign('ajaxLoad', $ajaxLoad);
        $tmpl->assign('emptyContent', $emptyContent);
+       $tmpl->assign('fileHeader', $fileHeader);
 
        $tmpl->printPage();
 }
index 20930b2dce899e114c66584ed210872ebdc8bb26..17e7fb6440e45cd05c2235d233ebf7269ebcb31c 100644 (file)
@@ -623,7 +623,7 @@ var FileList={
                var $fileList = $('#fileList');
                var permissions = $('#permissions').val();
                var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0;
-               $('#emptycontent').toggleClass('hidden', $fileList.find('tr').length > 0);
+               $('#emptycontent').toggleClass('hidden', !isCreatable || $fileList.find('tr').length > 0);
                $('#filestable th').toggleClass('hidden', $fileList.find('tr').length === 0);
        },
        showMask: function(){
index af9cdffa5a3df689c10714556eb02f21e047e165..c1373c3e9d57588f065d1d68ab8d0aaf056757a8 100644 (file)
        <input type="hidden" name="permissions" value="<?php p($_['permissions']); ?>" id="permissions">
 </div>
 
-<div id="emptycontent" <?php if ($_['emptyContent']):?>class="hidden"<?php endif; ?>><?php p($l->t('Nothing in here. Upload something!'))?></div>
+<div id="emptycontent" <?php if (!$_['emptyContent']):?>class="hidden"<?php endif; ?>><?php p($l->t('Nothing in here. Upload something!'))?></div>
 
 <input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>"></input>
 
 <table id="filestable" data-allow-public-upload="<?php p($_['publicUploadEnabled'])?>" data-preview-x="36" data-preview-y="36">
        <thead>
                <tr>
-                       <th <?php if (!$_['emptyContent']):?>class="hidden"<?php endif; ?> id='headerName'>
+                       <th <?php if (!$_['fileHeader']):?>class="hidden"<?php endif; ?> id='headerName'>
                                <div id="headerName-container">
                                        <input type="checkbox" id="select_all" />
                                        <label for="select_all"></label>
@@ -65,8 +65,8 @@
                                        </span>
                                </div>
                        </th>
-                       <th <?php if (!$_['emptyContent']):?>class="hidden"<?php endif; ?> id="headerSize"><?php p($l->t('Size')); ?></th>
-                       <th <?php if (!$_['emptyContent']):?>class="hidden"<?php endif; ?> id="headerDate">
+                       <th <?php if (!$_['fileHeader']):?>class="hidden"<?php endif; ?> id="headerSize"><?php p($l->t('Size')); ?></th>
+                       <th <?php if (!$_['fileHeader']):?>class="hidden"<?php endif; ?> id="headerDate">
                                <span id="modified"><?php p($l->t( 'Modified' )); ?></span>
                                <?php if ($_['permissions'] & OCP\PERMISSION_DELETE): ?>
 <!--                                   NOTE: Temporary fix to allow unsharing of files in root of Shared folder -->