diff --git a/assets/controllers/drawer_controller.js b/assets/controllers/drawer_controller.js index 57cc9c29..33ba0e7b 100644 --- a/assets/controllers/drawer_controller.js +++ b/assets/controllers/drawer_controller.js @@ -1,9 +1,9 @@ import { Controller } from '@hotwired/stimulus' /* - * The sidebar as a drawer on small screens: a modal (target "dialog"), so focus stays inside - * and Escape closes it. A click on the dimmed page beside it closes it too, and so does widening the - * window until the sidebar shows (lg). + * The navigation (sidebar or header tabs) as a drawer on small screens: a modal (target + * "dialog"), so focus stays inside and Escape closes it. A click on the dimmed page beside it closes it + * too, and so does widening the window until the navigation shows (lg). */ export default class extends Controller { static targets = ['dialog'] diff --git a/assets/styles/admin.css b/assets/styles/admin.css index 9b2ce85c..294a6631 100644 --- a/assets/styles/admin.css +++ b/assets/styles/admin.css @@ -1,7 +1,7 @@ /* The admin in the E&P corporate design; shares nothing with app.css, so the frontend stays as it is */ @import "tailwindcss" source(none); -@import "toastify-js/src/toastify.css"; -@import "tippy.js/dist/tippy.css"; +@import "toastify-js/src/toastify.css" layer(base); +@import "tippy.js/dist/tippy.css" layer(base); @import "./ep-design.css"; @import "./_admin.css"; diff --git a/assets/styles/ep-design.css b/assets/styles/ep-design.css index 6243a890..e68e3fc0 100644 --- a/assets/styles/ep-design.css +++ b/assets/styles/ep-design.css @@ -5,7 +5,9 @@ * Status colours (green, red, amber) always come with text, never alone. * * Import after Tailwind: @import "tailwindcss"; @import "./ep-design.css"; @plugin "@tailwindcss/forms"; - * The toast styles expect toastify-js (@import "toastify-js/src/toastify.css" before this file). + * The toast styles expect toastify-js, imported into the base layer before this file: + * @import "toastify-js/src/toastify.css" layer(base); unlayered (or through its own ), its + * colours and gradient beat these layered styles whatever their specificity. */ /* @@ -245,7 +247,7 @@ @apply -rotate-135; } - /* the sidebar as a drawer from the left on small screens (drawer_controller.js) */ + /* the navigation (sidebar or header tabs) as a drawer from the left on small screens (drawer_controller.js) */ dialog.drawer { @apply m-0 h-dvh max-h-none w-80 max-w-[calc(100vw-4rem)] bg-page p-0; } diff --git a/templates/layout_admin.html.twig b/templates/layout_admin.html.twig index c0373810..a3fbcb6a 100644 --- a/templates/layout_admin.html.twig +++ b/templates/layout_admin.html.twig @@ -1,6 +1,7 @@ {# The admin in the sidebar layout of the E&P corporate design: the KnpMenu menu `admin_main` in a - left sidebar from lg up, below that in a drawer behind the menu button. + left sidebar from lg up, below that in a drawer behind the menu button. Below lg the user moves into + the drawer too, so the phone header holds only logo, app name and button. #} {% extends 'base_admin.html.twig' %} @@ -13,9 +14,12 @@ } %} {% block header_end %} {% if app.user %} - + + {{ stimulus_action('drawer', 'open') }}> + {{ include('_partials/_icon.html.twig', {icon: 'menu', class: 'h-4 w-4'}) }} + MenĂ¼ + {% endif %} {% endblock %} {% endembed %} @@ -43,6 +47,10 @@ + {# the user as in the header from lg up; logout is an entry of admin_main #} +
+

{{ app.user.userIdentifier }}

+
{% endif %}