{% extends "gestion/base.html" %}
{% load staticfiles %}
{% load frenchmonth %}
{% load i18n %}
{% load translate %}
{% load autotranslate %}

{% get_current_language as current_language %}

{% block extrahead %}
<link rel="stylesheet" href="{% static 'css/calend.css' %}" />
{% endblock %}

{% block titre %}{% trans "L'Ernestophone : Agenda" %} {% endblock %}

{% block content %}

<div id="main">
        <section class="wrapper style1">

        <div class="inner">

            <div id="instagram-feed" class="instagram_feed"> </div>



<div class="row">
    <div class="6u 12u$(small)">

      {% if actu %}
      <div class="box" style="background-color:rgba(228,82,47,0.5)">

	      <h4> <span class="ernestocouleur">{% blocktrans count counter=actu|length %}Actualité des chef·fe·s:{% plural %}Actualités des chef·fe·s:{% endblocktrans %}</span></h4>
          <ul>
            {% for a in actu %}
	    <li>{% if a.rainbow == 'y' %}<span class="ernestocouleur font-weight-bold">{% endif %}{% autotranslate current_language a.text a.text_en %}{% if a.rainbow %}</span>{% endif %}</li>
            {% endfor %}
          </ul>
          </div>
      {% endif %}
      <h4><span class="ernestocouleur">{% trans "Agenda :" %}</span></h4>
<table width="100%" style="background-color:#e4522f" >
    <tr>
        <td width="20%" align="left">
          &lt;&lt;
          {% ifequal current_language "fr" %}
          <a href="{% url "calendrier:view-month" PreviousYear PreviousMonth %}">{{PreviousMonthName|frenchmonth}} {{PreviousYear}}</a>
          {% else %}
            <a href="{% url "calendrier:view-month" PreviousYear PreviousMonth %}">{{PreviousMonthName}} {{PreviousYear}}</a>
          {% endifequal %}
        </td>
        <td width="20%" align="center"><a href="{% url "calendrier:home" %}">{% trans "Aujourd'hui" %}</a></td>
        <td width="20%" align="right">
          {% ifequal current_language "fr" %}
            <a href="{% url "calendrier:view-month" NextYear NextMonth %}">{{NextMonthName|frenchmonth}} {{NextYear}}</a> &gt;&gt;
            {% else %}
              <a href="{% url "calendrier:view-month" NextYear NextMonth %}">{{NextMonthName}} {{NextYear}}</a> &gt;&gt;
            {% endifequal %}
        </td>
    </tr>
</table>
<div id="calendar">
  {% if user.profile.is_chef_event or user.profile.is_chef %}
  {% ifequal current_language "fr" %}
  {{Calendar_chef|translate}}
  {% else %}
  {{Calendar_chef}}
  {% endifequal %}
  {% else %}
  {% ifequal current_language "fr" %}
  {{Calendar|translate}}
  {% else %}
  {{Calendar}}
  {% endifequal %}
  {% endif%}
