{% extends 'events/surveys/management/survey_actions/_base.html' %}

{% block label %}
    {% trans %}Survey ready to go live{% endtrans %}
{% endblock %}

{% block text %}
    {% if not survey.start_dt %}
        {% trans %}Open now or schedule opening for later{% endtrans %}
    {% else %}
        {% set tz = survey.event.tzinfo %}
        {% trans date=survey.start_dt|format_date(timezone=tz), time=survey.start_dt|format_time(timezone=tz) -%}
            Scheduled to open on <strong>{{ date }}</strong> at <strong>{{ time}}</strong> ({{ tz }})
        {%- endtrans %}
    {% endif %}
{% endblock %}

{% block buttons %}
    <div class="group">
        <button class="i-button icon-time js-survey-schedule-dialog"
                data-href="{{ url_for('.schedule_survey', survey) }}"
                data-title="{% trans %}Schedule survey{% endtrans %}">
            {% if not survey.start_dt %}
                {% trans %}Schedule{% endtrans %}
            {% else %}
                {% trans %}Reschedule{% endtrans %}
            {% endif %}
        </button>
    </div>
    <div class="group">
        <button data-href="{{ url_for('.open_survey', survey) }}" 
                data-method="POST" 
                class="i-button highlight"
                {% if survey.notifications_enabled %}
                    data-title="{% trans %}Confirm opening survey{% endtrans %}"
                    data-confirm="{% trans -%}Email notifications will be sent. Do you want to open the survey?{%- endtrans %}"
                {% endif %}>
            {% trans %}Open now{% endtrans %}
        </button>
    </div>
{% endblock %}
