{% extends "psynet_layout.html" %}

{% block body %}
    {{super()}}

    <div style="margin: 15%">
        <p>
            {{ pgettext("start", "Starting experiment...") }}
        </p>
    </div>
{% endblock %}


{% block scripts %}
{{super()}}
    <script>
        dallinger.identity.participantId = "undefined";
        dallinger.createParticipant().done(function(resp) {
            setTimeout(function() {
                let auth_token = "start";
                if ("{{ auth_token }}".length > 0) {
                    auth_token = "{{ auth_token }}";
                }
                window.location = "/timeline?participant_id=" + dallinger.identity.participantId + "&auth_token=" + auth_token;
            }, 500);
        }).fail(function(resp) {
            dallinger.error(resp);
        });
    </script>
{% endblock %}
