Improve navbar dropdown: show on hover, click goes to order list

This commit is contained in:
2025-11-13 16:43:49 +03:00
parent 73816965c5
commit 49ef2aa925

View File

@@ -1,4 +1,10 @@
<!-- navbar.html - Reusable navigation bar component -->
<style>
.navbar .dropdown:hover > .dropdown-menu {
display: block;
margin-top: 0;
}
</style>
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
<div class="container">
<!-- Toggler for mobile view -->
@@ -22,7 +28,7 @@
<a class="nav-link {% if request.resolver_match.namespace == 'products' and 'tag' in request.resolver_match.url_name %}active{% endif %}" href="{% url 'products:tag-list' %}">Теги</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle {% if request.resolver_match.namespace == 'orders' %}active{% endif %}" href="{% url 'orders:order-list' %}" id="ordersDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">Заказы</a>
<a class="nav-link dropdown-toggle {% if request.resolver_match.namespace == 'orders' %}active{% endif %}" href="{% url 'orders:order-list' %}" id="ordersDropdown" role="button" aria-expanded="false" data-bs-toggle="dropdown">Заказы</a>
<ul class="dropdown-menu" aria-labelledby="ordersDropdown">
<li><a class="dropdown-item" href="{% url 'orders:order-list' %}">Список заказов</a></li>
<li><hr class="dropdown-divider"></li>