</div>
{% if user.profile.is_chef_event or user.profile.is_chef %}
<a href="{% url "calendrier:create_event" %}" class="button">{% trans "Ajouter un évènement" %}</a>
{% endif %}
</div>
<div class="1u 12u$(small)"><p></p></div>
<div class="5u 12u$(small)">

  <span class="image fit">
    {% 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/home.png' %}"/>
  <div style="position:absolute;z-index:1;right:0;bottom:0">
  <div class="icon fa-copyright"> lor_tie</div>
  </div>
    {% endif %}
  </span>
  {% if user.profile.is_chef_event or user.profile.is_chef %}
  {% if events_a_venir_chef %}
  <div class="box" style="background-color:#4169E1">
  <h1> {% blocktrans count counter=events_a_venir_chef|length %}Doodle seulement visible par les cheff·e·s :{% plural %}Doodles seulement visibles par les cheff·e·s :{% endblocktrans %} </h1>
  <div class="table-wrapper">
    <table class="default">
      <thead>
        <tr>
          <th>{% trans "Nom" %}</th>
          <th>{% trans "Date" %}</th>
          <th>{% trans "Lieu" %}</th>
        </tr>
      </thead>
        <tbody>
          {% for e in events_a_venir_chef %}
          <tr>
          <td><b><u><a href="{% url 'calendrier:view-event' e.id %}">{{ e.nom }}</a></u></b></td>

            <td>{% blocktrans with date=e.date debut=e.debut %}Le {{ date }} à {{ debut }} {% endblocktrans %} </td>
            <td> {{e.lieu}}</td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
  </div>
  {% endif %}
  {% if events_a_venir_chef_public %}
  <div class="box" style="background-color:#a9008a">
  <h1> {% blocktrans count counter=events_a_venir_chef_public|length %}Doodle visible par les cheff·e·s et le public :{% plural %}Doodles seulement visibles par les cheff·e·s :{% endblocktrans %} </h1>
  <div class="table-wrapper">
    <table class="default">
      <thead>
        <tr>
          <th>{% trans "Nom" %}</th>
          <th>{% trans "Date" %}</th>
          <th>{% trans "Lieu" %}</th>
        </tr>
      </thead>
        <tbody>
          {% for e in events_a_venir_chef_public %}
          <tr>
          <td><b><u><a href="{% url 'calendrier:view-event' e.id %}">{{ e.nom }}</a></u></b></td>

            <td>{% blocktrans with date=e.date debut=e.debut %}Le {{ date }} à {{ debut }} {% endblocktrans %} </td>
            <td> {{e.lieu}}</td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
  </div>
  {% endif %}
  {% endif %}
  {% if events_a_venir_not_answered %}
  <div class="box" style="background-color:#e4522f">
  <h1> {% blocktrans count counter=events_a_venir_not_answered|length %}Doodle à remplir !!!! :{% plural %}Doodles à remplir !!!! :{% endblocktrans %} </h1>
  <div class="table-wrapper">
    <table class="default">
      <thead>
        <tr>
          <th>{% trans "Nom" %}</th>
          <th>{% trans "Date" %}</th>
          <th>{% trans "Lieu" %}</th>
        </tr>
      </thead>
        <tbody>
          {% for e in events_a_venir_not_answered %}
          <tr>
          <td><b><u><a href="{% url 'calendrier:view-event' e.id %}">{{ e.nom }}</a></u></b></td>

            <td>{% blocktrans with date=e.date debut=e.debut %}Le {{ date }} à {{ debut }} {% endblocktrans %} </td>
            <td> {{e.lieu}}</td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
</div>
{% endif %}
{% if events_a_venir_answered_yes %}
<div class="box" style="background-color:#d0fa98">

  <h1 style="color:#666160">{% blocktrans count counter=events_a_venir_answered_yes|length %}Evénement auquel je compte participer (réponse Oui):{% plural %}Evénements auquels je compte participer (réponse Oui):{% endblocktrans %} </h1>

  <div class="table-wrapper">
    <table class="default" >
      <thead>
        <tr>
          <th style="color:#666160">{% trans "Nom" %}</th>
          <th style="color:#666160" >{% trans "Date" %}</th>
          <th style="color:#666160" >{% trans "Lieu" %}</th>
        </tr>
      </thead>
        <tbody>
          {% for e in events_a_venir_answered_yes %}
          <tr>
          <td  style="color:#666160"><b><u style="color:#666160"><a style="color:#666160" href="{% url 'calendrier:view-event' e.id %}">{{ e.nom }}</a></u></b></td>

            <td  style="color:#666160"> {% blocktrans with date=e.date debut=e.debut %}Le {{ date }} à {{ debut }} {% endblocktrans %} </td>
            <td  style="color:#666160"> {{e.lieu}}</td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
    </div>
</div>
{% endif %}
{% if events_a_venir_answered_pe %}
<div class="box" style="background-color:#ffd98c">

    <h1 style="color:#666160"> {% blocktrans count counter=events_a_venir_answered_pe|length %}Evénement à confirmer (réponse Peut être):{% plural %}Evénements à confirmer (réponse Peut être):{% endblocktrans %} </h1>

    <div class="table-wrapper">
      <table class="default" >
        <thead>
          <tr>
            <th style="color:#666160">{% trans "Nom" %}</th>
            <th style="color:#666160" >{% trans "Date" %}</th>
            <th style="color:#666160" >{% trans "Lieu" %}</th>
          </tr>
        </thead>
          <tbody>
            {% for e in events_a_venir_answered_pe %}
            <tr>
            <td  style="color:#666160"><b><u style="color:#666160"><a style="color:#666160" href="{% url 'calendrier:view-event' e.id %}">{{ e.nom }}</a></u></b></td>

              <td  style="color:#666160"> {% blocktrans with date=e.date debut=e.debut %}Le {{ date }} à {{ debut }} {% endblocktrans %} </td>
              <td  style="color:#666160"> {{e.lieu}}</td>
            </tr>
            {% endfor %}
          </tbody>
        </table>
      </div>
    </div>
{% endif %}
{% if events_a_venir_answered_no %}
<div class="box" style="background-color:#f79583">

      <h1 style="color:#666160"> {% blocktrans count counter=events_a_venir_answered_no|length %}Evénement sans moi (réponse Non):{% plural %}Evénements sans moi (réponse Non):{% endblocktrans %} </h1>

      <div class="table-wrapper">
        <table class="default" >
          <thead>
            <tr>
              <th style="color:#666160">{% trans "Nom" %}</th>
              <th style="color:#666160" >{% trans "Date" %}</th>
              <th style="color:#666160" >{% trans "Lieu" %}</th>
            </tr>
          </thead>
            <tbody>
              {% for e in events_a_venir_answered_no %}
              <tr>
              <td  style="color:#666160"><b><u style="color:#666160"><a style="color:#666160" href="{% url 'calendrier:view-event' e.id %}">{{ e.nom }}</a></u></b></td>

                <td  style="color:#666160">{% blocktrans with date=e.date debut=e.debut %}Le {{ date }} à {{ debut }} {% endblocktrans %}</td>
                <td  style="color:#666160"> {{e.lieu}}</td>
              </tr>
              {% endfor %}
            </tbody>
          </table>
        </div>
      </div>
{% endif %}

</div>
</div>
</div>
</section>
</div>

<script src="{% static 'js/InstagramFeed.min.js' %}"></script>

<script>
    (function(){
        new InstagramFeed({
            'username': 'ernestophone',
            'container': "#instagram-feed" ,
            'display_profile': false,
            'display_biography': false,
            'display_gallery': true,
            'display_captions': true,
            'callback': null,
            'styling': true,
            'items': 8,
            'items_per_row': 8,
            'margin': 1
        });
    })();
</script>
{% endblock %}
