This repository has been archived on 2023-12-29. You can view files and clone it, but cannot push or open issues or pull requests.
dogstats/web/templates/menu.html

55 lines
2.7 KiB
HTML
Raw Permalink Normal View History

2023-10-23 13:05:16 +02:00
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="/home" hx-push-url="/home" hx-get="/home" hx-target="#main">
<img src="/imgs/dogstats-50.png" alt="Logo" width="50" height="50" class="d-inline-block align-text-top">
Dogstats
2023-10-22 09:57:29 +02:00
</a>
2023-10-23 13:05:16 +02:00
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
2023-10-22 09:57:29 +02:00
2023-10-23 13:05:16 +02:00
<?php foreach(getMenu() as $item) : ?>
<li <?php if (count($item['submenu'])) : ?>
<li class="nav-item dropdown">
2023-10-23 13:59:26 +02:00
<a class="nav-link dropdown-toggle <?= $item['menu_classes'] ?>" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="<?= $item['image'] ?>"></i>
2023-10-23 13:05:16 +02:00
<?= $item['text']?>
</a>
<ul class="dropdown-menu">
<?php foreach($item['submenu'] as $sub) : ?>
2023-10-23 14:36:28 +02:00
<?php if($sub['text']=='divider') : ?>
<li><hr class="dropdown-divider"></li>
<?php else : ?>
<li>
<a href="<?= $sub['action'] ?>" hx-push-url="<?= $sub['action'] ?>" hx-get="<?= $sub['action'] ?>" hx-target="#main" class="dropdown-item <?= $sub['classes']?:'' ?>">
<?php if($sub['icon']) : ?>
<i class="<?= $sub['icon'] ?>"></i>
<?php endif; ?>
2023-10-22 09:57:29 +02:00
2023-10-23 14:36:28 +02:00
<?= $sub['text'] ?>
</a>
</li>
<?php endif; ?>
2023-10-23 13:05:16 +02:00
<?php endforeach; ?>
</ul>
</li>
<?php else : ?>
<li class="nav-item">
2023-10-23 13:59:26 +02:00
<a class="nav-link <?= $item['menu_classes'] ?>" aria-current="page" href="/<?= $item['url'] ?>" hx-push-url="/<?= $item['url'] ?>" hx-get="/<?= $item['url'] ?>" hx-target="#main">
2023-10-23 13:05:16 +02:00
<i class="<?= $item['image'] ?>"></i>
<?= $item['text'] ?>
</a>
</li>
<?php endif; ?>
</li>
<?php endforeach; ?>
2023-10-22 01:46:22 +02:00
2023-10-23 13:05:16 +02:00
</div>
2023-10-22 01:46:22 +02:00
</div>
2023-10-23 13:05:16 +02:00
</nav>