{% extends "wagtailadmin/base.html" %}
{% load wagtailadmin_tags i18n %}
{% block titletag %}{% trans "Create an A/B Test" %} - {{ page.title }}{% endblock %}

{% block content %}
    {% trans "Create an A/B Test" as title %}
    {% include "wagtailadmin/shared/header.html" with title=title subtitle=page.title icon='people-arrows' merged=1 %}

    <div class="nice-padding">
        <form method="post">
            {% csrf_token %}

            {% component panel %}

            <section class="w-form-width">
                <p class="section__content">
                    <button type="submit" class="button button-primary">{% trans "Save" %}</button>
                    <button type="submit" name="start" class="button button-primary">{% trans "Save and start test" %}</button>
                </p>

                {% help_block status="info"%}
                    <p>{% trans "A/B tests are calculated using Pearson's chi squared test and are set at 95% confidence level." %}</p>
                    <p>{% trans "Traffic is split evenly between each version." %}</p>
                    <p>{% trans 'Users with "<a href="https://en.wikipedia.org/wiki/Do_Not_Track" target="_blank">Do Not Track</a>" enabled are not counted.' %}</p>
                {% endhelp_block %}
            </section>
        </form>
    </div>
{% endblock %}

{% block extra_js %}
    {% include "wagtailadmin/pages/_editor_js.html" %}
    {{ goal_selector_props|json_script:"data-goal-selector-props" }}
    <script>
        {% url 'wagtailadmin_home' as wagtailadmin_root_url %}
        wagtailConfig.ADMIN_ROOT_URL = '{{ wagtailadmin_root_url|escapejs }}';
    </script>
    <script src="{% url 'wagtail_ab_testing_admin:javascript_catalog' %}"></script>
    <script type="text/javascript" src="{% versioned_static 'wagtailadmin/js/page-chooser-modal.js' %}"></script>
    <script src="{% versioned_static 'wagtail_ab_testing/js/wagtail-ab-testing.js' %}"></script>
{% endblock %}
