<div class="grid-x">
<div class="small-12 auto cell">
<h1>
{{ event.baseInformation.name }}
</h1>
</div>
<div class="small-12 shrink cell">
<div class="grid-x grid-margin-x grid-margin-y">
{% if canEdit is defined and canEdit %}
{% if seminar is defined and seminar %}
<div class="shrink cell">
<a class="button edit" href="{{ path('admin_app_event_event_edit',{'id': event.id}) }}">
{{ 'app.action.common.admin' | trans | capitalize }}
</a>
</div>
{% endif %}
<div class="shrink cell">
<a class="button edit" href="{{ path(type ~ '_edit', {id: event.id, slug: event.baseInformation.slug}) }}">
{{ 'app.action.common.edit' | trans | capitalize }}
</a>
</div>
{% if type == 'event' %}
<div class="shrink cell">
<a class="button" href="{{ path('user_event_historic_edit', {'id': event.id}) }}">Historique</a>
</div>
{% endif %}
{% if event.historic is defined and event.historic %}
<div class="shrink cell">
<a class="button" target="_blank" href="{{ _url }}{{ event.id }}/{{ event.historic.adminToken }}">Lancer </a>
</div>
{% endif %}
{% endif %}
</div>
</div>
</div>
{% if proposalDates.headers is defined and proposalDates.headers | length %}
{% set divid = 12 // (proposalDates.headers | length + 1) %}
{% set namedivid = divid + (12 - (proposalDates.headers | length + 1)*divid) %}
{% set classSize = 'small-'~divid~' large-'~divid %}
{% set nameClassSize = 'cell-border small-'~namedivid~' large-'~namedivid %}
<div class="view-info">
<div class="grid-x grid-margin-x event-list">
<div class="{{ nameClassSize }} event-head">Utilisateur</div>
{% for header in proposalDates.headers %}
<div class="{{ classSize }} event-head">
{{ header.start | format_datetime(pattern='EE d/M HH:mm', locale=app.request.locale) |capitalize }}
{% if header.end is defined and header.end %}
-
{% if header.start | date("dmY") == header.end | date("dmY") %}
{{ header.end | date("H:i") }}
{% else %}
{{ header.end | format_datetime(pattern='EE d/M HH:mm', locale=app.request.locale) |capitalize }}
{% endif %}
{% endif %}
</div>
{% endfor %}
{% for username, proposalDateUsers in proposalDates.userChoice %}
<div class="{{ nameClassSize }}">
{{ username }}
</div>
{% for proposalDateUser in proposalDateUsers %}
<div class="{{ classSize }}">
{% for proposalDate in proposalDateUser %}
{{ proposalDate }}
{% if not loop.last %}
-
{% endif %}
{% endfor %}
</div>
{% endfor %}
{% endfor %}
<div class="{{ nameClassSize }}">
{{ app.user.surname }}
</div>
{% for proposalDateUser in proposalDates.userForm %}
<div class="{{ classSize }}">
{{ form_start(proposalDateUser.form) }}
<div class="grid-x">
<div class="cell small-12">{{ form_errors(proposalDateUser.form) }}</div>
<div class="cell small-12">
{{ form_row(proposalDateUser.form.posts, {id: 'proposal-'~proposalDateUser.id | upper}) }}
</div>
{{ form_rest(proposalDateUser.form) }}
</div>
{{ form_end(proposalDateUser.form) }}
</div>
{% endfor %}
{% if canEdit is defined and canEdit %}
<div class="{{ nameClassSize }}"></div>
{% for header in proposalDates.headers %}
<div class=" {{ classSize }}">
{% for value, number in header.choices %}
{{ number }}
{{ value }}
{% if not loop.last %}
-
{% endif %}
{% endfor %}
<br>
<a href="{{ path('proposal_validation', {id: header.id}) }}" class="button">Valider date</a>
</div>
{% endfor %}
{% endif %}
</div>
</div>
{% endif %}
<div class="grid-x grid-margin-x align-center user-presence">
<div class="cell small-12 grid-margin-x">
<div class="view-info-wrapper">
{% include 'Event/Partials/View/summary.html.twig' %}
</div>
</div>
{% set numberShow = 0 %}
{% if userPosts is defined %}
{% if userPosts.INTENDED.form or userPosts.INTENDED.choices %}
{% set showIndended = true %}
{% set numberShow = numberShow + 1 %}
{% else %}
{% set showIndended = false %}
{% endif %}
{% if userPosts.PREVISION.form or userPosts.PREVISION.choices %}
{% set showPrevision = true %}
{% set numberShow = numberShow + 1 %}
{% else %}
{% set showPrevision = false %}
{% endif %}
{% if userPosts.FINAL.form or userPosts.FINAL.choices %}
{% set showFinal = true %}
{% set numberShow = numberShow + 1 %}
{% else %}
{% set showFinal = false %}
{% endif %}
{% endif %}
{% if numberShow > 0 and (edit is not defined or edit == false) %}
<div class="cell small-12 cell post-choice">
<div class="grid-x grid-margin-x grid-margin-y">
{% set class = 'cell small-12 smedium-' ~ (12 / numberShow) ~ ' medium-' ~ (12 / numberShow) %}
{% include 'Event/Partials/user_event_status.html.twig' with {class: class, class_event: 'event-odd'} %}
</div>
</div>
{% endif %}
</div>
{% if accountantUsers is defined and accountantUsers | length %}
<hr/>
<div class="event-user-posts">
<ul class="tabs" data-tabs id="example-tabs">
{% for postType, posts in accountantUsers %}
<li class="tabs-title {% if loop.index == 1 %}is-active{% endif %}">
<a href="#panel{{postType}}" {% if loop.index == 1 %} aria-selected="true" {% endif %}>
{{ ('app.planning.post.'~postType) | trans | capitalize }}
</a>
</li>
{% endfor %}
</ul>
<div class="tabs-content" data-tabs-content="example-tabs">
{% for postType, posts in accountantUsers %}
<div class="tabs-panel {% if loop.index == 1 %}is-active{% endif %}" id="panel{{postType}}">
<h2>{{ ('app.planning.post.'~postType) | trans | capitalize }}</h2>
<div class="grid-x event-list">
<div class="cell {% if visible %}small-6 medium-3 {% else %} small-6 medium-4 {% endif %} event-head">{{ 'app.planning.wish.post' | trans | capitalize }}</div>
<div class="cell {% if visible %}small-6 medium-3 {% else %} small-6 medium-4 {% endif %} event-head">{{ 'app.planning.wish.member' | trans | capitalize }}</div>
<div class="cell {% if visible %}small-6 medium-3 {% else %} small-12 medium-4 {% endif %} event-head">{{ 'app.planning.wish.email' | trans | capitalize }}</div>
{% if visible %}
<div class="cell small-6 medium-3 event-head">{{ 'app.planning.wish.phone' | trans | capitalize }}</div>
{% endif %}
</div>
<div class="grid-x event-list">
{% for post, users in posts %}
{% for userFinal in users %}
{% if loop.index is odd %}
{% set class_event = 'cell-border event-odd' %}
{% else %}
{% set class_event = 'cell-border event-even' %}
{% endif %}
<div class="{% if visible %}small-6 medium-3 {% else %} small-6 medium-4 {% endif %} {{ class_event }}">{{ post }}</div>
<div class="{% if visible %}small-6 medium-3 {% else %} small-6 medium-4 {% endif %} {{ class_event }}">{{ userFinal.surname }}</div>
<div class="{% if visible %}small-6 medium-3 {% else %} small-12 medium-4 {% endif %} {{ class_event }}">
{% if (userFinal.contact is not defined or userFinal.contact.mailShow) and userFinal.email %}
<a target="_blank" href="mailto:{{ userFinal.email }}">
{{ userFinal.email }}
</a>
{% endif %}
</div>
{% if visible %}
<div class="small-6 medium-3 {{ class_event }}">
{% if userFinal.contact is defined and userFinal.contact.telShow and userFinal.contact.tel %}
<a href="tel:{{ userFinal.contact.tel }}">
{{ userFinal.contact.tel }}
</a>
{% endif %}
</div>
{% endif %}
{% endfor %}
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% if
(event.cmsDescription is not null and event.cmsDescription.content is not empty) or
(event.cmsOrganisation is not null and event.cmsOrganisation.content is not empty)
%}
<hr/>
{% endif %}
{% if event.cmsDescription is not null and event.cmsDescription.content is not empty %}
<div class="boxed">
{% if event.cmsDescription is not null and event.cmsDescription.content is not empty %}
<h1>{{ 'app.planning.description' | trans | capitalize }}</h1>
{% include 'CMS/viewTemplateFromContent.html.twig' with {'data': event.cmsDescription.content, 'prefix': 'description'} %}
{% endif %}
</div>
{% endif %}
{% if event.cmsOrganisation is not null and event.cmsOrganisation.content is not empty %}
<div class="boxed">
{% if event.cmsOrganisation is not null and event.cmsOrganisation.content is not empty %}
<h1>{{ 'app.planning.organization' | trans | capitalize }}</h1>
{% include 'CMS/viewTemplateFromContent.html.twig' with {'data': event.cmsOrganisation.content, 'prefix': 'organisation'} %}
{% endif %}
</div>
{% endif %}