feat: adopt ep-design 1.4.0 in admin

This commit is contained in:
fromme committed 2026-11-13 14:48:37 +01:00
1 parent 21b00e3bd6
commit fd3d88209c
4 files changed
+20 -10

No files matched your search

+3 -3
View File
@@ -1,9 +1,9 @@
import { Controller } from '@hotwired/stimulus' import { Controller } from '@hotwired/stimulus'
/* /*
* The sidebar as a drawer on small screens: a modal <dialog> (target "dialog"), so focus stays inside * The navigation (sidebar or header tabs) as a drawer on small screens: a modal <dialog> (target
* and Escape closes it. A click on the dimmed page beside it closes it too, and so does widening the * "dialog"), so focus stays inside and Escape closes it. A click on the dimmed page beside it closes it
* window until the sidebar shows (lg). * too, and so does widening the window until the navigation shows (lg).
*/ */
export default class extends Controller { export default class extends Controller {
static targets = ['dialog'] static targets = ['dialog']
+2 -2
View File
@@ -1,7 +1,7 @@
/* The admin in the E&P corporate design; shares nothing with app.css, so the frontend stays as it is */ /* 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 "tailwindcss" source(none);
@import "toastify-js/src/toastify.css"; @import "toastify-js/src/toastify.css" layer(base);
@import "tippy.js/dist/tippy.css"; @import "tippy.js/dist/tippy.css" layer(base);
@import "./ep-design.css"; @import "./ep-design.css";
@import "./_admin.css"; @import "./_admin.css";
+4 -2
View File
@@ -5,7 +5,9 @@
* Status colours (green, red, amber) always come with text, never alone. * Status colours (green, red, amber) always come with text, never alone.
* *
* Import after Tailwind: @import "tailwindcss"; @import "./ep-design.css"; @plugin "@tailwindcss/forms"; * 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 <link>), its
* colours and gradient beat these layered styles whatever their specificity.
*/ */
/* /*
@@ -245,7 +247,7 @@
@apply -rotate-135; @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 { dialog.drawer {
@apply m-0 h-dvh max-h-none w-80 max-w-[calc(100vw-4rem)] bg-page p-0; @apply m-0 h-dvh max-h-none w-80 max-w-[calc(100vw-4rem)] bg-page p-0;
} }
+11 -3
View File
@@ -1,6 +1,7 @@
{# {#
The admin in the sidebar layout of the E&P corporate design: the KnpMenu menu `admin_main` in a 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' %} {% extends 'base_admin.html.twig' %}
@@ -13,9 +14,12 @@
} %} } %}
{% block header_end %} {% block header_end %}
{% if app.user %} {% if app.user %}
<span class="hidden self-center text-muted sm:inline">{{ app.user.userIdentifier }}</span> <span class="hidden lg:block self-center text-muted">{{ app.user.userIdentifier }}</span>
<button type="button" class="btn-tool self-center lg:hidden" aria-haspopup="dialog" <button type="button" class="btn-tool self-center lg:hidden" aria-haspopup="dialog"
{{ stimulus_action('drawer', 'open') }}>Menü</button> {{ stimulus_action('drawer', 'open') }}>
{{ include('_partials/_icon.html.twig', {icon: 'menu', class: 'h-4 w-4'}) }}
Menü
</button>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% endembed %} {% endembed %}
@@ -43,6 +47,10 @@
<nav class="flex-1 overflow-y-auto px-4 pb-8"> <nav class="flex-1 overflow-y-auto px-4 pb-8">
{{ knp_menu_render('admin_main') }} {{ knp_menu_render('admin_main') }}
</nav> </nav>
{# the user as in the header from lg up; logout is an entry of admin_main #}
<div class="border-t border-line px-6 py-4">
<p class="text-muted">{{ app.user.userIdentifier }}</p>
</div>
</div> </div>
</dialog> </dialog>
{% endif %} {% endif %}