diff --git a/CHANGELOG.md b/CHANGELOG.md index e8b5c0f..ea91ae4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ## [Unreleased] +## 3.1.0 +### Added +* add global custom app sorting for the top menu +### Fixed +* fix admin list/modal look + ## 3.0.1 ### Fixed * Remove the gap between the window's top and menu categories (large menu) diff --git a/appinfo/info.xml b/appinfo/info.xml index b406929..3090118 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -26,7 +26,7 @@ If you like this application and if you want to support the development: * [Donate with liberapay](https://liberapay.com/deblan) * [Leave a comment](https://apps.nextcloud.com/apps/side_menu#comments) ]]> - 3.0.1 + 3.1.0 agpl Simon Vieille SideMenu diff --git a/css/admin.css b/css/admin.css index f32892e..756d7ee 100644 --- a/css/admin.css +++ b/css/admin.css @@ -18,6 +18,8 @@ #side-menu-section input[type="color"] { width: 100px; margin: 10px 0 10px 0; + padding: 0; + border-radius: 0; } #-dropside-menu-section input[type="checkbox"] { @@ -71,14 +73,21 @@ .side-menu-setting-list { margin: 10px 4px 4px 0px; + border: 1px solid var(--color-border-dark); + border-radius: 15px; } .side-menu-setting-list-item { padding: 5px 10px; - border: 1px solid var(--color-border-dark); + border-bottom: 1px solid var(--color-border-dark); max-width: 300px; margin: -1px 0 0 0; cursor: pointer; + line-height: 32px; +} + +.side-menu-setting-list-item:last-child { + border-bottom: 0; } .side-menu-setting-list-drop { @@ -93,8 +102,9 @@ } .side-menu-setting-list-item input { - min-height: auto; - margin-top: -1px; + margin-top: 0; + height: 21px !important; + min-height: auto !important; } #apps-categories-custom-list select { @@ -108,11 +118,22 @@ .side-menu-setting-row { display: table; + margin-bottom: 10px; +} + +.side-menu-setting-row code { + margin-left: 2px; + margin-bottom: 1px; + padding: 3px 10px; + border-radius: 5px; + display: inline-block; + right: 2px; + border: 1px solid var(--color-border-dark); } .side-menu-setting-label { display: table-cell; - width: 400px; + width: 430px; padding-right: 20px; } diff --git a/lib/Controller/JsController.php b/lib/Controller/JsController.php index c873826..2a3231f 100644 --- a/lib/Controller/JsController.php +++ b/lib/Controller/JsController.php @@ -95,6 +95,7 @@ class JsController extends Controller { $topMenuApps = $this->config->getAppValueArray('top-menu-apps', '[]'); $topSideMenuApps = $this->config->getAppValueArray('top-side-menu-apps', '[]'); + $topMenuAppsOrder = $this->config->getAppValueArray('top-menu-apps-order', '[]'); $targetBlankApps = $this->config->getAppValueArray('target-blank-apps', '[]'); $useAvatar = $this->config->getAppValueBool('use-avatar', '0'); $isForced = $this->config->getAppValueBool('force', '0'); @@ -164,6 +165,7 @@ class JsController extends Controller 'avatar' => $avatar, 'top-menu-apps' => $topMenuApps, 'top-side-menu-apps' => $topSideMenuApps, + 'top-menu-apps-order' => $topMenuAppsOrder, 'target-blank-apps' => $targetBlankApps, 'settings' => $settings, 'logo' => $this->themingDefaults->getLogo(), diff --git a/lib/Service/AppRepository.php b/lib/Service/AppRepository.php index 258c5c5..e35f65b 100644 --- a/lib/Service/AppRepository.php +++ b/lib/Service/AppRepository.php @@ -105,4 +105,23 @@ class AppRepository return $visibleApps; } + + public function getTopMenuOrderedApps() + { + $apps = $this->getVisibleApps(); + $orders = $this->config->getAppValueArray('top-menu-apps-order', '[]'); + + usort($apps, function ($a, $b) use ($orders) { + $ak = array_keys($orders, $a['id'])[0] ?? null; + $bk = array_keys($orders, $b['id'])[0] ?? null; + + if ($ak === null || $bk === null) { + return ($a['name'] < $b['name']) ? -1 : 1; + } + + return $ak < $bk ? -1 : 1; + }); + + return $apps; + } } diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index a68d30c..20aa9fd 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -159,9 +159,11 @@ class Admin implements ISettings 'force' => $this->config->getAppValue('force', '0'), 'target-blank-apps' => $this->config->getAppValueArray('target-blank-apps', '[]'), 'top-menu-apps' => $this->config->getAppValueArray('top-menu-apps', '[]'), + 'top-menu-apps-order' => $this->config->getAppValueArray('top-menu-apps-order', '[]'), 'top-side-menu-apps' => $this->config->getAppValueArray('top-side-menu-apps', '[]'), 'default-enabled' => $this->config->getAppValue('default-enabled', '1'), 'apps' => $this->appRepository->getVisibleApps(), + 'top-menu-ordered-apps' => $this->appRepository->getTopMenuOrderedApps(), 'apps-categories-custom' => $this->config->getAppValueArray('apps-categories-custom', '[]'), 'categories-order-type' => $this->config->getAppValue('categories-order-type', 'default'), 'categories-order' => $this->config->getAppValueArray('categories-order', '[]'), diff --git a/src/AdminCategoriesCustom.vue b/src/AdminCategoriesCustom.vue index b02283d..c210fc3 100644 --- a/src/AdminCategoriesCustom.vue +++ b/src/AdminCategoriesCustom.vue @@ -30,7 +30,7 @@ along with this program. If not, see .