From 9ccb3279dd09b7042ab07c936a4c04127282476f Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 9 Dec 2013 13:32:28 +0100 Subject: [PATCH] Added app navigation for files app - Added links to trashbin and shared dir - Moved "WebDAV" settings block to the app nav's settings section - Added sidebar support in trashbin app as well --- apps/files/css/files.css | 7 +++++++ apps/files/index.php | 6 ++++++ apps/files/js/files.js | 8 ++++++++ apps/files/templates/appnavigation.php | 19 +++++++++++++++++++ apps/files/templates/index.php | 7 ++++--- apps/files_trashbin/index.php | 5 +++++ apps/files_trashbin/templates/index.php | 3 +++ core/css/apps.css | 3 +++ core/css/styles.css | 5 ----- settings/templates/personal.php | 6 ------ 10 files changed, 55 insertions(+), 14 deletions(-) create mode 100644 apps/files/templates/appnavigation.php diff --git a/apps/files/css/files.css b/apps/files/css/files.css index 3dc5ef5a39..db23f54f21 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -84,6 +84,9 @@ } #filestable tbody tr { background-color:#fff; height:51px; } +.app-files #controls { + left: 300px; +} #filestable tbody tr:hover, tbody tr:active { background-color: rgb(240,240,240); } @@ -431,3 +434,7 @@ table.dragshadow td.size { .mask.transparent{ opacity: 0; } + +.app-files #app-settings input { + width: 90%; +} diff --git a/apps/files/index.php b/apps/files/index.php index a4e9a93850..df207582dd 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -89,6 +89,11 @@ if ($trashEnabled) { $trashEmpty = \OCA\Files_Trashbin\Trashbin::isEmpty($user); } +$nav = new OCP\Template('files', 'appnavigation', ''); + +$nav->assign('trash', $trashEnabled); +$nav->assign('trashEmpty', $trashEmpty); + OCP\Util::addscript('files', 'fileactions'); OCP\Util::addscript('files', 'files'); OCP\Util::addscript('files', 'keyboardshortcuts'); @@ -110,5 +115,6 @@ $tmpl->assign("mailNotificationEnabled", $config->getAppValue('core', 'shareapi_ $tmpl->assign("allowShareWithLink", $config->getAppValue('core', 'shareapi_allow_links', 'yes')); $tmpl->assign("encryptionInitStatus", $encryptionInitStatus); $tmpl->assign('disableSharing', false); +$tmpl->assign('appNavigation', $nav); $tmpl->printPage(); diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 6d167851e6..60e20a62e8 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -254,6 +254,14 @@ $(document).ready(function() { } } + $('#app-settings-header').on('click', function() { + var $settings = $('#app-settings'); + $settings.toggleClass('opened'); + if ($settings.hasClass('opened')) { + $settings.find('input').focus(); + } + }); + //scroll to and highlight preselected file if (getURLParameter('scrollto')) { FileList.scrollTo(getURLParameter('scrollto')); diff --git a/apps/files/templates/appnavigation.php b/apps/files/templates/appnavigation.php new file mode 100644 index 0000000000..22987ec637 --- /dev/null +++ b/apps/files/templates/appnavigation.php @@ -0,0 +1,19 @@ +
+ +
+
+ +
+
+

t('WebDAV'));?>

+
+ t('Use this address to access your Files via WebDAV', array(link_to_docs('user-webdav'))));?> +
+
+
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 9c593a9341..9ed294e6b6 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -1,4 +1,6 @@ +printPage(); ?> +
- - /> -
+
+ diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php index 6e6a8a3830..16cd5ecd4c 100644 --- a/apps/files_trashbin/index.php +++ b/apps/files_trashbin/index.php @@ -39,4 +39,9 @@ if ($isIE8 && isset($_GET['dir'])){ $tmpl->assign('dir', $dir); $tmpl->assign('disableSharing', true); +$nav = new OCP\Template('files', 'appnavigation', ''); +$nav->assign('trash', true); + +$tmpl->assign('appNavigation', $nav); + $tmpl->printPage(); diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php index 7c673c317e..02067385d4 100644 --- a/apps/files_trashbin/templates/index.php +++ b/apps/files_trashbin/templates/index.php @@ -1,4 +1,6 @@ +printPage(); ?> +
@@ -44,3 +46,4 @@ +
diff --git a/core/css/apps.css b/core/css/apps.css index a0bb262854..377878467c 100644 --- a/core/css/apps.css +++ b/core/css/apps.css @@ -178,6 +178,9 @@ bottom: 0; border-top: 1px solid #ccc; } +#app-settings.opened #app-settings-content { + display: block; +} #app-settings-header { background-color: #eee; } diff --git a/core/css/styles.css b/core/css/styles.css index d21e6bc690..b99af47ff3 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -302,11 +302,6 @@ input[type="submit"].enabled { border-bottom: 1px solid #e7e7e7; z-index: 50; } -/* account for shift of controls bar due to app navigation */ -#body-user #controls, -#body-settings #controls { - padding-left: 80px; -} #controls .button, #controls button, #controls input[type='submit'], diff --git a/settings/templates/personal.php b/settings/templates/personal.php index afa3f5d700..1d1500743a 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -133,12 +133,6 @@ if($_['passwordChangeSupported']) { -
-

t('WebDAV'));?>

-
- t('Use this address to access your Files via WebDAV', array(link_to_docs('user-webdav'))));?> -
-