diff --git a/CHANGELOG-WIP.md b/CHANGELOG-WIP.md index ba2b26811d7..e8f5caeb423 100644 --- a/CHANGELOG-WIP.md +++ b/CHANGELOG-WIP.md @@ -1,6 +1,8 @@ # Release Notes for Craft CMS 5.0.0 (WIP) ### Content Management +- Improved global sidebar styling. ([#14281](https://github.com/craftcms/cms/pull/14281)) +- The global sidebar is now collapsible. ([#14281](https://github.com/craftcms/cms/pull/14281)) - Redesigned the global breadcrumb bar to include quick links to other areas of the control panel, page context menus, and action menus. ([#13902](https://github.com/craftcms/cms/pull/13902)) - All elements can now have thumbnails, provided by Assets fields. ([#12484](https://github.com/craftcms/cms/discussions/12484), [#12706](https://github.com/craftcms/cms/discussions/12706)) - Element indexes and relational fields now have the option to use card views. ([#6024](https://github.com/craftcms/cms/pull/6024)) diff --git a/CHANGELOG.md b/CHANGELOG.md index 551dae0cd5c..6557c074c9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Improved global sidebar styling. ([#14281](https://github.com/craftcms/cms/pull/14281)) +- The global sidebar is now collapsible. ([#14281](https://github.com/craftcms/cms/pull/14281)) - Added `Craft.ElementEditor::markDeltaNameAsModified()`. - Removed `craft\elements\NestedElementManager::$allowDeletion`. - Fixed a bug where element editor forms could submit duplicate input values. ([#14276](https://github.com/craftcms/cms/issues/14276)) diff --git a/src/templates/_components/fieldtypes/Categories/input.twig b/src/templates/_components/fieldtypes/Categories/input.twig index 6dd85eb1846..291653c47e9 100644 --- a/src/templates/_components/fieldtypes/Categories/input.twig +++ b/src/templates/_components/fieldtypes/Categories/input.twig @@ -43,8 +43,8 @@ {% if jsClass is defined %} {% js %} new {{ jsClass }}({ - id: "{{ id | namespaceInputId | e('js') }}", - name: "{{ name | namespaceInputName | e('js') }}", + id: "{{ id|namespaceInputId|e('js') }}", + name: "{{ name|namespaceInputName|e('js') }}", elementType: "{{ elementType|e('js') }}", sources: {{ sources|json_encode|raw }}, criteria: {{ criteria|json_encode|raw }}, diff --git a/src/templates/_includes/disclosuremenu.twig b/src/templates/_includes/disclosuremenu.twig index 8c21cd86cd6..9d246f0b43a 100644 --- a/src/templates/_includes/disclosuremenu.twig +++ b/src/templates/_includes/disclosuremenu.twig @@ -82,7 +82,7 @@ {% if withButton %} {% if html ?? false %} - {{ html | raw }} + {{ html|raw }} {% elseif label ?? false %} {{ label }} {% endif %} @@ -143,7 +143,7 @@ {% if item.heading is defined %} {% tag headingTag with { class: ['h6', 'padded'], - } | merge(item.headingAttributes ??{}, recursive=true) %} + }|merge(item.headingAttributes ??{}, recursive=true) %} {{ item.heading }} {% endtag %} {% endif %} diff --git a/src/templates/_includes/links.twig b/src/templates/_includes/links.twig index 90007f7f9db..bb34c2d43fb 100644 --- a/src/templates/_includes/links.twig +++ b/src/templates/_includes/links.twig @@ -1,6 +1,7 @@ {% macro externalLinkIcon() %} {{ tag('span', { 'data-icon': 'external', + 'data-icon-size': 'puny', 'role': 'img', 'aria-label': 'Opens in a new window'|t('app'), }) }} diff --git a/src/templates/_layouts/base.twig b/src/templates/_layouts/base.twig index dd516b0a007..989dd5a460f 100644 --- a/src/templates/_layouts/base.twig +++ b/src/templates/_layouts/base.twig @@ -12,11 +12,16 @@ requestedSite ? "site--#{requestedSite.handle}", ])|filter -%} +{% set sidebarState = craft.app.request.rawCookies.value('Craft-' ~ craft.app.systemUid ~ ':sidebar') ?? 'expanded' %} {% set bodyAttributes = { class: bodyClass, dir: orientation, + data: { + sidebar: sidebarState + } }|merge(bodyAttributes ?? {}, recursive=true) -%} + {% do view.registerAssetBundle('craft\\web\\assets\\cp\\CpAsset') -%} {% set cpAssetUrl = view.getAssetManager().getPublishedUrl('@app/web/assets/cp/dist', true) -%} diff --git a/src/templates/_layouts/components/global-sidebar.twig b/src/templates/_layouts/components/global-sidebar.twig index 2d6dd5a8939..333113e9c78 100644 --- a/src/templates/_layouts/components/global-sidebar.twig +++ b/src/templates/_layouts/components/global-sidebar.twig @@ -1,107 +1,129 @@ - + + diff --git a/src/templates/_layouts/components/system-info.twig b/src/templates/_layouts/components/system-info.twig new file mode 100644 index 00000000000..fe0495403be --- /dev/null +++ b/src/templates/_layouts/components/system-info.twig @@ -0,0 +1,12 @@ + +
+ {% if hasSystemIcon %} + + {% else %} + {{ iconSvg('c-outline') }} + {% endif %} +
+
+ {{ systemName }} +
+
diff --git a/src/templates/_layouts/cp.twig b/src/templates/_layouts/cp.twig index f284824a1e0..5e35476c0c0 100644 --- a/src/templates/_layouts/cp.twig +++ b/src/templates/_layouts/cp.twig @@ -44,16 +44,16 @@ {# The control panel only supports queue components that implement QueueInterface #} {% set queue = craft.app.queue %} {% js %} - {% if queue is instance of("craft\\queue\\QueueInterface") %} - Craft.cp.setJobInfo({{ queue.getJobInfo(100)|json_encode|raw }}, false); - {% if queue.getHasReservedJobs() %} - Craft.cp.trackJobProgress(true); - {% elseif queue.getHasWaitingJobs() %} - Craft.cp.runQueue(); - {% endif %} - {% else %} - Craft.cp.enableQueue = false; +{% if queue is instance of("craft\\queue\\QueueInterface") %} + Craft.cp.setJobInfo({{ queue.getJobInfo(100)|json_encode|raw }}, false); + {% if queue.getHasReservedJobs() %} + Craft.cp.trackJobProgress(true); + {% elseif queue.getHasWaitingJobs() %} + Craft.cp.runQueue(); {% endif %} +{% else %} + Craft.cp.enableQueue = false; +{% endif %} {% endjs %} {% set hasSystemIcon = CraftEdition == CraftPro and craft.rebrand.isIconUploaded %} @@ -120,9 +120,9 @@ {% set userPhoto = include('_layouts/components/header-photo.twig') %} {% js at head %} - // Remove the hash so the browser doesn't scroll to it - window.LOCATION_HASH = document.location.hash ? decodeURIComponent(document.location.hash.substr(1)) : null; - history.replaceState(undefined, undefined, window.location.href.match(/^[^#]*/)[0]); +// Remove the hash so the browser doesn't scroll to it +window.LOCATION_HASH = document.location.hash ? decodeURIComponent(document.location.hash.substr(1)) : null; +history.replaceState(undefined, undefined, window.location.href.match(/^[^#]*/)[0]); {% endjs %} {% block body %} @@ -140,163 +140,186 @@ {% include '_layouts/components/alerts' %}