templates/base.html.twig line 1

Open in your IDE?
  1. {#
  2.    This is the base template used as the application layout which contains the
  3.    common elements and decorates all the other templates.
  4.    See https://symfony.com/doc/current/templates.html#template-inheritance-and-layouts
  5. #}
  6. <!DOCTYPE html>
  7. <html lang="{{ app.request.locale }}">
  8.     <head>
  9.         <meta charset="UTF-8" />
  10.         <meta name="viewport" content="width=device-width, initial-scale=1"/>
  11.         <title>{% block title %}M.I.L. application{% endblock %}</title>
  12.         <link rel="alternate" type="application/rss+xml" title="{{ 'rss.title'|trans }}" href="{{ path('blog_rss') }}">
  13.         {#
  14.             Those two blocks defines frontend entrypoint for CSS and JavaScript assets
  15.             See https://symfony.com/doc/current/frontend.html
  16.         #}
  17.         {% block stylesheets %}
  18.             {{ encore_entry_link_tags('app') }}
  19.         {% endblock %}
  20.         {% block javascripts %}
  21.             {{ encore_entry_script_tags('app') }}
  22.         {% endblock %}
  23.         <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
  24.     </head>
  25.     <body id="{% block body_id %}{% endblock %}">
  26.         {% block header %}
  27.             <header>
  28.                 <div class="navbar navbar-default navbar-static-top" role="navigation">
  29.                     <div class="container">
  30.                         <div class="navbar-header col-md-3 col-lg-2">
  31.                             <a class="navbar-brand" href="{{ path('homepage') }}">
  32.                                 M.I.L.
  33.                             </a>
  34.                             <button type="button" class="navbar-toggle"
  35.                                     data-toggle="collapse"
  36.                                     data-target=".navbar-collapse">
  37.                                 <span class="sr-only">{{ 'menu.toggle_nav'|trans }}</span>
  38.                                 <span class="icon-bar"></span>
  39.                                 <span class="icon-bar"></span>
  40.                                 <span class="icon-bar"></span>
  41.                             </button>
  42.                         </div>
  43.                         <div class="navbar-collapse collapse">
  44.                             <ul class="nav navbar-nav navbar-right">
  45.                                 {% block header_navigation_links %}
  46.                                     <li>
  47.                                         <a href="{{ path('blog_index') }}">
  48.                                             <i class="fa fa-home" aria-hidden="true"></i> {{ 'menu.homepage'|trans }}
  49.                                         </a>
  50.                                     </li>
  51.                                     {% if is_granted('ROLE_ADMIN') %}
  52.                                         <li>
  53.                                             <a href="{{ path('admin_post_index') }}">
  54.                                                 <i class="fa fa-lock" aria-hidden="true"></i> {{ 'menu.admin'|trans }}
  55.                                             </a>
  56.                                         </li>
  57.                                     {% endif %}
  58.                                 {% endblock %}
  59.                                 {% if app.user %}
  60.                                     <li class="dropdown">
  61.                                         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" id="user">
  62.                                             <i class="fa fa-user" aria-hidden="true"></i>
  63.                                             <span class="caret"></span>
  64.                                             <span class="sr-only">{{ app.user.fullname }}</span>
  65.                                         </a>
  66.                                         <ul class="dropdown-menu user" role="menu" aria-labelledby="user">
  67.                                             <li>
  68.                                                 <a href="{{ path('user_edit') }}">
  69.                                                     <i class="fa fa-edit" aria-hidden="true"></i> {{ 'menu.user'|trans }}
  70.                                                 </a>
  71.                                             </li>
  72.                                             <li class="divider"></li>
  73.                                             <li>
  74.                                                 <a href="{{ path('security_logout') }}">
  75.                                                     <i class="fa fa-sign-out" aria-hidden="true"></i> {{ 'menu.logout'|trans }}
  76.                                                 </a>
  77.                                             </li>
  78.                                         </ul>
  79.                                     </li>
  80.                                 {% endif %}
  81.                                 <li class="dropdown">
  82.                                     <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" id="locales">
  83.                                         <i class="fa fa-globe" aria-hidden="true"></i>
  84.                                         <span class="caret"></span>
  85.                                         <span class="sr-only">{{ 'menu.choose_language'|trans }}</span>
  86.                                     </a>
  87.                                     <ul class="dropdown-menu locales" role="menu" aria-labelledby="locales">
  88.                                         {% for locale in locales() %}
  89.                                             <li {% if app.request.locale == locale.code %}aria-checked="true" class="active"{% else %}aria-checked="false"{% endif %} role="menuitem"><a href="{{ path(app.request.get('_route', 'blog_index'), app.request.get('_route_params', [])|merge({_locale: locale.code})) }}">{{ locale.name|capitalize }} <small>{{ locale.code[0:2] }}</small></a></li>
  90.                                         {% endfor %}
  91.                                     </ul>
  92.                                 </li>
  93.                             </ul>
  94.                         </div>
  95.                     </div>
  96.                 </div>
  97.             </header>
  98.         {% endblock %}
  99.         <div class="container body-container">
  100.             {% block body %}
  101.                 <div class="row">
  102.                     <div id="main" class="col-sm-9">
  103.                         {{ include('default/_flash_messages.html.twig') }}
  104.                         {% block main %}{% endblock %}
  105.                     </div>
  106.                     <div id="sidebar" class="col-sm-3">
  107.                         {% block sidebar %}
  108.                             {{ render_esi(controller('Symfony\\Bundle\\FrameworkBundle\\Controller\\TemplateController::templateAction', {
  109.                                 'template': 'blog/about.html.twig',
  110.                                 'sharedAge': 600,
  111.                                 '_locale': app.request.locale
  112.                             })) }}
  113.                         {% endblock %}
  114.                     </div>
  115.                 </div>
  116.             {% endblock %}
  117.         </div>
  118.         {% block footer %}
  119.             <footer>
  120.                 <div class="container">
  121.                     <div class="row">
  122.                         <div id="footer-copyright" class="col-md-6">
  123.                             <p>&copy; {{ 'now'|date('Y') }} - The Symfony Project</p>
  124.                             <p>{{ 'mit_license'|trans }}</p>
  125.                         </div>
  126.                         <div id="footer-resources" class="col-md-6">
  127.                             <p>
  128.                                 <a href="https://twitter.com/symfony" title="Symfony Twitter">
  129.                                     <i class="fa fa-twitter" aria-hidden="true"></i>
  130.                                 </a>
  131.                                 <a href="https://www.facebook.com/SensioLabs" title="SensioLabs Facebook">
  132.                                     <i class="fa fa-facebook" aria-hidden="true"></i>
  133.                                 </a>
  134.                                 <a href="https://symfony.com/blog/" title="Symfony Blog">
  135.                                     <i class="fa fa-rss" aria-hidden="true"></i>
  136.                                 </a>
  137.                             </p>
  138.                         </div>
  139.                     </div>
  140.                 </div>
  141.             </footer>
  142.         {% endblock %}
  143.         {# it's not mandatory to set the timezone in localizeddate(). This is done to
  144.            avoid errors when the 'intl' PHP extension is not available and the application
  145.            is forced to use the limited "intl polyfill", which only supports UTC and GMT #}
  146.         <!-- Page rendered on {{ 'now'|format_datetime('long', 'long', '', 'UTC') }} -->
  147.     </body>
  148. </html>