{% extends "gestion/base.html" %}
{% load i18n %}
{% load static %}
{% get_current_language as current_language %}
{% load autotranslate %}
{% block titre %}{% trans "L'Ernestophone : Agenda" %}{% endblock %}
{% block content %}

		<!-- Main -->
			<div id="main"  style="background-color:rgb(228, 82, 47);">


			<!-- One -->
				<section class="wrapper style1" >
					<div class="inner">

							<p align="center"><div><span class="image right">
								{% if photo %}
								<img src="{{photo.image.url}}" alt="" />  <div style="position:absolute;z-index:1;right:0;bottom:0">
								{% if photo.url %}
								<a href="{{photo.url}}" target="_blank" class="icon fa-copyright" style="color: {{photo.color}}"> {% if photo.auteur %}{{photo.auteur}}{%endif%}</a>
								{% elif photo.auteur %}
								<div class="icon fa-copyright" style="color: {{photo.color}}" > {{photo.auteur}}</div>

								{% endif %}
								</div>
								{% else %}
								<img src="{% static 'images/agenda.jpg' %}" alt="" />
								<div style="position:absolute;z-index:1;right:0;bottom:0">
								<a href="https://evarin.fr/" target="_blank" class="icon fa-copyright"> Evarin</a>
							</div>
							{% endif %}
						</span></div>
						<h2 align="center">{% trans "Découvrez les différents évènements de l'Ernestophone !" %}</h2>


		<div class="spoilerDiv" onclick="ouvrirFermerSpoiler(this);" align="center">
				<span class="lienAfficher">		<a class="button alt">{% trans "Contactez nous !" %}</a> </span>
				<div class="spoiler">
						<div class="contenuSpoiler">

							<a target="_blank" href="https://www.facebook.com/ernestophone/?eid=ARCf46hEHJqCHtHY0bEb_ZWwiiGyBjipct5g5JZy3tL_NzeNTiobOTeTgubTyWoub68VcLobtjvh3_Cj"

									class="icon fa-facebook fa-5x"><span class="label">Facebook</span></a>
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<a href="mailto:fanfare@ens.fr" class="icon fa-envelope fa-5x "><span

										class="label">Mail</span></a>
									
						</div>
				</div>
		</div>
							</p>

					<h1>{% blocktrans count counter=events_a_venir|length %}Evénement à venir :{% plural %}Evénements à venir {% endblocktrans %} </h1>


						<div class="table-wrapper" color="white">
							<table>
								<thead>
									<tr>
										<th>{% trans "Nom" %}</th>
										<th>{% trans "Date" %}</th>
										<th>{% trans "Lieu" %}</th>
									</tr>
								</thead>
								<tbody>
                  {% for event in events_a_venir %}

									<tr>
										{% if event.description %}
										<td>
										<div class="spoilerDiv" onclick="ouvrirFermerSpoiler(this);" align="center">
												<span class="lienAfficher">	<u style="color:#ffffff">	<a style="cursor:pointer">{{ event.nom }}</a> </u></span>
												<div class="spoiler">
														<div class="contenuSpoiler">
															{% autotranslate current_language event.description event.description_en %}
														</div>
												</div>
										</div>
									</td>
									{% elif event.description_en %}
									<td>
									<div class="spoilerDiv" onclick="ouvrirFermerSpoiler(this);" align="center">
											<span class="lienAfficher">	<u style="color:#ffffff">	<a style="cursor:pointer">{{ event.nom }}</a> </u></span>
											<div class="spoiler">
													<div class="contenuSpoiler">
														 {{event.description_en|safe}}
													</div>
											</div>
									</div>
								</td>
										{% else %}
												<td><div class="spoilerDiv" align="center">{{ event.nom }}</div></td>
										{% endif %}

										<td> {% blocktrans with date=event.date debut=event.debut %}Le {{ date }} à {{ debut }} {% endblocktrans %}</td>
										<td> {{event.lieu}}</td>
									</tr>

                  {% endfor %}

								</tbody>
							</table>
						</div>

						<h1> {% blocktrans count counter=events_passe|length %}Evénement passé :{% plural %}Evénements passés :{% endblocktrans %} </h1>

						<div class="table-wrapper" color="white">
							<table>
								<thead>
									<tr>
										<th>{% trans "Nom" %}</th>
										<th>{% trans "Date" %}</th>
										<th>{% trans "Lieu" %}</th>
									</tr>
								</thead>
								<tbody>
                  {% for event in events_passe %}

									<tr>
										{% if event.description %}
										<td>
										<div class="spoilerDiv" onclick="ouvrirFermerSpoiler(this);" align="center">
												<span class="lienAfficher">	<u style="color:#ffffff">	<a style="cursor:pointer">{% blocktrans with nom=event.nom %}{{ nom }}{% endblocktrans %}</a> </u></span>
												<div class="spoiler">
														<div class="contenuSpoiler">
															{% autotranslate current_language event.description event.description_en %}
														</div>
												</div>
										</div>
									</td>
									{% elif event.description_en %}
									<td>
									<div class="spoilerDiv" onclick="ouvrirFermerSpoiler(this);" align="center">
											<span class="lienAfficher">	<u style="color:#ffffff">	<a style="cursor:pointer">{% blocktrans with nom=event.nom %}{{ nom }}{% endblocktrans %}</a> </u></span>
											<div class="spoiler">
													<div class="contenuSpoiler">
														{{event.description_en|safe}}
													</div>
											</div>
									</div>
								</td>
										{% else %}
												<td><div class="spoilerDiv" align="center">{% blocktrans with nom=event.nom %}{{ nom }}{% endblocktrans %}</div></td>
										{% endif %}

										<td> {% blocktrans with date=event.date debut=event.debut %}Le {{ date }} à {{ debut }} {% endblocktrans %}</td>
										<td> {% blocktrans with lieu=event.lieu %} {{lieu}}{% endblocktrans %}</td>
									</tr>

                  {% endfor %}
								</tbody>
							</table>
						</div>
					</div>
				</section>



			</div>

{% endblock %}
