base.html.twig 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. {% block meta %}
  5. {# This is far from perfect. The response headers should already come with this. #}
  6. {% if app.request.server.get('APP_ENV') not in ['test', 'dev'] %}
  7. <meta http-equiv="Content-Security-Policy" content="default-src https:">{% endif %}
  8. <meta charset="utf-8">
  9. <meta name="viewport" content="width=device-width, initial-scale=1">
  10. <link rel="home" href="/">
  11. {% endblock %}
  12. <title>
  13. {% block title %}{% endblock %}
  14. </title>
  15. {% block stylesheets %}
  16. <link rel='stylesheet' type='text/css' href="{{ asset('assets/default_theme/css/root.css') }}">
  17. <link rel='stylesheet' type='text/css' href="{{ asset('assets/default_theme/css/base.css') }}">
  18. {% for stylesheet in show_stylesheets(app.request.get('_route')) %}
  19. <link rel='preload' type='text/css' as='style' href="{{ preload(asset(stylesheet), { as: 'style' }) }}">
  20. <link rel='stylesheet' type='text/css' as='style' href="{{ asset(stylesheet) }}">
  21. {% endfor %}
  22. {% endblock %}
  23. {% for arr in handle_event('ShowHeadElements', app.request) %}
  24. {# Only one element, but has dynamic value, can't access it directly #}
  25. {% for type, element in arr %}
  26. <{{ type }} rel="{{ element['rel'] }}" type="{{ element['type'] }}" href="{{ element['href'] }}" title="{{ element['title'] }}">
  27. {% endfor %}
  28. {% endfor %}
  29. </head>
  30. <body>
  31. <aside class="accessibility-menu">
  32. <h2 class="accessibility-menu-title" tabindex="0">{{ 'Accessibility menu.' | trans }}</h2>
  33. <p tabindex="0">{{ 'Here you can find fast shortcuts to various page regions!' | trans }}</p>
  34. <p tabindex="0">{{ 'Provided the following keyboard shortcut, the link is targeted.' | trans }}</p>
  35. <br>
  36. <p tabindex="0">{{ 'Be mindful that another ' | trans }}<kbd>Tab</kbd>{{ ' is needed in order to focus.' | trans }}
  37. </p>
  38. <p tabindex="0">
  39. {% if is_firefox() == true %}
  40. <em><kbd>Alt</kbd> + <kbd>Shift</kbd> + "access key"</em>
  41. {% else %}
  42. <em><kbd>Alt</kbd> + "access key"</em>
  43. {% endif %}
  44. </p>
  45. <br>
  46. <a id="anchor-accessibility-menu" accesskey="z" href="#anchor-accessibility-menu">
  47. <strong>{{ 'The keyboard key ' | trans }}<kbd>Z</kbd>{{ ' accesses this menu.' | trans }}</strong>
  48. <strong>{{ 'The other access keys are:' | trans }}</strong>
  49. </a>
  50. <nav>
  51. <ul>
  52. <li><a href="#anchor-left-panel" accesskey="h"><kbd>H</kbd>{{ ' for the Left panel.' | trans }}</a></li>
  53. <li><a href="#anchor-main-content" accesskey="k"><kbd>K</kbd>{{ ' for the main content.' | trans }}</a></li>
  54. <li><a href="#anchor-main-page" accesskey="j"><kbd>J</kbd>{{ ' for the main page.' | trans }}</a></li>
  55. <li><a href="#anchor-right-panel" accesskey="l"><kbd>L</kbd>{{ ' for the right panel.' | trans }}</a></li>
  56. </ul>
  57. </nav>
  58. </aside>
  59. {% block header %}
  60. {% set extra_header_forms = handle_event('AddExtraHeaderForms', request) %}
  61. <header class="page-header">
  62. {{ block("leftpanel", "stdgrid.html.twig") }}
  63. <a id="anchor-main-page" class="anchor-hidden"
  64. title="{{ 'Press tab to access instance\'s main page.' | trans }}"></a>
  65. <a class="accessibility-target header-instance" href="{{ path('main_public') }}" tabindex="0"
  66. title="{{ 'This instance\'s name. Access public feed.' | trans }}">
  67. <h1>{{ icon('logo', 'icon icon-logo') | raw }}{{ config('site', 'name') }}</h1>
  68. </a>
  69. <details class="header-extra-actions">
  70. <summary>
  71. {{ icon('kebab', 'icon icon-details-open') | raw }}
  72. </summary>
  73. <div class="header-extra-actions-open">
  74. {% for extra_form in extra_header_forms %}
  75. {{ form(extra_form) }}
  76. {% endfor %}
  77. </div>
  78. </details>
  79. {{ block("rightpanel", "stdgrid.html.twig") }}
  80. </header>
  81. {% endblock header %}
  82. <div class="page-content-wrapper">
  83. <a role="navigation" rel="help" id="anchor-main-content" class="anchor-hidden"
  84. title="{{ 'Press tab to access main content.' | trans }}"></a>
  85. <div class='page-content accessibility-target'>
  86. {% block nav %}{% endblock %}
  87. {% block body %}{% endblock %}
  88. {% block javascripts %}{% endblock javascripts %}
  89. </div>
  90. </div>
  91. </body>
  92. </html>