{% extends "layout_vue.html" %}
{% from "_macros.html" import render_event_props_seo %}

{% set event = event_date.event %}

{%- block title -%}
{{ meta['title'] }}
{%- endblock -%}

{% block component_scripts %}
<script src="{{ url_for('static', filename='vue/event-lists/add-event.vue.js')}}"></script>
{% endblock %}

{% block component_definitions %}
Vue.component("EventListAddEvent", EventListAddEvent);
{% endblock %}

{% block vue_container %}
{% endblock %}

{% block header_before_site_js %}
<script src="{{ url_for('static', filename='user.js')}}"></script>
{{ super() }}
{%- endblock -%}

{% block content_container_attribs %}{% endblock %}

{% block content %}
    {% set can_add_to_list = current_admin_unit and has_access(current_admin_unit, "admin_unit:update")%}
    {{ render_event_props_seo(event, event_date.start, event_date.end, event_date.allday, dates, user_rights=user_rights, share_links=share_links, calendar_links=calendar_links, current_user=current_user, can_add_to_list=can_add_to_list) }}

    <div id="vue-container">
        {% if can_add_to_list %}
        <b-modal id="add-event-to-list-modal" title="{{ _('Add event to list') }}" ok-only>
            <event-list-add-event event-id="{{ event.id }}" organization-id="{{ current_admin_unit.id }}" />
        </b-modal>
        {% endif %}
    </div>
    {{ super() }}
{% endblock %}