<div {{ attributes }}>
    <h3>{{ 'Manage Notifications'|trans }}</h3>

    {{ form_start(form, {
        attr: {
            'data-action': 'live#action:prevent',
            'data-live-action-param': 'save'
        }
    }) }}

    {% for event in notificationList %}
        <div class="card mb-3">
            <div class="card-header">
                <strong>Event:</strong> {{ event|trans }}<br />
                {# <small class="text-muted">Description</small> #}
            </div>
            <div class="card-body">
                {{ form_row(attribute(form, event)) }}
                {#{{ form_row(i) }}#}
                {#<div class="form-check">
                    <input class="form-check-input" type="checkbox" name="notifications[{{ event }}][]" value="email" id="event-{{ event }}-transport-email">
                    <label class="form-check-label" for="event-{{ event }}-transport-email">
                        Email
                    </label>
                </div>#}
                {#{% for transport in allTransports %}
                    <div class="form-check">
                        <input class="form-check-input" type="checkbox" name="notifications[{{ event }}][]" value="{{ transport.id }}" id="event-{{ event }}-transport-{{ transport.id }}"
                                {% if transport.id in [] %} checked {% endif %}>
                        <label class="form-check-label" for="event-{{ event }}-transport-{{ transport.id }}">
                            {{ transport.name }}
                        </label>
                    </div>
                {% endfor %}#}
            </div>
        </div>
    {% endfor %}
    <button type="submit" class="btn btn-primary">Save Settings</button>
    {{ form_end(form) }}
</div>


{#
<div {{ attributes }}>
    {% if this.action is same as('addItem') %}
        {{ form_start(form, {
            attr: {
                'data-action': 'live#action:prevent',
                'data-live-action-param': 'save'
            }
        }) }}
    {% endif %}
    <div class="card card-outline card-primary">
        <div class="card-header with-border">
            <h3 class="card-title">
                {{ 'Notifications' }}
            </h3>
        </div>
        <div class="card-body">
            {% if this.action is same as('addItem') %}
                {{ form(form) }}
            {% else %}
                <button class="btn btn-outline-success" type="button" aria-expanded="false" data-model="action" data-value="addItem" data-action="live#update:prevent">
                    {{ icon('plus-circle') }} Add Notification
                </button>

                <br />
                <p class="h5">Active Notifications</p>
                {% for notification in allNotifications %}
                        <strong>{{ notification.event|humanize|title }}</strong>
                        <div class="row">
                        {% for t in allTransports %}
                            <div class="col-2"><input type="checkbox">{{ t }}</div>
                        {% endfor %}
                    </div>
                {% endfor %}
            {% endif %}
        </div>

        <div class="card-footer clearfix">
            {% if this.action is same as('addItem') %}
                <div class="float-left">
                    <button type="button" class="btn btn-warning" data-model="action" data-value="list" data-action="live#update:prevent">
                        {{ icon('reply') }} {{ 'Cancel'|trans }}
                    </button>
                </div>
                <div class="float-right">
                    <button type="submit" class="btn btn-success">
                        {{ icon('save')}} {{ 'Save'|trans }}
                    </button>
                </div>
            {% endif %}
        </div>
    </div>
    {% if this.action is same as('addItem') %}
        {{ form_end(form) }}
    {% endif %}
</div>
#}
