base.html.twig 5.5 KB

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