{% if schedule_detail is defined and schedule_detail %}
<table summary="calendrier des représentations de {{ data_spectacles.title }}" id="table_calendrier">
<thead>
<tr>
<th>Période</th>
<th>Lieu</th>
<th>Réservation</th>
</tr>
</thead>
<tbody>
{% for key,value in schedule_detail %}
<tr>
{% if value.dateshours.periode is defined%}
<td class="dates">
<div class="ville tc-textwrap-lieuville-calendar" >
{% if value.city is defined and value.city %}
{{ value.city }}
{% endif %}
{% if value.country is defined and value.country %}
{{ value.country }}
{% endif %}
</div>
<div class="ldates">
{% for date,dateinfos in value.dateshours %}
{% if dateinfos.datedebut is defined and dateinfos.datedebut %}
<span class="tc-text-label-inline">{% trans %}du{% endtrans %}</span>
<span class="tc-textwrap-date">{{ dateinfos.datedebut }}</span>
{% endif %}
{% if dateinfos.datefin is defined and dateinfos.datefin %}
<span class="tc-text-label-inline">{% trans %}au{% endtrans %}</span>
<span class="tc-textwrap-date">{{ dateinfos.datefin }}</span>
<br/>
{% if dateinfos.is_cancelled is defined and dateinfos.is_cancelled %}
<span class="tc-icon-warning tc-text-label-inline tc-color-spectacles"> représentation(s) annulée(s)</span><br/>
{% endif %}
<div class="details_action"><a href="javascript:;" id="detailaction_{{ key }}" title="Cliquez pour voir le détail des dates">
<span class="tc-icon-plus"></span>{% trans %}detail_dates{% endtrans %}</a>
</div>
{% endif %}
{% endfor %}
</div>
</td>
{% else %}
<td class="dates">
<div class="ville tc-textwrap-lieuville-calendar" >
{% if value.city is defined and value.city is not empty %}
{{ value.city }}
{% endif %}
{% if country is defined and country %}
{{ value.country }}
{% endif %}
</div>
<div class="ldates tc-textwrap-date">
{% trans %}lagarce_scene_le{% endtrans %} {{ value.dateshours.date }}<br>
{% if value.dateshours.is_cancelled is defined and value.dateshours.is_cancelled %}
<span class="tc-icon-warning tc-text-label-inline tc-color-spectacles">représentation(s) annulée(s)</span>
{% else %}
{% for key,hour in value.dateshours.hours %}
{% if hour.hour is defined and hour.hour %}
{{ hour.hour }}
{% endif %}
{% if hour.note is defined and hour.note %}
{{ hour.note }}
{% endif %}
{% endfor %}
<br>
{% endif %}
{# {% for key,hour in value.dateshours.hours %}{{ hour.hour }} {{ hour.note }}{% endfor %}<br>#}
</div>
</td>
{% endif %}
<td class="lieu">
{% if value.profilepicture is defined and value.profilepicture %}
<div class="profilepicture">
<a href="/contacts/{{ value.url_clean }}/" class="popup">
<img src="{{ value.profilepicture }}" alt="{{ value.organisation }}"/>
</a>
</div>
{% endif %}
<a href="/contacts/{{ value.url_clean }}/" class="popup tc-textwrap-lieuville" title="Informations sur ce contact (nouvelle fenêtre)">{{ value.organisation }}</a><br />
{% if value.festival is defined and value.festival %}
<br /><small>En partenariat avec</small> <a class="popup tc-textwrap-lieuville" href="/contacts/{{ value.festival.url_clean }}/">{{ value.festival.organisation }}</a>
{% endif %}
</td>
<td class="resa">
{% if value.url_booking is defined and value.url_booking %}
<a href="{{ value.url_booking }}" class="tc-btn-simple infos_lieu popup">Réservation en ligne</a><br>
{% endif %}
{% if value.phone2 is defined and value.phone2 %}
Tel. {{ value.phone2 }}
{% elseif value.phone1 is defined and value.phone1 %}
<br>Tel. {{ value.phone1 }}
{% endif %}
</td>
<td class="details_action_mobile">
<div class="details_action"><a href="javascript:;" id="detailaction_{{ key }}" title="Cliquez pour voir le détail des dates">
<span class="tc-icon-plus"></span>{% trans %}detail_dates{% endtrans %}</a>
</div>
</td>
</tr>
{% if value.dateshours.periode is defined and value.dateshours.periode %}
<tr class="detailsdate_hidden datesd" id="detailsdate{{ key }}">
<td colspan="4">
{% if viewlist is defined and viewlist %}
<ul>
{% for date,dateinfos in value.dateshours %}
{% if dateinfos.hours is defined and dateinfos.hours %}
<li>
{% trans %}lagarce_scene_le{% endtrans %} {{ date }}
{% if value.dateshours.is_cancelled is defined and value.dateshours.is_cancelled %}
<span class="tc-color-spectacles">représentation(s) annulée(s)</span>
{% else %}
{% for key,hour in dateinfos.hours %}
{% if hour.hour is defined and hour.hour %}
{{ hour.hour }}
{% endif %}
{% if hour.note is defined and hour.note %}
{{ hour.note }}
{% endif %}
{% endfor %}
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
{% elseif value.calendar is defined and value.calendar %}
{% for calendar in value.calendar %}
{{ calendar|raw }}
{% endfor %}
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
{% else %}
<p><strong>{% trans %}no_date_spectacle{% endtrans %}.</strong>
{% if ancien is defined and ancien %}<br />
{% trans %}calendrier_representation_1{% endtrans %} <a href="{{ ancien }}">{% trans %}calendrier_representation_2{% endtrans %}</a>.
{% endif %}
</p>
{% endif %}
<script type="text/javascript">
$(document).ready(function() {
$('#table_calendrier .calendar .highlighted, #table_calendrier .calendar .highlighted_passed').qtip({
style: { name: 'dark' },
position: { corner: { target: 'topRight', tooltip: 'bottomLeft' } }
});
});
</script>