{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}

{% set activeRouteKey = 'chill_activity_activity_list' %}

{% block title  'Update activity'|trans %}

{% block content %}
<div class="activity-edit">

    <div id="activity"></div> {# <=== vue component #}
    {% include '@ChillActivity/Activity/edit.html.twig' %}

</div>
{% endblock %}

{% block js %}
    {{ parent() }}
    {{ encore_entry_script_tags('mod_async_upload') }}
    <script type="text/javascript">
        window.addEventListener('DOMContentLoaded', function (e) {
            chill.displayAlertWhenLeavingModifiedForm('form[name="{{ edit_form.vars.form.vars.name }}"]',
            '{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
        });
        window.activity = {{ activity_json|json_encode|raw }};
    </script>
    {{ encore_entry_script_tags('vue_activity') }}
{% endblock %}

{% block css %}
    {{ parent() }}
    {{ encore_entry_link_tags('mod_async_upload') }}
    {{ encore_entry_link_tags('vue_activity') }}
    {{ encore_entry_link_tags('page_edit_activity') }}
{% endblock %}
