]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix grid toggle button on public page 13514/head
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Fri, 11 Jan 2019 12:37:30 +0000 (13:37 +0100)
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Thu, 21 Feb 2019 08:17:57 +0000 (09:17 +0100)
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
apps/files_sharing/lib/Controller/ShareController.php
apps/files_sharing/templates/public.php

index 7c1a297d354bfd524a42226748c0a6eefe870a26..99685f671d3ec8ccdf65b236a3612006bff76491 100644 (file)
@@ -361,6 +361,7 @@ class ShareController extends AuthPublicShareController {
                        $folder->assign('isPublic', true);
                        $folder->assign('hideFileList', $hideFileList);
                        $folder->assign('publicUploadEnabled', 'no');
+                       // default to list view
                        $folder->assign('showgridview', false);
                        $folder->assign('uploadMaxFilesize', $maxUploadFilesize);
                        $folder->assign('uploadMaxHumanFilesize', \OCP\Util::humanFileSize($maxUploadFilesize));
@@ -372,6 +373,7 @@ class ShareController extends AuthPublicShareController {
                        $shareIsFolder = false;
                }
 
+               // default to list view
                $shareTmpl['showgridview'] = false;
 
                $shareTmpl['hideFileList'] = $hideFileList;
index eccdc49bc318605fbd6e8b177a1de60cc6bd1974..792b4d238045b64ca38fd1ae675221c428f79187 100644 (file)
@@ -46,14 +46,16 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
        </div>
 <?php endif; ?>
 
-<?php if ($_['showgridview'] && empty($_['dir']) === false) { ?>
-       <input type="checkbox" class="hidden-visually" id="showgridview"
-               <?php if($_['showgridview']) { ?>checked="checked" <?php } ?>/>
-       <label id="view-toggle" for="showgridview" class="button <?php p($_['showgridview'] ? 'icon-toggle-filelist' : 'icon-toggle-pictures') ?>"
-               title="<?php p($l->t('Toggle grid view'))?>"></label>
-<?php } ?>
-
 <?php if (!isset($_['hideFileList']) || (isset($_['hideFileList']) && $_['hideFileList'] === false)) { ?>
+       <!-- ONLY if this is a folder, we show the grid toggle button -->
+       <?php if (empty($_['dir']) === false) { ?>
+               <input type="checkbox" class="hidden-visually" id="showgridview"
+                       <?php if($_['showgridview']) { ?>checked="checked" <?php } ?>/>
+               <label id="view-toggle" for="showgridview" class="button <?php p($_['showgridview'] ? 'icon-toggle-filelist' : 'icon-toggle-pictures') ?>"
+                       title="<?php p($l->t('Toggle grid view'))?>"></label>
+       <?php } ?>
+       
+       <!-- files listing -->
        <div id="files-public-content">
                <div id="preview">
                        <?php if (isset($_['folder'])): ?>