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 %}中文润色{% 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.                                 中文润色
  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.                                     <li>
  52.                                         <a href="{{ path('security_about') }}">
  53.                                             <i class="fa fa-about" aria-hidden="true"></i> {{ 'menu.about'|trans }}
  54.                                         </a>
  55.                                     </li>
  56.                                     <li>
  57.                                         <a href="{{ path('security_whatwedo') }}">
  58.                                             <i class="fa fa-about" aria-hidden="true"></i> {{ 'menu.whatwedo'|trans }}
  59.                                         </a>
  60.                                     </li>
  61.                                     <li>
  62.                                         <a href="{{ path('security_fees') }}">
  63.                                             <i class="fa fa-about" aria-hidden="true"></i> {{ 'menu.fees'|trans }}
  64.                                         </a>
  65.                                     </li>
  66.                                     <li>
  67.                                         <a href="{{ path('security_contact') }}">
  68.                                             <i class="fa fa-about" aria-hidden="true"></i> {{ 'menu.contact'|trans }}
  69.                                         </a>
  70.                                     </li>
  71.                                     <li>
  72.                                         <a href="{{ path('security_agreements') }}">
  73.                                             <i class="fa fa-about" aria-hidden="true"></i> {{ 'menu.agreements'|trans }}
  74.                                         </a>
  75.                                     </li>
  76.                                     {% if is_granted('ROLE_ADMIN') %}
  77.                                         <li>
  78.                                             <a href="{{ path('admin_post_index') }}">
  79.                                                 <i class="fa fa-lock" aria-hidden="true"></i> {{ 'menu.admin'|trans }}
  80.                                             </a>
  81.                                         </li>
  82.                                     {% endif %}
  83.                                 {% endblock %}
  84.                                 <li>
  85.                                     <a href="{{ path('blog_search') }}"> <i class="fa fa-search"></i> {{ 'menu.search'|trans }}</a>
  86.                                 </li>
  87.                                 {% if app.user %}
  88.                                     <li class="dropdown">
  89.                                         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" id="user">
  90.                                             <i class="fa fa-user" aria-hidden="true"></i>
  91.                                             <span class="caret"></span>
  92.                                             <span class="sr-only">{{ app.user.fullname }}</span>
  93.                                         </a>
  94.                                         <ul class="dropdown-menu user" role="menu" aria-labelledby="user">
  95.                                             <li>
  96.                                                 <a href="{{ path('user_edit') }}">
  97.                                                     <i class="fa fa-edit" aria-hidden="true"></i> {{ 'menu.user'|trans }}
  98.                                                 </a>
  99.                                             </li>
  100.                                             <li class="divider"></li>
  101.                                             <li>
  102.                                                 <a href="{{ logout_path() }}">
  103.                                                     <i class="fa fa-sign-out" aria-hidden="true"></i> {{ 'menu.logout'|trans }}
  104.                                                 </a>
  105.                                             </li>
  106.                                         </ul>
  107.                                     </li>
  108.                                 {% endif %}
  109.                                 <li class="dropdown">
  110.                                     <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" id="locales">
  111.                                         <i class="fa fa-globe" aria-hidden="true"></i>
  112.                                         <span class="caret"></span>
  113.                                         <span class="sr-only">{{ 'menu.choose_language'|trans }}</span>
  114.                                     </a>
  115.                                     <ul class="dropdown-menu locales" role="menu" aria-labelledby="locales">
  116.                                         {% for locale in locales() %}
  117.                                             <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>
  118.                                         {% endfor %}
  119.                                     </ul>
  120.                                 </li>
  121.                             </ul>
  122.                         </div>
  123.                     </div>
  124.                 </div>
  125.             </header>
  126.         {% endblock %}
  127.         <div class="container body-container">
  128.             {% block body %}
  129.                 <div class="row">
  130.                     <div id="main" class="col-sm-9">
  131.                         {{ include('default/_flash_messages.html.twig') }}
  132.                         {% block main %}{% endblock %}
  133.                     </div>
  134.                     <div id="sidebar" class="col-sm-3">
  135.                         {% block sidebar %}
  136.                             {{ render_esi(controller('Symfony\\Bundle\\FrameworkBundle\\Controller\\TemplateController::templateAction', {
  137.                                 'template': 'blog/about.html.twig',
  138.                                 'sharedAge': 600,
  139.                                 '_locale': app.request.locale
  140.                             })) }}
  141.                         {% endblock %}
  142.                     </div>
  143.                 </div>
  144.             {% endblock %}
  145.         </div>
  146.         {% block footer %}
  147.             <footer>
  148.                 <div class="container">
  149.                     <div class="row">
  150.                         <div id="footer-copyright" class="col-md-6">
  151.                             <p>&copy; {{ 'now'|date('Y') }} - The Symfony Project</p>
  152.                             <p>{{ 'mit_license'|trans }}</p>
  153.                         </div>
  154.                         <div id="footer-resources" class="col-md-6">
  155.                             <p>
  156.                                 <a href="https://twitter.com/symfony" title="Symfony Twitter">
  157.                                     <i class="fa fa-twitter" aria-hidden="true"></i>
  158.                                 </a>
  159.                                 <a href="https://www.facebook.com/SensioLabs" title="SensioLabs Facebook">
  160.                                     <i class="fa fa-facebook" aria-hidden="true"></i>
  161.                                 </a>
  162.                                 <a href="https://symfony.com/blog/" title="Symfony Blog">
  163.                                     <i class="fa fa-rss" aria-hidden="true"></i>
  164.                                 </a>
  165.                             </p>
  166.                         </div>
  167.                     </div>
  168.                 </div>
  169.             </footer>
  170.         {% endblock %}
  171.         {# it's not mandatory to set the timezone in localizeddate(). This is done to
  172.            avoid errors when the 'intl' PHP extension is not available and the application
  173.            is forced to use the limited "intl polyfill", which only supports UTC and GMT #}
  174.         <!-- Page rendered on {{ 'now'|format_datetime('long', 'long', '', 'UTC') }} -->
  175.     </body>
  176. </html>