feat: adopt E&P corporate design in admin
This commit is contained in:
1 parent
55378b2bbc
commit
c660bd68de
36 files changed
+866
-544
No files matched your search
@@ -1,49 +1,50 @@
|
||||
{#
|
||||
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.
|
||||
#}
|
||||
{% extends 'base_admin.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="max-w-screen-2xl mx-auto px-4 lg:px-8 lg:grid lg:grid-cols-4 gap-8 py-8">
|
||||
<div class="lg:col-span-4 flex items-center justify-between pb-4 lg:pb-0">
|
||||
<a href="{{ path(app.user ? 'app_admin_dashboard' : 'app_login') }}">
|
||||
<img class="h-8 w-auto" src="{{ asset('build/images/logo_ep.svg') }}" alt="My E&P Admin">
|
||||
</a>
|
||||
{% if app.user %}
|
||||
<div class="flex items-center space-x-4">
|
||||
<button type="button"
|
||||
class="lg:hidden"
|
||||
{{ stimulus_controller('mobilenav', [], [], { 'mobilenav': '#mobilenav' }) }}
|
||||
{{ stimulus_action('mobilenav', 'trigger', null, { 'mode': 'open' }) }}>
|
||||
{{ icon('menu', 'w-8 h-8 text-gray-700') }}
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="hidden lg:block sticky top-0 h-screen">
|
||||
{% if app.user %}
|
||||
{{ knp_menu_render(knp_menu_get('admin_main')) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="lg:col-span-3">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
<div id="mobilenav"
|
||||
class="fixed z-50 top-0 left-0 inset-0 pr-16 bg-black/70 -translate-x-full"
|
||||
{{ stimulus_controller('mobilenav', [], { 'closed': '-translate-x-full' }, { 'mobilenav': '#mobilenav' }) }}
|
||||
>
|
||||
<div class="h-screen w-full bg-white">
|
||||
<div class="flex justify-between p-8">
|
||||
<img src="{{ asset('build/images/logo_ep.svg') }}" alt="" class="block w-auto h-8">
|
||||
<button type="button"
|
||||
{{ stimulus_action('mobilenav', 'trigger', null, { 'mode': 'close' }) }}>
|
||||
{{ icon('close', 'w-8 h-8') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="w-full h-full p-8 pt-0 overflow-y-auto">
|
||||
<div {{ stimulus_controller('drawer') }}>
|
||||
{% embed 'admin/_partials/_header.html.twig' with {
|
||||
app_name: 'MyE&P Admin',
|
||||
home_path: path(app.user ? 'app_admin_dashboard' : 'app_login'),
|
||||
header_width: 'mx-auto max-w-screen-2xl px-4 lg:px-8',
|
||||
} %}
|
||||
{% block header_end %}
|
||||
{% if app.user %}
|
||||
{{ knp_menu_render(knp_menu_get('admin_main')) }}
|
||||
<span class="hidden self-center text-muted sm:inline">{{ app.user.userIdentifier }}</span>
|
||||
<button type="button" class="btn-tool self-center lg:hidden" aria-haspopup="dialog"
|
||||
{{ stimulus_action('drawer', 'open') }}>Menü</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
|
||||
<div class="mx-auto max-w-screen-2xl gap-8 px-4 py-8 lg:grid lg:grid-cols-[14.5rem_minmax(0,1fr)] lg:px-8">
|
||||
<nav aria-label="Hauptmenü" class="hidden lg:block">
|
||||
{% if app.user %}
|
||||
{{ knp_menu_render('admin_main') }}
|
||||
{% endif %}
|
||||
</nav>
|
||||
<main id="content" tabindex="-1" class="min-w-0 outline-none">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
</div>
|
||||
|
||||
{% if app.user %}
|
||||
<dialog class="drawer" aria-label="Hauptmenü" {{ stimulus_target('drawer', 'dialog') }}
|
||||
{{ stimulus_action('drawer', 'closeOnBackdrop', 'click') }}>
|
||||
{# fills the dialog, so only clicks beside the drawer reach the dialog element itself #}
|
||||
<div class="flex h-full flex-col">
|
||||
<div class="flex items-center justify-between p-4">
|
||||
<img src="{{ asset('build/images/ep-logo.svg') }}" alt="" class="h-9 w-auto">
|
||||
<button type="button" class="btn-tool" {{ stimulus_action('drawer', 'close') }}>Schließen</button>
|
||||
</div>
|
||||
<nav class="flex-1 overflow-y-auto px-4 pb-8">
|
||||
{{ knp_menu_render('admin_main') }}
|
||||
</nav>
|
||||
</div>
|
||||
</dialog>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% include '_partials/_flashes_admin.html.twig' %}
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user