{% load i18n %}

{% csrf_token %}
<fieldset class="aa-fleetpings-form">
    <!-- pingTarget.html -->
    {% include 'fleetpings/form/pingTargets.html' %}

    <!-- prePing.html -->
    {% include 'fleetpings/form/prePing.html' %}

    <!-- pingChannel.html -->
    {% include 'fleetpings/form/pingChannel.html' %}

    <!-- fleetType.html -->
    {% include 'fleetpings/form/fleetType.html' %}

    <!-- fleetCommander.html -->
    {% include 'fleetpings/form/fleetCommander.html' %}

    <!-- fleetName.html -->
    {% include 'fleetpings/form/fleetName.html' %}

    <!-- formupLocation.html -->
    {% include 'fleetpings/form/formupLocation.html' %}

    <!-- formupTime.html -->
    {% include 'fleetpings/form/formupTime.html' %}

    <!-- fleetComms.html -->
    {% include 'fleetpings/form/fleetComms.html' %}

    <!-- fleetDoctrine.html -->
    {% include 'fleetpings/form/fleetDoctrine.html' %}

    <!-- srp.html -->
    {% include 'fleetpings/form/srp.html' %}

    <!-- additionalInformation.html -->
    {% include 'fleetpings/form/additionalInformation.html' %}

    <!-- createOptimer.html -->
    {% if optimer_installed %}
        {% include 'fleetpings/form/createOptimer.html' %}
    {% endif %}

    <!-- createSrpLink.html -->
    {% if srp_module_available_to_user %}
        {% include 'fleetpings/form/createSrpLink.html' %}
    {% endif %}

    <div class="form-group clearfix">
        <label class="col-md-3 control-label" for="createPingText"></label>
        <div class="col-md-4">
            <button id="createPingText" name="createPingText" class="btn btn-primary">{% translate "Create Ping" %}</button>
        </div>
    </div>
</fieldset>

<script type="application/javascript">
    var fleetpingsSettings = {
        platformUsed: '{{ platform_used }}',
        timezonesInstalled: {{ timezones_installed|yesno:"true,false" }},
        optimerInstalled: {{ optimer_installed|yesno:"true,false" }},
        srpModuleAvailableToUser: {{ srp_module_available_to_user|yesno:"true,false" }},
        useNewTimezoneLinks: {{ use_new_timezone_links|yesno:"true,false" }},
        siteUrl: '{{ site_url }}/',
        pingCreator: '{{ main_character|safe|addslashes }}',
        {% if optimer_installed %}
        optimerAjaxUrl: '{% url "fleetpings:ajax_create_optimer" %}',
        {% endif %}
        {% if srp_module_available_to_user %}
        srpAjaxUrl: '{% url "fleetpings:ajax_create_srp_link" %}',
        {#srpCode: '{{ srp_code }}'#}
        {% endif %}
    };
</script>
