]> Raphaël G. Git Repositories - airbundle/blob - Resources/views/base.html.twig
Merge body in base template
[airbundle] / Resources / views / base.html.twig
1 <!DOCTYPE html>
2 <html{% if locale is defined and locale %} lang="{{ locale }}"{% endif %}>
3 <head{% if facebook is defined and facebook %} prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#"{% endif %}>
4 {% block meta %}<meta charset="UTF-8">{% endblock %}
5 <title>{% block title %}{{ [title.page, title.section, title.site]|filter(v => v)|join(' - ') }}{% endblock %}</title>
6 {# block title %}{{ [site.title, section, title]|filter(v => v)|join(' - ') }}{% endblock #}
7 {#<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">#}
8 {% block stylesheet %}
9 <meta name="viewport" content="width=device-width, initial-scale=1" />
10 {% if description is defined and description %}
11 <meta name="description" content="{{ description }}" />
12 {% endif %}
13 {% if keywords is defined and keywords %}
14 <meta name="keywords" content="{{ keywords|join(', ') }}" />
15 {% endif %}
16 {% if icon is defined and icon %}
17 <link rel="shortcut icon" type="image/x-icon" href="{{ asset(icon.ico) }}" />
18 <link rel="icon" type="image/svg+xml" href="{{ asset(icon.svg) }}" />
19 {% for size, icon in icon.png %}
20 {# Apple #}
21 {% if size in [120, 152, 167, 180] %}
22 {% if size == 180 %}
23 <link rel="apple-touch-icon" href="{{ asset(icon) }}" />
24 {% endif %}
25 <link rel="apple-touch-icon" sizes="{{ size }}x{{ size }}" href="{{ asset(icon) }}" />
26 {# Windows #}
27 {% elseif size in [70, 150, 310] %}
28 <meta name="msapplication-square{{ size }}x{{ size }}logo" content="{{ asset(icon) }}" />
29 {# Others #}
30 {% else %}
31 <link rel="icon" type="image/png" sizes="{{ size }}x{{ size }}" href="{{ asset(icon) }}" />
32 {% endif %}
33 {% endfor %}
34 {% endif %}
35 {# stylesheet '//fonts.googleapis.com/css?family=Irish+Grover' '//fonts.googleapis.com/css?family=La+Belle+Aurore' '@RapsysAirBundle/Resources/public/css/{reset,screen}.css' #}
36 {% stopwatch 'stylesheet' %}
37 {% stylesheet '@rapsys_air_bundle/css/{reset,droidsans,lemon,notoemoji,screen}.css' %}
38 <link rel="stylesheet" type="text/css" href="{{ asset_url }}?20221024100144" />
39 {% endstylesheet %}
40 {% endstopwatch %}
41 {% if canonical is defined and canonical %}
42 <link rel="canonical" href="{{ canonical }}"{% if locale is defined and locale %} hreflang="{{ locale }}"{% endif %} />
43 {% endif %}
44 {% if alternates is defined and alternates %}
45 {% for lang, alternate in alternates %}
46 <link rel="alternate" href="{{ alternate.absolute }}" hreflang="{{ lang }}" />
47 {% endfor %}
48 {% endif %}
49 {% if facebook is defined and facebook %}
50 {% for property, contents in facebook %}
51 {% if contents is iterable %}
52 {% for content in contents %}
53 <meta property="{{ property }}" content="{{ content }}" />
54 {% endfor %}
55 {% else %}
56 <meta property="{{ property }}" content="{{ contents }}" />
57 {% endif %}
58 {% endfor %}
59 {% endif %}
60 {% endblock %}
61 </head>
62 <body>
63 {% block body %}
64 {% block header %}
65 <header id="header">
66 <div>
67 {% if logo is defined and logo %}
68 {% block header_title %}<a id="logo" href="{{ root }}" title="{{ title.site }}"><img src="{{ asset(logo.svg) }}?20221024100144" srcset="{{ asset(logo.png) }}?20221024100144 200w, {{ asset(logo.svg) }}?20221024100144 400w" sizes="(min-width:400px) 400px, 200px" alt="{{ title.site }}" width="100" height="45" /><span>{{ title.site }}</span></a>{% endblock %}
69 {% endif %}
70 <h1 id="title"><a href="{{ canonical }}">{{ title.page }}</a></h1>
71 </div>
72 {% block header_nav %}
73 <nav id="nav">
74 {#<h2>{% trans %}Navigation{% endtrans %}</h2>#}
75 <a href="{{ path('rapsys_air') }}" rel="home">{% trans %}Home{% endtrans %}</a>
76 <a href="{{ path('rapsys_air_contact') }}" rel="contact">{% trans %}Contact{% endtrans %}</a>
77 <a href="{{ path('rapsys_air_frequently_asked_questions') }}">{% trans %}Frequently asked questions{% endtrans %}</a>
78 {% if is_granted('ROLE_ADMIN') %}
79 <a href="{{ path('rapsys_air_user') }}">{% trans %}Users{% endtrans %}</a>
80 {% endif %}
81 {% if is_granted('ROLE_GUEST') %}
82 <a href="{{ path('rapsys_air_organizer_regulation') }}">{% trans %}Organizer regulation{% endtrans %}</a>
83 {% endif %}
84 {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
85 <a href="{{ path('rapsys_user_edit', {mail: app.user.mail|short, hash: app.user.mail|short|hash}) }}">{% trans %}My account{% endtrans %}</a>
86 <a href="{{ path('rapsys_user_logout') }}">{% trans %}Logout{% endtrans %}</a>
87 {% else %}
88 <a href="{{ path('rapsys_user_login') }}">{% trans %}Login{% endtrans %}</a>
89 <a href="{{ path('rapsys_user_register') }}">{% trans %}Register{% endtrans %}</a>
90 {% endif %}
91 </nav>
92 {% endblock %}
93 {#
94 {% block site_subtitle %}{% endblock %}
95 {% block site_tagline %}
96 {% if tags is defined and tags %}
97 <ul>
98 {% for id, tag in tags %}
99 <li><h2><a href="#{{id}}">{{tag}}</a></h2></li>
100 {% endfor %}
101 </ul>
102 {% endif %}
103 {% endblock %}
104 #}
105 </header>
106 {% endblock %}
107 {% block message %}
108 {# pass an array argument to get the messages of those types (['warning', 'error']) #}
109 {% for label, messages in app.flashes %}
110 {% if messages %}
111 <div class="message {{label}}">
112 <ul>
113 {% for message in messages %}
114 <li>{{ message }}</li>
115 {% endfor %}
116 </ul>
117 </div>
118 {% endif %}
119 {% endfor %}
120 {% endblock %}
121 {#
122 {% block sidebar %}<aside id="sidebar"></aside>{% endblock %}
123 #}
124 {% block content %}
125 <article>
126 <header>
127 <h2>{% trans %}Outdoor space reservation system{% endtrans %}</h2>
128 </header>
129 </article>
130 {% endblock %}
131 {% block footer %}
132 <footer id="footer">
133 <a href="{{ path('rapsys_air_about') }}">{% trans %}About{% endtrans %}</a>
134 {% if copy is defined and copy %}
135 <details><summary>{{ copy.long }}</summary><span>{{ copy.short }} <a href="{{ copy.link }}" title="{{ copy.title }}" rel="author">{{ copy.by }}</a></span></details>
136 {% endif %}
137 <a href="{{ path('rapsys_air_terms_of_service') }}">{% trans %}Terms of service{% endtrans %}</a>
138 {% if alternates is defined and alternates %}
139 {% set langs = alternates|keys|filter(v => v|length == 5) %}
140 {% if langs|length > 1 %}
141 <ul>
142 {% for lang in langs %}
143 <li><a href="{{ alternates[lang].relative }}" hreflang="{{ lang|replace({'_': '-'}) }}" title="{{ alternates[lang].title }}">{{ alternates[lang].translated }}</a></li>
144 {% endfor %}
145 </ul>
146 {% else %}
147 {% set lang = langs|first %}
148 <a href="{{ alternates[lang].relative }}" hreflang="{{ lang|replace({'_': '-'}) }}" title="{{ alternates[lang].title }}">{{ alternates[lang].translated }}</a>
149 {% endif %}
150 {% else %}
151 <span>&nbsp;</span>
152 {% endif %}
153 </footer>
154 {% endblock %}
155 {% endblock %}
156 {% block javascript %}
157 {% stopwatch 'javascript' %}
158 {#{% javascript '@RapsysAir/js/*.js' %}
159 <script type="text/javascript" src="{{ asset_url }}"></script>
160 {% endjavascript %}#}
161 {% endstopwatch %}
162 {% endblock %}
163 </body>
164 </html>