<fieldset class="aa-discord-ping-formatter-form">
    <div class="form-group clearfix">
        <label class="col-md-3 control-label" for="pingTarget">Ping Target</label>
        <div class="col-md-9">
            <select id="pingTarget" name="pingTarget" class="form-control">
                <option value="@here">@here</option>
                <option value="@everyone">@everyone</option>

                {% if additionalPingTargets|length > 0 %}
                    <option value="" disabled></option>
                    <optgroup label="Additionally configured ping targets">
                        {% for pingTarget in additionalPingTargets %}
                            <option value="{{ pingTarget.roleId }}">@{{ pingTarget.roleName }}</option>
                        {% endfor %}
                    </optgroup>
                {% endif %}
            </select>
        </div>
    </div>

    <div class="form-group clearfix">
        <div class="col-md-3">&nbsp;</div>
        <div class="col-md-9">
            <div class="checkbox">
                <label for="prePing">
                    <input type="checkbox" name="prePing" id="prePing" value="1"> Pre-Ping
                </label>
            </div>
        </div>
    </div>

    {% if additionalPingWebhooks|length > 0 %}
        <div class="form-group clearfix">
            <label class="col-md-3 control-label" for="pingTarget">Ping Channel<br><span class="small">Select a channel to ping it automatically</span></label>
            <div class="col-md-9">
                <select id="pingChannel" name="pingChannel" class="form-control">
                    <option value="">None, just format it for me</option>
                    {% for pingWebhook in additionalPingWebhooks %}
                        <option value="{{ pingWebhook.discordWebhookUrl }}">{{ pingWebhook.discordChannelName }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>
    {% endif %}

    <div class="form-group clearfix">
        <label class="col-md-3 control-label" for="fleetType">Fleet Type</label>
        <div class="col-md-9">
            <select id="fleetType" name="fleetType" class="form-control">
                <option value="">Please select</option>
                <option value="Roaming">Roam</option>
                <option value="Home Defense">Home Defense</option>
                <option value="StratOP">StratOP</option>
                <option value="CTA">CTA</option>

                {% if additionalFleetTypes|length > 0 %}
                    <option value="" disabled></option>
                    <optgroup label="Additionally configured fleet types">
                        {% for fleetType in additionalFleetTypes %}
                            <option value="{{ fleetType }}">{{ fleetType }}</option>
                        {% endfor %}
                    </optgroup>
                {% endif %}
            </select>
        </div>
    </div>

    <div class="form-group clearfix">
        <label class="col-md-3 control-label" for="fcName">FC Name</label>
        <div class="col-md-9">
            <input id="fcName" name="fcName" type="text" class="form-control input-md">
        </div>
    </div>

    <div class="form-group clearfix">
        <label class="col-md-3 control-label" for="fleetName">Fleet Name</label>
        <div class="col-md-9">
            <input id="fleetName" name="fleetName" type="text" class="form-control input-md">
        </div>
    </div>

    <div class="form-group clearfix">
        <label class="col-md-3 control-label" for="formupLocation">Formup Location</label>
        <div class="col-md-9">
            <input id="formupLocation" name="formupLocation" type="text" class="form-control input-md">
        </div>
    </div>

    <div class="form-group clearfix">
        <label class="col-md-3 control-label" for="formupTime">Formup Time<br><span class="small">Always use Eve Time</span></label>
        <div class="col-md-9">
            <input id="formupTime" name="formupTime" type="text" class="form-control input-md" disabled>
            <span class="small">To enable this field, either make it a Pre-Ping (checkbox above) or uncheck "Formup NOW" (checkbox below).</span>
            {% if timezones_installed %}
                <span class="small">Timezones module is installed. Link to time zone conversion will be added automatically if you set a date and time here.</span>
            {% endif %}
            <div class="checkbox">
                <label for="formupTimeNow">
                    <input type="checkbox" name="formupTimeNow" id="formupTimeNow" value="1" checked> Formup NOW<br><span class="small">If this checkbox is active, formup time will be set to "NOW" and the time in the field above (if any is set) will be ignored.</span>
                </label>
            </div>
        </div>
    </div>

    <div class="form-group clearfix">
        <label class="col-md-3 control-label" for="fleetComms">Fleet Comms</label>
        <div class="col-md-9">
            <input id="fleetComms" name="fleetComms" type="text" class="form-control input-md">
        </div>
    </div>

    <div class="form-group clearfix">
        <label class="col-md-3 control-label" for="fleetDoctrine">Ships / Doctrine</label>
        <div class="col-md-9">
            <input id="fleetDoctrine" name="fleetDoctrine" type="text" class="form-control input-md">
        </div>
    </div>

    <div class="form-group clearfix">
        <label class="col-md-3 control-label" for="fleetSrp">SRP</label>
        <div class="col-md-9">
            <select id="fleetSrp" name="fleetSrp" class="form-control">
                <option value="">Please select</option>
                <option value="Yes">Yes</option>
                <option value="No">No</option>
            </select>
        </div>
    </div>

    <div class="form-group clearfix">
        <label class="col-md-3 control-label" for="additionalInformation">Additional Information</label>
        <div class="col-md-9">
            <textarea class="form-control" id="additionalInformation" name="additionalInformation" rows="7"></textarea>
        </div>
    </div>

    <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">Create Discord Ping Text</button>
        </div>
    </div>
</fieldset>

<script type="text/javascript">
    var timezonesInstalled = {{ timezones_installed|yesno:"true,false" }};
    var siteUrl = '{{ site_url }}/';
</script>
