Website/app/frontend/templates/components/BurgerMenu/Index.html.twig

72 lines
2.1 KiB
Twig
Raw Normal View History

2024-07-20 06:38:12 +00:00
{% set logged_in = true %}
2024-07-14 19:53:28 +00:00
<button
id="burger-menu__button-open"
type="button"
data-drawer-target="burger-menu"
data-drawer-show="burger-menu"
data-drawer-placement="right"
aria-controls="burger-menu"
>
2024-07-20 06:38:12 +00:00
<twig:ux:icon name="ph:list" />
2024-07-14 19:53:28 +00:00
</button>
<div
id="burger-menu"
class="transition-transform translate-x-full"
tabindex="-1"
>
<button
type="button"
id="burger-menu__button-close"
data-drawer-hide="burger-menu"
aria-controls="burger-menu"
>
2024-07-20 06:38:12 +00:00
<twig:ux:icon name="ph:x" />
2024-07-14 19:53:28 +00:00
</button>
<div id="burger-menu__user-section">
<div id="burger-menu__user-picture-wrapper">
2024-07-20 06:38:12 +00:00
<twig:ux:icon name="ph:user-circle-fill" />
2024-07-14 19:53:28 +00:00
</div>
{% if logged_in %}
<span id="burger-menu__user-name">Username</span>
<span id="burger-menu__user-email">username@email.com</span>
<div id="burger-menu__user-actions">
2024-07-20 06:38:12 +00:00
{{ _self.user_action('Profile', 'user-fill') }}
{{ _self.user_action('Settings', 'gear-fill') }}
{{ _self.user_action('Logout', 'sign-out') }}
2024-07-14 19:53:28 +00:00
</div>
{% else %}
<span id="burger-menu__user-info">not logged in</span>
{% endif %}
</div>
{% if not logged_in %}
<hr/>
<a id="burger-menu__login">
<span>Login with Euphcloud</span>
</a>
{% endif %}
<hr/>
<nav id="burger-menu__nav">
<ul id="burger-menu__nav-list">
2024-07-20 06:38:12 +00:00
{{ _self.nav_item('Test1', '#test1', 'list') }}
{{ _self.nav_item('Test2', '#test2', 'list') }}
{{ _self.nav_item('Test3', '#test3', 'list') }}
2024-07-14 19:53:28 +00:00
</ul>
</nav>
</div>
{% macro user_action(name, icon) %}
<button>
2024-07-20 06:38:12 +00:00
<twig:ux:icon name="ph:{{ icon }}" />
2024-07-14 19:53:28 +00:00
<span>{{ name }}</span>
</button>
{% endmacro %}
{% macro nav_item(name, href, icon) %}
<li id="burger-menu__nav-item">
<a id="burger-menu__nav-link" href="{{ href }}">
2024-07-20 06:38:12 +00:00
<twig:ux:icon name="ph:{{ icon }}" />
2024-07-14 19:53:28 +00:00
<span class="flex-1">{{ name }}</span>
</a>
</li>
{% endmacro %}