<commit_before>{% extends 'base.html.twig' %}

{% block title %}Anmeldung ({{ event.title }}){% endblock %}

{% block body %}
    <div class="modal fade" id="dialogModal" tabindex="-1" role="dialog" aria-labelledby="dialogModalLabel">
        <div class="modal-dialog" role="document">
            {{ form_start(form) }}
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Abbrechen"><span
                                aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="dialogModalLabel"></h4>
                </div>
                <div class="modal-body">
                    <p></p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Abbrechen
                    </button>
                    <input type="submit" class="btn btn-primary" value="Bestätigen"/>
                </div>
            </div>
            {{ form_end(form) }}
        </div>
    </div>
    <div class="container participation-panels collapse-breadcrumb-header">
        <div class="row">
            <div class="col-xs-12">
                <ol class="breadcrumb">
                    <li><a href="{{ path('homepage') }}">Juvem</a></li>
                    <li><a href="{{ path('event_list') }}">Veranstaltungen</a></li>
                    <li><a href="{{ path('event', {'eid': event.eid }) }}">{{ event.title }}</a></li>
                    <li><a href="{{ path('event_participants_list', {'eid': event.eid }) }}">Teilnehmer</a></li>
                    <li class="active">{{ participation|participantsgrouped }}</li>
                </ol>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12 col-md-6">
                <div class="page-header">
                    <h1>Anmeldung <small>{{ participation|participantsgrouped }}</small></h1>
                </div>
                {% include 'common/header/page-global-messages.html.twig' %}
            </div>
            <div class="col-xs-12 col-md-6">
                <div class="btn-toolbar" role="toolbar">
                    <div class="btn-group-vertical" role="group">
                        {% if participation.withdrawn %}
                            <button type="button" class="btn btn-default" data-toggle="modal"
                                    data-target="#dialogModal" data-action="reactivate">
                                {{ 'retweet'|glyph }} Anmeldung reaktivieren
                            </button>
                        {% else %}
                            <button type="button" class="btn btn-default" data-toggle="modal"
                                    data-target="#dialogModal" data-action="withdraw">
                                {{ 'share-alt'|glyph }} Anmeldung zurückziehen
                            </button>
                        {% endif %}
                        {% if participation.deletedAt %}
                            <button type="button" class="btn btn-default" data-toggle="modal"
                                    data-target="#dialogModal" data-action="restore">
                                {{ 'repeat'|glyph }}<span class="hidden-xs"> aus Papierkorb</span> wiederherstellen
                            </button>
                        {% else %}
                            <button type="button" class="btn btn-default" data-toggle="modal"
                                    data-target="#dialogModal" data-action="delete">
                                {{ 'trash'|glyph }} in Papierkorb verschieben
                            </button>
                        {% endif %}
                    </div>
                    <div class="btn-group-vertical" role="group">
                        <button type="button" class="btn btn-default" data-element="activebutton"
                                data-entity="Participation"
                                data-property="isConfirmed" data-entity-id="{{ participation.pid }}"
                                data-token="{{ csrf_token('Participation' ~ 'isConfirmed' ~ participation.pid ) }}"
                                data-button-enable-label="Bestätigen & benachrichtigen" data-button-enable-glyph="ok"
                                data-button-disable-label="Bestätigung zurücknehmen"
                                data-button-disable-glyph="remove">{{ 'option-horizontal'|glyph }}</button>
                        <button type="button" class="btn btn-default" data-element="activebutton"
                                data-entity="Participation"
                                data-property="isPaid" data-entity-id="{{ participation.pid }}"
                                data-token="{{ csrf_token('Participation' ~ 'isPaid' ~ participation.pid ) }}"
                                data-button-enable-label="Zahlungseingang vermerken" data-button-enable-glyph="euro"
                                data-button-disable-label="Zahlung zurücknehmen"
                                data-button-disable-glyph="remove">{{ 'option-horizontal'|glyph }}</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12 col-sm-6">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-9">
                                <h3 class="panel-title">Anmeldung</h3>
                            </div>
                            <div class="col-xs-3 text-right">
                                <a href="{{ path('admin_edit_phonenumbers', {'eid': event.eid, 'pid': participation.pid}) }}"
                                   class="btn btn-default btn-xs" title="Telefonnummern bearbeiten">{{ 'phone-alt'|glyph }}</a>
                                <a href="{{ path('admin_edit_participation', {'eid': event.eid, 'pid': participation.pid}) }}"
                                   class="btn btn-default btn-xs" title="Anmeldungsdaten bearbeiten">{{ 'pencil'|glyph }}</a>
                            </div>
                        </div>
                    </div>
                    <div class="panel-body">
                        <dl class="dl-horizontal">
                            <dt>Anrede</dt>
                            <dd>{{ participation.salution }}</dd>
                            <dt>Vorname</dt>
                            <dd>{{ participation.nameFirst }}</dd>
                            <dt>Nachname</dt>
                            <dd>{{ participation.nameLast }}</dd>
                            <dt>Telefon</dt>
                            <dd>
                            {% for phoneNumber in participation.phoneNumbers %}
                                <address>
                                    <a href="tel:{{ phone_number_format(phoneNumber.number, 'INTERNATIONAL') }}">{{ phone_number_format(phoneNumber.number, 'INTERNATIONAL') }}</a>
                                    {% if phoneNumber.description %}
                                    <br>
                                    <i>{{ phoneNumber.description }}</i>
                                    {% endif %}
                                </address>
                            {% endfor %}

                            </dd>
                            <dt>Anschrift</dt>
                            <dd class="address-container">
                                <address>
                                    <strong>{{ participation.getName() }}</strong><br>
                                    {{ participation.addressStreet }}<br>
                                    {{ participation.addressZip }} {{ participation.addressCity }}
                                </address>
                            </dd>
                            <dt>E-Mail Adresse</dt>
                            <dd class="address-container">
                                <address>
                                    {{ participation.email }}
                                </address>
                            </dd>
                            {% for fillout in participation.acquisitionAttributeFillouts %}
                                <dt title="{{ fillout.attribute.formDescription }}">{{ fillout.attribute.formTitle }}</dt>
                                <dd>{{ fillout }}</dd>
                            {% endfor %}
                            <dt><abbr title="Eingang der Anmeldung">Eingang</abbr></dt>
                            <dd>{{ participation.createdAt|date("d.m.Y H:i") }}</dd>
                            <dt>
                                <abbr title="Ist die Anmeldung mit einem Benutzerkonto verknüpft, ist dieses hier angegeben">Benutzerkonto</abbr>
                            </dt>
                            <dd>
                                {% if participation.assignedUser %}<a
                                    href="{{ path('user_detail', {'uid': participation.assignedUser.uid}) }}">
                                    {{ participation.assignedUser|fullname }}
                                    </a>
                                {% else %}
                                    <i>(keines)</i>
                                {% endif %}
                            </dd>

                        </dl>
                    </div>
                </div>
            </div>
        {% if participation.participants.count > 1 %}
        </div>
        <div class="row">
        {% endif %}
            {% for participant in participation.participants %}
                <div class="col-xs-12 col-sm-6">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <div class="row">
                                <div class="col-xs-8">
                                    <h3 class="panel-title"><span class="hidden-xs">Teilnehmer </span>{{ participant.nameFirst }}</h3>
                                </div>
                                <div class="col-xs-4 text-right">
                                    <a href="{{ path('admin_add_participant', {'eid': event.eid, 'pid': participation.pid}) }}"
                                       class="btn btn-default btn-xs"
                                       title="Neuen Teilnehmer hinzufügen">{{ 'plus'|glyph }}</a>
                                    <button type="button" class="btn btn-default btn-xs" data-element="activebutton"
                                            data-entity="Participant"
                                            data-property="isWithdrawn" data-entity-id="{{ participant.aid }}"
                                            data-token="{{ csrf_token('Participant' ~ 'isWithdrawn' ~ participant.aid ) }}"
                                            data-button-enable-label="Zurückziehen" data-button-enable-glyph="share-alt"
                                            data-button-disable-label="Reaktivieren"
                                            data-button-disable-glyph="retweet">{{ 'option-horizontal'|glyph }}</button>
                                    <a href="{{ path('admin_edit_participant', {'eid': event.eid, 'pid': participation.pid, 'aid': participant.aid}) }}"
                                       class="btn btn-default btn-xs" title="Bearbeiten">{{ 'pencil'|glyph }}</a>
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="row" id="participant-{{ loop.index }}">
                                <div class="col-xs-12">
                                    <dl class="dl-horizontal">
                                        <dt>Vorname</dt>
                                        <dd>{{ participant.nameFirst }}</dd>
                                        <dt>Nachname</dt>
                                        <dd>{{ participant.nameLast }}</dd>
                                        <dt>Geschlecht</dt>
                                        <dd>{{ participant.getGender(true) }}</dd>
                                        <dt>Geburtsdatum</dt>
                                        <dd>
                                            {{ participant.getBirthday|date("d.m.Y") }}
                                            {% if (participant.hasBirthdayAtEvent) %}
                                                {{ 'gift'|glyph }}
                                            {% endif %}
                                        </dd>
                                        <dt>Alter</dt>
                                        <dd>{{ participant.getAgeAtEvent|number_format(1) }} Jahre bei der
                                            Veranstaltung
                                        </dd>
                                        <dt>Ernährung</dt>
                                        <dd>
                                            {% set participantFood = participant.getFood(true) %}
                                            {% if participantFood.getValue() %}
                                                {{ ' '|bitmask(participantFood) }}
                                            {% else %}
                                                <i>(keine Besonderheiten)</i>
                                            {% endif %}
                                        </dd>
                                        <dt>Medizinische Hinweise</dt>
                                        <dd>
                                            {% if participant.infoMedical %}
                                                {{ participant.infoMedical }}
                                            {% else %}
                                                <i>(keine Besonderheiten)</i>
                                            {% endif %}
                                        </dd>
                                        <dt>Allgemeine Hinweise</dt>
                                        <dd>
                                            {% if participant.infoGeneral %}
                                                {{ participant.infoGeneral }}
                                            {% else %}
                                                <i>(keine Besonderheiten)</i>
                                            {% endif %}
                                        </dd>
                                        {% for fillout in participant.acquisitionAttributeFillouts %}
                                            <dt title="{{ fillout.attribute.formDescription }}">{{ fillout.attribute.formTitle }}</dt>
                                            <dd>{{ fillout }}</dd>
                                        {% endfor %}
                                    </dl>
                                </div>
                            </div>
                            <div class="col-xs-12 status-label-list">
                                {{ ' '|bitmask(participant.getStatus(true), statusFormatter) }}
                            </div>
                        </div>
                        {#
                        <div class="panel-footer">
                        </div>
                        #}
                    </div>
                </div>
            {% endfor %}
        </div>
    </div>

{% endblock %}
{% block javascriptCustom %}
    {% cspscript %}
    <script type='text/javascript'>
        jQuery(document).ready(function () {
            $('#dialogModal').on('show.bs.modal', function (event) {
                var button = $(event.relatedTarget),
                        action = button.data('action'),
                        modal = $(this),
                        title,
                        question;

                switch (action) {
                    case 'delete':
                        title = 'Anmeldung in Papierkorb verschieben';
                        question = 'Soll diese Anmeldung wirklich in den Papierkorb verschoben werden?';
                        break;
                    case 'restore':
                        title = 'Anmeldung aus Papierkorb nehmen';
                        question = 'Soll diese Anmeldung wirklich aus dem Papierkorb herausgeholt werden?';
                        break;
                    case 'withdraw':
                        title = 'Anmeldung zurückziehen';
                        question = 'Soll diese Anmeldung wirklich zurückgezogen werden?';
                        break;
                    case 'reactivate':
                        title = 'Anmeldung reaktivieren';
                        question = 'Soll diese zurückgezogene Anmeldung wirklich wieder aktiviert werden werden?';
                        break;
                }
                modal.find('.modal-title').text(title);
                modal.find('.modal-body > p').text(question);
                modal.find('input[name="form[action]"]').val(action);
            });
            $('[data-property="isConfirmed"]').on('juvem.activeButton.success', function (event, button, response) {
                if (response.value !== null) {
                    $('.status-label-list .option-{{ constant('AppBundle\\BitMask\\ParticipantStatus::TYPE_STATUS_CONFIRMED') }}').each(function (i, el) {
                        el = $(el);
                        if (response.value) {
                            el.text('bestätigt');
                            el.addClass('label-primary');
                            el.removeClass('label-default');
                        } else {
                            el.text('unbestätigt');
                            el.addClass('label-default');
                            el.removeClass('label-primary');
                        }
                    });
                    if (response.value) {
                        $(button).html('{{ 'ok'|glyph }} Bestätigung <i>(E-Mail wird versandt...)</i>');
                        $(button).addClass('disabled');
                        $.ajax({
                            type: 'POST',
                            url: '{{ path('event_participation_confirm_mail') }}',
                            data: {
                                _token: '{{ csrf_token(participation.pid) }}',
                                pid: '{{ participation.pid }}'
                            },
                            datatype: 'json',
                            success: function (response) {
                                $(document).trigger('add-alerts', {
                                    message: 'Die Eltern wurden per E-Mail über die Bestätigung benachrichtigt.',
                                    priority: 'success'
                                });
                            },
                            error: function (response) {
                                $(document).trigger('add-alerts', {
                                    message: 'Beim Versenden der E-Mail Benachrichtigung ist ein Fehler aufgetreten!',
                                    priority: 'error'
                                });
                            },
                            complete: function (response) {
                                $(button).html('{{ 'remove'|glyph }} Bestätigung zurücknehmen');
                                $(button).removeClass('disabled');
                            }
                        });
                    }
                }
            });
            $('[data-property="isPaid"]').on('juvem.activeButton.success', function (event, button, response) {
                if (response.value !== null) {
                    if (response.value) {
                        $('.status-label-list').append('<span class="label label-primary option-{{ constant('AppBundle\\BitMask\\ParticipantStatus::TYPE_STATUS_PAID') }}">{{ constant('AppBundle\\BitMask\\ParticipantStatus::LABEL_STATUS_PAID') }}</span>');
                    } else {
                        $('.status-label-list .option-{{ constant('AppBundle\\BitMask\\ParticipantStatus::TYPE_STATUS_PAID') }}').remove();
                    }
                }
            });
        });
    </script>
    {% endcspscript %}
{% endblock %}<commit_msg>Moved messages area in detailed panel into single row⁄<commit_after>{% extends 'base.html.twig' %}

{% block title %}Anmeldung ({{ event.title }}){% endblock %}

{% block body %}
    <div class="modal fade" id="dialogModal" tabindex="-1" role="dialog" aria-labelledby="dialogModalLabel">
        <div class="modal-dialog" role="document">
            {{ form_start(form) }}
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Abbrechen"><span
                                aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="dialogModalLabel"></h4>
                </div>
                <div class="modal-body">
                    <p></p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Abbrechen
                    </button>
                    <input type="submit" class="btn btn-primary" value="Bestätigen"/>
                </div>
            </div>
            {{ form_end(form) }}
        </div>
    </div>
    <div class="container participation-panels collapse-breadcrumb-header">
        <div class="row">
            <div class="col-xs-12">
                <ol class="breadcrumb">
                    <li><a href="{{ path('homepage') }}">Juvem</a></li>
                    <li><a href="{{ path('event_list') }}">Veranstaltungen</a></li>
                    <li><a href="{{ path('event', {'eid': event.eid }) }}">{{ event.title }}</a></li>
                    <li><a href="{{ path('event_participants_list', {'eid': event.eid }) }}">Teilnehmer</a></li>
                    <li class="active">{{ participation|participantsgrouped }}</li>
                </ol>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12 col-md-6">
                <div class="page-header">
                    <h1>Anmeldung <small>{{ participation|participantsgrouped }}</small></h1>
                </div>
            </div>
            <div class="col-xs-12 col-md-6">
                <div class="btn-toolbar" role="toolbar">
                    <div class="btn-group-vertical" role="group">
                        {% if participation.withdrawn %}
                            <button type="button" class="btn btn-default" data-toggle="modal"
                                    data-target="#dialogModal" data-action="reactivate">
                                {{ 'retweet'|glyph }} Anmeldung reaktivieren
                            </button>
                        {% else %}
                            <button type="button" class="btn btn-default" data-toggle="modal"
                                    data-target="#dialogModal" data-action="withdraw">
                                {{ 'share-alt'|glyph }} Anmeldung zurückziehen
                            </button>
                        {% endif %}
                        {% if participation.deletedAt %}
                            <button type="button" class="btn btn-default" data-toggle="modal"
                                    data-target="#dialogModal" data-action="restore">
                                {{ 'repeat'|glyph }}<span class="hidden-xs"> aus Papierkorb</span> wiederherstellen
                            </button>
                        {% else %}
                            <button type="button" class="btn btn-default" data-toggle="modal"
                                    data-target="#dialogModal" data-action="delete">
                                {{ 'trash'|glyph }} in Papierkorb verschieben
                            </button>
                        {% endif %}
                    </div>
                    <div class="btn-group-vertical" role="group">
                        <button type="button" class="btn btn-default" data-element="activebutton"
                                data-entity="Participation"
                                data-property="isConfirmed" data-entity-id="{{ participation.pid }}"
                                data-token="{{ csrf_token('Participation' ~ 'isConfirmed' ~ participation.pid ) }}"
                                data-button-enable-label="Bestätigen & benachrichtigen" data-button-enable-glyph="ok"
                                data-button-disable-label="Bestätigung zurücknehmen"
                                data-button-disable-glyph="remove">{{ 'option-horizontal'|glyph }}</button>
                        <button type="button" class="btn btn-default" data-element="activebutton"
                                data-entity="Participation"
                                data-property="isPaid" data-entity-id="{{ participation.pid }}"
                                data-token="{{ csrf_token('Participation' ~ 'isPaid' ~ participation.pid ) }}"
                                data-button-enable-label="Zahlungseingang vermerken" data-button-enable-glyph="euro"
                                data-button-disable-label="Zahlung zurücknehmen"
                                data-button-disable-glyph="remove">{{ 'option-horizontal'|glyph }}</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12">
                {% include 'common/header/page-global-messages.html.twig' %}
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12 col-sm-6">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-9">
                                <h3 class="panel-title">Anmeldung</h3>
                            </div>
                            <div class="col-xs-3 text-right">
                                <a href="{{ path('admin_edit_phonenumbers', {'eid': event.eid, 'pid': participation.pid}) }}"
                                   class="btn btn-default btn-xs" title="Telefonnummern bearbeiten">{{ 'phone-alt'|glyph }}</a>
                                <a href="{{ path('admin_edit_participation', {'eid': event.eid, 'pid': participation.pid}) }}"
                                   class="btn btn-default btn-xs" title="Anmeldungsdaten bearbeiten">{{ 'pencil'|glyph }}</a>
                            </div>
                        </div>
                    </div>
                    <div class="panel-body">
                        <dl class="dl-horizontal">
                            <dt>Anrede</dt>
                            <dd>{{ participation.salution }}</dd>
                            <dt>Vorname</dt>
                            <dd>{{ participation.nameFirst }}</dd>
                            <dt>Nachname</dt>
                            <dd>{{ participation.nameLast }}</dd>
                            <dt>Telefon</dt>
                            <dd>
                            {% for phoneNumber in participation.phoneNumbers %}
                                <address>
                                    <a href="tel:{{ phone_number_format(phoneNumber.number, 'INTERNATIONAL') }}">{{ phone_number_format(phoneNumber.number, 'INTERNATIONAL') }}</a>
                                    {% if phoneNumber.description %}
                                    <br>
                                    <i>{{ phoneNumber.description }}</i>
                                    {% endif %}
                                </address>
                            {% endfor %}

                            </dd>
                            <dt>Anschrift</dt>
                            <dd class="address-container">
                                <address>
                                    <strong>{{ participation.getName() }}</strong><br>
                                    {{ participation.addressStreet }}<br>
                                    {{ participation.addressZip }} {{ participation.addressCity }}
                                </address>
                            </dd>
                            <dt>E-Mail Adresse</dt>
                            <dd class="address-container">
                                <address>
                                    {{ participation.email }}
                                </address>
                            </dd>
                            {% for fillout in participation.acquisitionAttributeFillouts %}
                                <dt title="{{ fillout.attribute.formDescription }}">{{ fillout.attribute.formTitle }}</dt>
                                <dd>{{ fillout }}</dd>
                            {% endfor %}
                            <dt><abbr title="Eingang der Anmeldung">Eingang</abbr></dt>
                            <dd>{{ participation.createdAt|date("d.m.Y H:i") }}</dd>
                            <dt>
                                <abbr title="Ist die Anmeldung mit einem Benutzerkonto verknüpft, ist dieses hier angegeben">Benutzerkonto</abbr>
                            </dt>
                            <dd>
                                {% if participation.assignedUser %}<a
                                    href="{{ path('user_detail', {'uid': participation.assignedUser.uid}) }}">
                                    {{ participation.assignedUser|fullname }}
                                    </a>
                                {% else %}
                                    <i>(keines)</i>
                                {% endif %}
                            </dd>

                        </dl>
                    </div>
                </div>
            </div>
        {% if participation.participants.count > 1 %}
        </div>
        <div class="row">
        {% endif %}
            {% for participant in participation.participants %}
                <div class="col-xs-12 col-sm-6">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <div class="row">
                                <div class="col-xs-8">
                                    <h3 class="panel-title"><span class="hidden-xs">Teilnehmer </span>{{ participant.nameFirst }}</h3>
                                </div>
                                <div class="col-xs-4 text-right">
                                    <a href="{{ path('admin_add_participant', {'eid': event.eid, 'pid': participation.pid}) }}"
                                       class="btn btn-default btn-xs"
                                       title="Neuen Teilnehmer hinzufügen">{{ 'plus'|glyph }}</a>
                                    <button type="button" class="btn btn-default btn-xs" data-element="activebutton"
                                            data-entity="Participant"
                                            data-property="isWithdrawn" data-entity-id="{{ participant.aid }}"
                                            data-token="{{ csrf_token('Participant' ~ 'isWithdrawn' ~ participant.aid ) }}"
                                            data-button-enable-label="Zurückziehen" data-button-enable-glyph="share-alt"
                                            data-button-disable-label="Reaktivieren"
                                            data-button-disable-glyph="retweet">{{ 'option-horizontal'|glyph }}</button>
                                    <a href="{{ path('admin_edit_participant', {'eid': event.eid, 'pid': participation.pid, 'aid': participant.aid}) }}"
                                       class="btn btn-default btn-xs" title="Bearbeiten">{{ 'pencil'|glyph }}</a>
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="row" id="participant-{{ loop.index }}">
                                <div class="col-xs-12">
                                    <dl class="dl-horizontal">
                                        <dt>Vorname</dt>
                                        <dd>{{ participant.nameFirst }}</dd>
                                        <dt>Nachname</dt>
                                        <dd>{{ participant.nameLast }}</dd>
                                        <dt>Geschlecht</dt>
                                        <dd>{{ participant.getGender(true) }}</dd>
                                        <dt>Geburtsdatum</dt>
                                        <dd>
                                            {{ participant.getBirthday|date("d.m.Y") }}
                                            {% if (participant.hasBirthdayAtEvent) %}
                                                {{ 'gift'|glyph }}
                                            {% endif %}
                                        </dd>
                                        <dt>Alter</dt>
                                        <dd>{{ participant.getAgeAtEvent|number_format(1) }} Jahre bei der
                                            Veranstaltung
                                        </dd>
                                        <dt>Ernährung</dt>
                                        <dd>
                                            {% set participantFood = participant.getFood(true) %}
                                            {% if participantFood.getValue() %}
                                                {{ ' '|bitmask(participantFood) }}
                                            {% else %}
                                                <i>(keine Besonderheiten)</i>
                                            {% endif %}
                                        </dd>
                                        <dt>Medizinische Hinweise</dt>
                                        <dd>
                                            {% if participant.infoMedical %}
                                                {{ participant.infoMedical }}
                                            {% else %}
                                                <i>(keine Besonderheiten)</i>
                                            {% endif %}
                                        </dd>
                                        <dt>Allgemeine Hinweise</dt>
                                        <dd>
                                            {% if participant.infoGeneral %}
                                                {{ participant.infoGeneral }}
                                            {% else %}
                                                <i>(keine Besonderheiten)</i>
                                            {% endif %}
                                        </dd>
                                        {% for fillout in participant.acquisitionAttributeFillouts %}
                                            <dt title="{{ fillout.attribute.formDescription }}">{{ fillout.attribute.formTitle }}</dt>
                                            <dd>{{ fillout }}</dd>
                                        {% endfor %}
                                    </dl>
                                </div>
                            </div>
                            <div class="col-xs-12 status-label-list">
                                {{ ' '|bitmask(participant.getStatus(true), statusFormatter) }}
                            </div>
                        </div>
                        {#
                        <div class="panel-footer">
                        </div>
                        #}
                    </div>
                </div>
            {% endfor %}
        </div>
    </div>

{% endblock %}
{% block javascriptCustom %}
    {% cspscript %}
    <script type='text/javascript'>
        jQuery(document).ready(function () {
            $('#dialogModal').on('show.bs.modal', function (event) {
                var button = $(event.relatedTarget),
                        action = button.data('action'),
                        modal = $(this),
                        title,
                        question;

                switch (action) {
                    case 'delete':
                        title = 'Anmeldung in Papierkorb verschieben';
                        question = 'Soll diese Anmeldung wirklich in den Papierkorb verschoben werden?';
                        break;
                    case 'restore':
                        title = 'Anmeldung aus Papierkorb nehmen';
                        question = 'Soll diese Anmeldung wirklich aus dem Papierkorb herausgeholt werden?';
                        break;
                    case 'withdraw':
                        title = 'Anmeldung zurückziehen';
                        question = 'Soll diese Anmeldung wirklich zurückgezogen werden?';
                        break;
                    case 'reactivate':
                        title = 'Anmeldung reaktivieren';
                        question = 'Soll diese zurückgezogene Anmeldung wirklich wieder aktiviert werden werden?';
                        break;
                }
                modal.find('.modal-title').text(title);
                modal.find('.modal-body > p').text(question);
                modal.find('input[name="form[action]"]').val(action);
            });
            $('[data-property="isConfirmed"]').on('juvem.activeButton.success', function (event, button, response) {
                if (response.value !== null) {
                    $('.status-label-list .option-{{ constant('AppBundle\\BitMask\\ParticipantStatus::TYPE_STATUS_CONFIRMED') }}').each(function (i, el) {
                        el = $(el);
                        if (response.value) {
                            el.text('bestätigt');
                            el.addClass('label-primary');
                            el.removeClass('label-default');
                        } else {
                            el.text('unbestätigt');
                            el.addClass('label-default');
                            el.removeClass('label-primary');
                        }
                    });
                    if (response.value) {
                        $(button).html('{{ 'ok'|glyph }} Bestätigung <i>(E-Mail wird versandt...)</i>');
                        $(button).addClass('disabled');
                        $.ajax({
                            type: 'POST',
                            url: '{{ path('event_participation_confirm_mail') }}',
                            data: {
                                _token: '{{ csrf_token(participation.pid) }}',
                                pid: '{{ participation.pid }}'
                            },
                            datatype: 'json',
                            success: function (response) {
                                $(document).trigger('add-alerts', {
                                    message: 'Die Eltern wurden per E-Mail über die Bestätigung benachrichtigt.',
                                    priority: 'success'
                                });
                            },
                            error: function (response) {
                                $(document).trigger('add-alerts', {
                                    message: 'Beim Versenden der E-Mail Benachrichtigung ist ein Fehler aufgetreten!',
                                    priority: 'error'
                                });
                            },
                            complete: function (response) {
                                $(button).html('{{ 'remove'|glyph }} Bestätigung zurücknehmen');
                                $(button).removeClass('disabled');
                            }
                        });
                    }
                }
            });
            $('[data-property="isPaid"]').on('juvem.activeButton.success', function (event, button, response) {
                if (response.value !== null) {
                    if (response.value) {
                        $('.status-label-list').append('<span class="label label-primary option-{{ constant('AppBundle\\BitMask\\ParticipantStatus::TYPE_STATUS_PAID') }}">{{ constant('AppBundle\\BitMask\\ParticipantStatus::LABEL_STATUS_PAID') }}</span>');
                    } else {
                        $('.status-label-list .option-{{ constant('AppBundle\\BitMask\\ParticipantStatus::TYPE_STATUS_PAID') }}').remove();
                    }
                }
            });
        });
    </script>
    {% endcspscript %}
{% endblock %}
{'fraction_non_alphanumeric': 0.12253079670529922, 'fraction_numerical': 0.0016522098306484924, 'mean_word_length': 0.9352988197677152, 'pattern_counts': {'":': 0, '<': 503, '<?xml version=': 0, '>': 507, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 258, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4739188', 'n_tokens_mistral': 9492, 'n_tokens_neox': 8806, 'n_words': 1576}