load vue banner component for each page of AccompanyingCourse context

* vue css and js loaded from layout.html.twig
* rename 'show' template to 'edit' template
* overwrite js block for 'edit' template (load all component, not only banner)
This commit is contained in:
2021-05-25 19:05:51 +02:00
parent fc2a2da75f
commit 31252461c9
7 changed files with 70 additions and 36 deletions

View File

@@ -0,0 +1,19 @@
{% extends 'ChillPersonBundle:AccompanyingCourse:layout.html.twig' %}
{% set title = 'DRAFT' == accompanyingCourse.step ? 'New accompanying course' : 'Edit accompanying course' %}
{% block title %}
{{ title|trans }}
{% endblock %}
{% block content %}
<div id="accompanying-course"></div> {# <== insert accompanyingCourse vue component #}
{% endblock %}
{% block js %}
<script type="text/javascript">
window.accompanyingCourseId = {{ accompanyingCourse.id|e('js') }};
window.vueRootComponent = 'app';
</script>
{{ encore_entry_script_tags('accompanying_course') }}
{% endblock %}