{% extends "gestion/base.html" %}
{% load static %}
{% load i18n %}
{% block titre %}{% trans "Instruments" %}{% endblock %}
{% block content %}
<div id="main">
        <section class="wrapper style1">
        <div class="inner">
          <h3>Si tu empruntes un instrument de la fanfare, découvre tes droits et tes devoirs dans <a target="blank" href="{% static 'documents/responsabilite_instru.pdf' %}" style="color:#e4522f">ce document</a></h3>
        <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/instruments.jpg' %}" alt="" />  <div style="position:absolute;z-index:1;right:0;bottom:0">
          <div class="icon fa-copyright" style="color:#000000"> Lucas Gierzack</div></div>
          {% endif %}
        </span>
        {% if user.profile.is_chef or user.profile.is_chef_instru %}
        <a href="{% url "instruments:ajouter_instru" %}" class="button alt big">{% trans "Ajouter un instrument" %}</a>
        {% endif %}
        <p></p>
          <h4>{% trans "Instruments Disponibles :" %} </h4>
                  <div class="table-wrapper">
    								<table class="default">
    									<thead>
    										<tr>
    											<th>{% trans "Intrument" %}</th>
    											<th>{% trans "Propriétaire" %}</th>
                          <th>{% trans "Etat" %}</th>
    										</tr>
    									</thead>
                      	<tbody>
                            {% for instrument in instrus_dispo %}

                            <tr>
                              <td> <u> <a href="{% url "instruments:fiche_instru" instrument.id %}">{{ instrument.type }} </a></u></td>
                              <td> {{ instrument.owner  }} </td>
                              <td> {{ instrument.etat  }} </td>
                                <td>
                                <a href="{% url "instruments:fiche_instru" instrument.id %}" class="button small">{% trans "Consulter" %}<a/>
                              {% if user.profile.is_chef or user.profile.is_chef_instru %}

                                <a href="{% url "instruments:delete_instru" instrument.id %}" class="button small">{% trans "Supprimer" %}
                              {% endif %}
                              </td>
                            </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                  </div>
        </div>
          </section>
          <section class="wrapper style2">
          <div class="inner">
            <h4>{% trans "Instruments Prêtés :" %} </h4>
                    <div class="table-wrapper">
                      <table class="default">
                        <thead>
                          <tr>

                            <th>{% trans "Intrument" %}</th>
                            <th>{% trans "Propriétaire" %}</th>
                            <th>{% trans "Utilisateur" %}</th>
                            <th>{% trans "Etat" %}</th>

                          </tr>
                        </thead>
                          <tbody>
                              {% for instrument in instrus_prete %}
                            <tr>

                                <td> <u><a href="{% url "instruments:fiche_instru" instrument.id %}">{{ instrument.type }}</a></u></td>
                                <td> {{ instrument.owner  }} </td>
                                <td> {{ instrument.user }} </td>
                                <td> {{ instrument.etat}} </td>
                                <td>
                                <a href="{% url "instruments:fiche_instru" instrument.id %}" class="button small">{% trans "Consulter" %}<a/>
                                {% if user.profile.is_chef or user.profile.is_chef_instru %}

                                  <a href="{% url "instruments:delete_instru" instrument.id %}" class="button small">{% trans "Supprimer" %}
                                {% endif %}
                                </td>
                              </tr>
                              {% endfor %}

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

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


    </div>
{% endblock %}
