summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files/css/files.scss7
-rw-r--r--apps/files/js/filelist.js5
-rw-r--r--apps/files/lib/Controller/ViewController.php2
-rw-r--r--apps/files/list.php5
-rw-r--r--apps/files/recentlist.php8
-rw-r--r--apps/files/simplelist.php8
-rw-r--r--apps/files/templates/index.php8
-rw-r--r--apps/files/templates/list.php8
-rw-r--r--apps/files/templates/recentlist.php2
-rw-r--r--apps/files/templates/simplelist.php2
-rw-r--r--apps/files_external/list.php8
-rw-r--r--apps/files_external/templates/list.php2
-rw-r--r--apps/files_sharing/css/public.scss1
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php2
-rw-r--r--apps/files_sharing/list.php8
-rw-r--r--apps/files_sharing/templates/list.php2
-rw-r--r--apps/files_sharing/templates/public.php7
-rw-r--r--apps/files_trashbin/list.php8
-rw-r--r--apps/files_trashbin/templates/index.php2
19 files changed, 78 insertions, 17 deletions
diff --git a/apps/files/css/files.scss b/apps/files/css/files.scss
index d6f9bd6131e..bc99790f500 100644
--- a/apps/files/css/files.scss
+++ b/apps/files/css/files.scss
@@ -55,6 +55,10 @@
position: relative;
width: 100%;
min-width: 250px;
+ // hide table if emptycontent is not hidden
+ #emptycontent:not(.hidden) ~ & {
+ display: none;
+ }
}
/* fit app list view heights */
@@ -982,6 +986,9 @@ table.dragshadow td.size {
margin: 0;
padding: 22px;
opacity: .5;
+ position: fixed;
+ right: 0;
+ z-index: 100;
&:hover,
&:focus,
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 9459a266ce9..b61b4ef8569 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -331,9 +331,10 @@
this.$el.find('thead th .columntitle').click(_.bind(this._onClickHeader, this));
- // Toggle for grid view
- this.$showGridView = $('input#showgridview');
+ // Toggle for grid view, only register once
+ this.$showGridView = $('input#showgridview:not(.registered)');
this.$showGridView.on('change', _.bind(this._onGridviewChange, this));
+ this.$showGridView.addClass('registered');
$('#view-toggle').tooltip({placement: 'bottom', trigger: 'hover'});
this._onResize = _.debounce(_.bind(this._onResize, this), 250);
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php
index d91d3b9db4c..3932b2b0a8e 100644
--- a/apps/files/lib/Controller/ViewController.php
+++ b/apps/files/lib/Controller/ViewController.php
@@ -257,6 +257,8 @@ class ViewController extends Controller {
$params['allowShareWithLink'] = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes');
$params['defaultFileSorting'] = $this->config->getUserValue($user, 'files', 'file_sorting', 'name');
$params['defaultFileSortingDirection'] = $this->config->getUserValue($user, 'files', 'file_sorting_direction', 'asc');
+ $params['showgridview'] = $this->config->getUserValue($user, 'files', 'show_grid', true);
+ $params['isIE'] = \OCP\Util::isIE();
$showHidden = (bool) $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', 'show_hidden', false);
$params['showHiddenFiles'] = $showHidden ? 1 : 0;
$params['fileNotFound'] = $fileNotFound ? 1 : 0;
diff --git a/apps/files/list.php b/apps/files/list.php
index 23b94d9be20..7a5159cf387 100644
--- a/apps/files/list.php
+++ b/apps/files/list.php
@@ -25,14 +25,15 @@ $config = \OC::$server->getConfig();
$userSession = \OC::$server->getUserSession();
// TODO: move this to the generated config.js
$publicUploadEnabled = $config->getAppValue('core', 'shareapi_allow_public_upload', 'yes');
+
$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', true);
$isIE = \OCP\Util::isIE();
// renders the controls and table headers template
$tmpl = new OCP\Template('files', 'list', '');
-$tmpl->assign('publicUploadEnabled', $publicUploadEnabled);
+
// gridview not available for ie
$tmpl->assign('showgridview', $showgridview && !$isIE);
-$tmpl->assign('isIE', $isIE);
+$tmpl->assign('publicUploadEnabled', $publicUploadEnabled);
$tmpl->printPage();
diff --git a/apps/files/recentlist.php b/apps/files/recentlist.php
index 91a9bce06b5..c17f9d598bf 100644
--- a/apps/files/recentlist.php
+++ b/apps/files/recentlist.php
@@ -23,7 +23,15 @@
*/
// Check if we are a user
OCP\User::checkLoggedIn();
+$config = \OC::$server->getConfig();
+$userSession = \OC::$server->getUserSession();
+
+$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', true);
+$isIE = \OCP\Util::isIE();
$tmpl = new OCP\Template('files', 'recentlist', '');
+// gridview not available for ie
+$tmpl->assign('showgridview', $showgridview && !$isIE);
+
$tmpl->printPage();
diff --git a/apps/files/simplelist.php b/apps/files/simplelist.php
index 1d61b397050..9515ec62363 100644
--- a/apps/files/simplelist.php
+++ b/apps/files/simplelist.php
@@ -22,8 +22,16 @@
*/
// TODO: move to handlebars
+$config = \OC::$server->getConfig();
+$userSession = \OC::$server->getUserSession();
+
+$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', true);
+$isIE = \OCP\Util::isIE();
// renders the controls and table headers template
$tmpl = new OCP\Template('files', 'simplelist', '');
+
+// gridview not available for ie
+$tmpl->assign('showgridview', $showgridview && !$isIE);
$tmpl->printPage();
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index b49684643bb..69ad73f1081 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -1,6 +1,14 @@
<?php /** @var $l \OCP\IL10N */ ?>
<?php $_['appNavigation']->printPage(); ?>
<div id="app-content">
+
+ <?php if (!$_['isIE']) { ?>
+ <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 foreach ($_['appContents'] as $content) { ?>
<div id="app-content-<?php p($content['id']) ?>" class="hidden viewcontainer">
<?php print_unescaped($content['content']) ?>
diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php
index 2bc94ca7afb..75dc2bee26f 100644
--- a/apps/files/templates/list.php
+++ b/apps/files/templates/list.php
@@ -24,13 +24,6 @@
<?php endif;?>
<input type="hidden" class="max_human_file_size"
value="(max <?php isset($_['uploadMaxHumanFilesize']) ? p($_['uploadMaxHumanFilesize']) : ''; ?>)">
- <!-- IF NOT IE, SHOW GRIDVIEW -->
- <?php if (!$_['isIE']) { ?>
- <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 } ?>
</div>
<div id="emptycontent" class="hidden">
@@ -44,7 +37,6 @@
<h2><?php p($l->t('No entries found in this folder')); ?></h2>
<p></p>
</div>
-
<table id="filestable" class="list-container <?php p($_['showgridview'] ? 'view-grid' : '') ?>" data-allow-public-upload="<?php p($_['publicUploadEnabled'])?>" data-preview-x="250" data-preview-y="250">
<thead>
<tr>
diff --git a/apps/files/templates/recentlist.php b/apps/files/templates/recentlist.php
index 4c269c20256..360b5c95ee4 100644
--- a/apps/files/templates/recentlist.php
+++ b/apps/files/templates/recentlist.php
@@ -11,7 +11,7 @@
<p></p>
</div>
-<table id="filestable" class="list-container view-grid">
+<table id="filestable" class="list-container <?php p($_['showgridview'] ? 'view-grid' : '') ?>">
<thead>
<tr>
<th id='headerName' class="hidden column-name">
diff --git a/apps/files/templates/simplelist.php b/apps/files/templates/simplelist.php
index a99607ea642..9fd9c49c9c3 100644
--- a/apps/files/templates/simplelist.php
+++ b/apps/files/templates/simplelist.php
@@ -13,7 +13,7 @@
<h2><?php p($l->t('No entries found in this folder')); ?></h2>
<p></p>
</div>
-<table id="filestable" class="list-container view-grid">
+<table id="filestable" class="list-container <?php p($_['showgridview'] ? 'view-grid' : '') ?>">
<thead>
<tr>
<th id='headerName' class="hidden column-name">
diff --git a/apps/files_external/list.php b/apps/files_external/list.php
index 35ad6e60447..a63475e78e6 100644
--- a/apps/files_external/list.php
+++ b/apps/files_external/list.php
@@ -22,9 +22,17 @@
*/
// Check if we are a user
OCP\User::checkLoggedIn();
+$config = \OC::$server->getConfig();
+$userSession = \OC::$server->getUserSession();
+
+$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', true);
+$isIE = \OCP\Util::isIE();
$tmpl = new OCP\Template('files_external', 'list', '');
+// gridview not available for ie
+$tmpl->assign('showgridview', $showgridview && !$isIE);
+
/* Load Status Manager */
\OCP\Util::addStyle('files_external', 'external');
\OCP\Util::addScript('files_external', 'statusmanager');
diff --git a/apps/files_external/templates/list.php b/apps/files_external/templates/list.php
index 20f97dd4c08..04b7159cfe1 100644
--- a/apps/files_external/templates/list.php
+++ b/apps/files_external/templates/list.php
@@ -11,7 +11,7 @@
<input type="hidden" name="dir" value="" id="dir">
-<table id="filestable" class="list-container view-grid">
+<table id="filestable" class="list-container <?php p($_['showgridview'] ? 'view-grid' : '') ?>">
<thead>
<tr>
<th id='headerName' class="hidden column-name">
diff --git a/apps/files_sharing/css/public.scss b/apps/files_sharing/css/public.scss
index 44b7e53d207..d1bdfe9162a 100644
--- a/apps/files_sharing/css/public.scss
+++ b/apps/files_sharing/css/public.scss
@@ -169,6 +169,7 @@ thead {
position: relative;
font-weight: 300;
font-size: 11px;
+ line-height: 11px;
overflow: hidden;
text-overflow: ellipsis;
}
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index 1a92000a5f6..9a8e1298f93 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -367,6 +367,8 @@ class ShareController extends AuthPublicShareController {
$shareTmpl['folder'] = $folder->fetchPage();
}
+ $shareTmpl['showgridview'] = true;
+
$shareTmpl['hideFileList'] = $hideFileList;
$shareTmpl['shareOwner'] = $this->userManager->get($share->getShareOwner())->getDisplayName();
$shareTmpl['downloadURL'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.downloadShare', ['token' => $this->getToken()]);
diff --git a/apps/files_sharing/list.php b/apps/files_sharing/list.php
index d94d5625e8e..590a3a1911e 100644
--- a/apps/files_sharing/list.php
+++ b/apps/files_sharing/list.php
@@ -21,9 +21,17 @@
*/
// Check if we are a user
OCP\User::checkLoggedIn();
+$config = \OC::$server->getConfig();
+$userSession = \OC::$server->getUserSession();
+
+$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', true);
+$isIE = \OCP\Util::isIE();
$tmpl = new OCP\Template('files_sharing', 'list', '');
+// gridview not available for ie
+$tmpl->assign('showgridview', $showgridview && !$isIE);
+
OCP\Util::addScript('files_sharing', 'app');
OCP\Util::addScript('files_sharing', 'sharedfilelist');
diff --git a/apps/files_sharing/templates/list.php b/apps/files_sharing/templates/list.php
index de92037a563..95ba9160a9f 100644
--- a/apps/files_sharing/templates/list.php
+++ b/apps/files_sharing/templates/list.php
@@ -10,7 +10,7 @@
<h2><?php p($l->t('No entries found in this folder')); ?></h2>
</div>
-<table id="filestable" class="list-container view-grid">
+<table id="filestable" class="list-container <?php p($_['showgridview'] ? 'view-grid' : '') ?>">
<thead>
<tr>
<th id='headerName' class="hidden column-name">
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index 4487e63f2de..08e119322e5 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -45,6 +45,13 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
</div>
<?php endif; ?>
+<?php if (!$_['isIE']) { ?>
+ <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)) { ?>
<div id="files-public-content">
<div id="preview">
diff --git a/apps/files_trashbin/list.php b/apps/files_trashbin/list.php
index 77823617831..48ed7b694d0 100644
--- a/apps/files_trashbin/list.php
+++ b/apps/files_trashbin/list.php
@@ -24,8 +24,16 @@
// Check if we are a user
OCP\User::checkLoggedIn();
+$config = \OC::$server->getConfig();
+$userSession = \OC::$server->getUserSession();
+
+$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', true);
+$isIE = \OCP\Util::isIE();
$tmpl = new OCP\Template('files_trashbin', 'index', '');
+
+// gridview not available for ie
+$tmpl->assign('showgridview', $showgridview && !$isIE);
OCP\Util::addStyle('files_trashbin', 'trash');
OCP\Util::addScript('files_trashbin', 'app');
OCP\Util::addScript('files_trashbin', 'filelist');
diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php
index 054ffee6176..e503e364af9 100644
--- a/apps/files_trashbin/templates/index.php
+++ b/apps/files_trashbin/templates/index.php
@@ -18,7 +18,7 @@
<p></p>
</div>
-<table id="filestable" class="list-container view-grid">
+<table id="filestable" class="list-container <?php p($_['showgridview'] ? 'view-grid' : '') ?>">
<thead>
<tr>
<th id="headerSelection" class="hidden column-selection">