base.html.twig 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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='preload' type='text/css' as='style' href="{{ asset('assets/default_theme/fonts/opensans/opensans.css') }}">
  17. <link rel='stylesheet' type='text/css' href="{{ asset('assets/default_theme/fonts/opensans/opensans.css') }}">
  18. <link rel='stylesheet' type='text/css' href="{{ asset('assets/default_theme/reset.css') }}">
  19. <link rel='stylesheet' type='text/css' href="{{ asset('assets/default_theme/root.css') }}">
  20. <link rel='stylesheet' type='text/css' href="{{ asset('assets/default_theme/widgets.css') }}">
  21. <link rel='stylesheet' type='text/css' href="{{ asset('assets/default_theme/base.css') }}">
  22. {% for stylesheet in show_stylesheets(app.request.get('_route')) %}
  23. <link rel='preload' type='text/css' as='style' href="{{ preload(asset(stylesheet), { as: 'style' }) }}">
  24. <link rel='stylesheet' type='text/css' as='style' href="{{ asset(stylesheet) }}">
  25. {% endfor %}
  26. {% endblock %}
  27. {% for arr in handle_event('ShowHeadElements', app.request) %}
  28. {# Only one element, but has dynamic value, can't access it directly #}
  29. {% for type, element in arr %}
  30. <{{ type }} rel="{{ element['rel'] }}" type="{{ element['type'] }}" href="{{ element['href'] }}" title="{{ element['title'] }}">
  31. {% endfor %}
  32. {% endfor %}
  33. {% for block in handle_event('AppendToHead', app.request) %}
  34. {{ block | raw }}
  35. {% endfor %}
  36. </head>
  37. <body>
  38. <aside class="accessibility-menu">
  39. <strong class="accessibility-menu-title" tabindex="0">{% trans %}Accessibility menu{% endtrans %}</strong>
  40. <br>
  41. <section tabindex="0">
  42. <p>{% trans %}Here you can find fast shortcuts to various page regions!{% endtrans %}</p>
  43. <br>
  44. <p>{% trans %}Be mindful that a <em><kbd>Tab</kbd></em> followed by a <em><kbd>Space</kbd></em> is needed in order to focus each panel. Other anchors do only require a <em><kbd>Tab</kbd></em> however.{% endtrans %}</p>
  45. </section>
  46. <section tabindex="0">
  47. <p>{% trans %}The accesskey default shortcut keybinding is as follows: {% endtrans %}</p>
  48. <p>
  49. {% if is_firefox() == true %}
  50. <em><kbd>Alt</kbd> + <kbd>Shift</kbd></em>
  51. {% else %}
  52. <em><kbd>Alt</kbd></em>
  53. {% endif %}
  54. </p>
  55. </section>
  56. <section>
  57. <a id="anchor-accessibility-menu" accesskey="z" href="#anchor-accessibility-menu">
  58. <strong>{% trans %}Combined with the previous keybinding, the keyboard key
  59. <kbd>Z</kbd> returns focus to this menu.{% endtrans %}</strong>
  60. <strong>{% trans %}Further access keys are provided via:{% endtrans %}</strong>
  61. </a>
  62. <nav>
  63. <ul>
  64. <li><a href="#anchor-left-panel" accesskey="s">{% trans %}Left panel is accessed with
  65. <kbd>S</kbd>{% endtrans %}</a></li>
  66. <li><a href="#anchor-main-content" accesskey="n">{% trans %}Main content is accessed with
  67. <kbd>N</kbd>{% endtrans %}</a></li>
  68. <li><a href="#anchor-main-page" accesskey="y">{% trans %}Main instance page is accessed with
  69. <kbd>Y</kbd>{% endtrans %}</a></li>
  70. <li><a href="#anchor-right-panel" accesskey="j">{% trans %}Finally, the right panel is accessed with
  71. <kbd>J</kbd>{% endtrans %}</a></li>
  72. </ul>
  73. </nav>
  74. </section>
  75. </aside>
  76. {% block header %}
  77. <header class="page-header">
  78. {{ block("leftpanel", "stdgrid.html.twig") }}
  79. <div class="header-instance">
  80. <a id="anchor-main-page" class="anchor-hidden"
  81. title="{% trans %}Press tab to access instance's main page{% endtrans %}"></a>
  82. <a class="accessibility-target" href="{{ path('feed_public') }}" tabindex="0"
  83. title="{% trans %}This instance\'s name. Access public feed{% endtrans %}">
  84. <h1>{{ icon('logo', 'icon icon-logo') | raw }}{{ config('site', 'name') }}</h1>
  85. </a>
  86. </div>
  87. {{ block("rightpanel", "stdgrid.html.twig") }}
  88. </header>
  89. {% endblock header %}
  90. <a role="navigation" rel="help" id="anchor-main-content" class="anchor-hidden"
  91. title="{% trans %}Anchor to main content{% endtrans %}"></a>
  92. <main class="page-content-wrapper" title="{% trans %}Page main content{% endtrans %}">
  93. <div class='page-content accessibility-target' role="presentation">
  94. {% block nav %}{% endblock %}
  95. {% block body %}{% endblock %}
  96. {% block javascripts %}{% endblock javascripts %}
  97. </div>
  98. </main>
  99. </body>
  100. </html>