Fix navbar

This commit is contained in:
itqop 2024-03-18 00:59:39 +03:00
parent ae1731593f
commit 7b18e02c7e
1 changed files with 18 additions and 7 deletions

View File

@ -58,13 +58,24 @@
</button> </button>
<div class="collapse navbar-collapse" id="target-main"> <div class="collapse navbar-collapse" id="target-main">
<ul class="navbar-nav justify-content-center w-100 icms-menu-hovered mx-lg-n2 menu-main"> <ul class="navbar-nav justify-content-center w-100 icms-menu-hovered mx-lg-n2 menu-main">
{% for page in page.get_children %} {% if page.get_children|length > 0 %}
<li class="nav-item"> {% for page in page.get_children %}
<a class="nav-link text-nowrap" href="{{ page.url }}" target="_self"> <li class="nav-item">
{{ page.title|safe }} <a class="nav-link text-nowrap" href="{{ page.url }}" target="_self">
</a> {{ page.title|safe }}
</li> </a>
{% endfor %} </li>
{% endfor %}
{% else %}
{% for page in page.get_parent.get_children %}
<li class="nav-item">
<a class="nav-link text-nowrap" href="{{ page.url }}" target="_self">
{{ page.title|safe }}
</a>
</li>
{% endfor %}
{% endif %}
</ul> </ul>
</div> </div>
</nav> </nav>