fediplan/templates/nav.html.twig

48 lines
2.9 KiB
Twig
Raw Normal View History

2019-08-13 11:22:30 +02:00
{% trans_default_domain 'fediplan' %}
2019-08-08 17:29:59 +02:00
<header>
<!-- Fixed navbar -->
<nav class="navbar navbar-expand-md navbar-light fixed-top bg-light">
2019-08-10 16:04:33 +02:00
<a class="navbar-brand" href="#">FediPlan</a>
2019-08-08 17:29:59 +02:00
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto">
2019-08-10 15:30:54 +02:00
{% if not is_granted('ROLE_USER') %}
2019-08-08 17:29:59 +02:00
<li class="nav-item {% if app.request.attributes.get('_route') == 'index' %} active {% endif %}">
2019-08-13 11:22:30 +02:00
<a class="nav-link" href="{{ path('index') }}">{{ 'common.login'|trans }} <span class="sr-only">(current)</span></a>
2019-08-08 17:29:59 +02:00
</li>
2019-08-10 15:30:54 +02:00
{% endif %}
{% if is_granted('ROLE_USER') %}
2019-08-13 11:24:36 +02:00
<li class="nav-item {% if app.request.attributes.get('_route') == 'schedule' %}active {% endif %}">
2019-08-13 11:22:30 +02:00
<a class="nav-link" href="{{ path('schedule') }}">{{ 'common.schedule'|trans }}</a>
2019-08-08 17:29:59 +02:00
</li>
2019-08-11 18:24:07 +02:00
2019-08-08 17:29:59 +02:00
<li class="nav-item {% if app.request.attributes.get('_route') == 'scheduled' %} active {% endif %}">
2019-08-13 11:22:30 +02:00
<a class="nav-link" href="{{ path('scheduled') }}">{{ 'common.scheduled'|trans }}</a>
2019-08-08 17:29:59 +02:00
</li>
2019-08-11 18:24:07 +02:00
2019-08-08 17:29:59 +02:00
<li class="nav-item">
2019-08-13 11:22:30 +02:00
<a class="nav-link" href="{{ path('logout') }}" tabindex="-1" >{{ 'common.logout'|trans }}</a>
2019-08-08 17:29:59 +02:00
</li>
2019-08-21 10:16:55 +02:00
{% endif %}
<li class="nav-item {% if app.request.attributes.get('_route') == 'about' %} active {% endif %}">
<a class="nav-link" href="{{ path('about') }}" tabindex="-1" >{{ 'common.about'|trans }}</a>
</li>
2019-08-10 15:38:12 +02:00
<li class="nav-item">
2019-08-21 10:16:55 +02:00
<a class="nav-link" href="https://fedilab.app/page/donations/" tabindex="-1" >{{ 'common.support_my_work'|trans }}</a>
2019-08-10 15:38:12 +02:00
</li>
2019-08-21 16:33:04 +02:00
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
{% set flagLink = "img/flags/"~app.request.locale~".svg" %}
<img src="{{ asset(flagLink) }}" alt="language">
</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="{{ path(app.request.attributes.get('_route'), {'_locale':'en' }) }}">English</a>
<a class="dropdown-item" href="{{ path(app.request.attributes.get('_route'), {'_locale':'fr' }) }}">Français</a>
</div>
</li>
2019-08-08 17:29:59 +02:00
</ul>
</div>
</nav>
</header>