preload course json for a faster display

This commit is contained in:
Julien Fastré 2022-05-28 00:07:11 +02:00
parent b9c1dbd8c1
commit 1496ae34f8
2 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{ installation.name }} - {% block title %}{{ 'Homepage'|trans }}{% endblock %}</title>
{% block head_custom %}{% endblock %}
<link rel="shortcut icon" href="{{ asset('build/images/favicon.ico') }}" type="image/x-icon">
{{ encore_entry_link_tags('mod_bootstrap') }}

View File

@ -1,5 +1,9 @@
{% extends "@ChillMain/layoutWithVerticalMenu.html.twig" %}
{% block head_custom %}
<link rel="preload" href="{{ preload(path('chill_api_single_accompanying_course__entity', {'id': accompanyingCourse.id, '_format': 'json' }), {as: 'fetch'}) }}" as="fetch" />
{% endblock %}
{% block top_banner %}
{{ include('@ChillPerson/AccompanyingCourse/banner.html.twig', { title: block('title') }) }}
{% endblock %}
@ -17,7 +21,7 @@
'layout': '@ChillPerson/menu.html.twig',
'args' : { 'accompanyingCourse': accompanyingCourse }
}) }}
{% block block_post_menu %}
{% endblock %}