{% if additionalPingWebhooks|length > 0 %}
    <div class="form-group clearfix">
        <label class="col-md-3 control-label" for="pingChannel">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>

                <option value="" disabled></option>
                <optgroup label="Configured ping channels">
                    {% load update_variable %}
                    {% with "false" as showWebhook %}
                        {% for pingWebhook in additionalPingWebhooks %}
                            {% update_variable "false" as showWebhook %}

                            {% for group in userGroups %}
                                {% if showWebhook == "false" %}
                                    {% if pingWebhook.restrictedToGroup|length == 0 or group.id in pingWebhook.restrictedToGroup %}
                                        <option value="{{ pingWebhook.discordWebhookUrl }}">{{ pingWebhook.discordChannelName }}</option>
                                        {% update_variable "true" as showWebhook %}
                                    {% endif %}
                                {% endif %}
                            {% endfor %}
                        {% endfor %}
                    {% endwith %}
                </optgroup>
            </select>
        </div>
    </div>
{% endif %}
