mirror of
https://github.com/torproject/community.git
synced 2024-11-23 09:49:49 +00:00
Merge branch 'menu-dropdown' into 'main'
Move main menu to dropdown See merge request tpo/web/community!374
This commit is contained in:
commit
362382aaa3
@ -203,3 +203,6 @@ img.story-portrait {
|
||||
}
|
||||
}
|
||||
|
||||
.nav_dropdown {
|
||||
box-shadow: none !important;
|
||||
}
|
@ -1,22 +1,25 @@
|
||||
<div class="container-fluid border-bottom border-light bg-white sticky-top">
|
||||
<div class="row flex-xl-nowrap {{ bag('alternatives', this.alt, 'order') }}">
|
||||
<div class="row col-12 justify-content-center">
|
||||
<ul class="nav">
|
||||
{% set menubag = 'pagenav' %}
|
||||
{% for id, item in bag(menubag).items() %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="dropdown show">
|
||||
{% set menubag = 'pagenav' %}
|
||||
|
||||
<a class="btn btn-outline-primary dropdown-toggle nav_dropdown" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
{% for id, item in bag(menubag).items() %}
|
||||
{% set abs_path = item.path %}
|
||||
<li{% if this.is_child_of(abs_path) %} class="nav-item active border-active" {% else %} class="nav-item" {% endif %}>
|
||||
{% set elm = site.get(item.path) %}
|
||||
{% if this.is_child_of(abs_path) %} {{ _(item.label) }}{% else %} {% endif %}
|
||||
{% endfor %}
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
|
||||
{% for id, item in bag(menubag).items() %}
|
||||
{% set abs_path = item.path %}
|
||||
{% set elm = site.get(item.path) %}
|
||||
{% if elm %}
|
||||
<a class="nav-link" href="{{ elm.path|url }}">{{ _(item.label) }}
|
||||
{% endif %}
|
||||
{% if this.is_child_of(abs_path) %}
|
||||
<span class="sr-only">(current)</span>
|
||||
{% endif %}
|
||||
|
||||
<a{% if this.is_child_of(abs_path) %} class="dropdown-item active" {% else %} class="dropdown-item" {% endif %}
|
||||
href="{{ elm.path|url }}">{{ _(item.label) }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user