]> git.agnieray.net Git - galette.git/blob - galette/templates/default/elements/navigation/public_pages.html.twig
f704602ebf4e2222454ed44caab207478f9d31cc
[galette.git] / galette / templates / default / elements / navigation / public_pages.html.twig
1 {% if sign_in is defined and sign_in == true %}
2 {% import "macros.twig" as menus_macros %}
3
4 {% set public_menus = callstatic('\\Galette\\Core\\Galette', 'getPublicMenus') %}
5 {% for public_menu in public_menus %}
6 {% for public_item in public_menu.items %}
7 {{ menus_macros.renderMenuItem(public_item.label, public_item.title, public_item.route, public_item.icon ?? null, null, tips_position) }}
8 {% endfor %}
9 {% endfor %}
10
11 {% set public_items = [] %}
12 <div class="{% if sign_in_side is defined and sign_in_side is not empty %}right {% endif %}item">
13 {% if preferences.pref_bool_selfsubscribe == true and not is_current_url("subscribe") %}
14 {% set public_items = public_items|merge([{
15 'label': _T("Subscribe"),
16 'title': _T("Subscribe"),
17 'route': {'name': 'subscribe'},
18 'icon': 'add user',
19 'class': 'ui basic button'
20 }]) %}
21 {% endif %}
22 {% if not is_current_url("login") %}
23 {% set public_items = public_items|merge([{
24 'label': _T("Login"),
25 'title': _T("Login"),
26 'route': {'name': 'slash'},
27 'icon': 'sign in alt',
28 'class': 'ui primary button'
29 }]) %}
30 {% endif %}
31
32 {% for public_item in public_items %}
33 {{ menus_macros.renderMenuItem(public_item.label, public_item.title, public_item.route, public_item.icon, public_item.class, tips_position) }}
34 {% endfor %}
35 </div>
36 {% endif %}