{% extends 'iconolab_base.html' %}

{% load staticfiles %}

{% load thumbnail %}

{% load iconolab_tags %}

{% load notifications_tags %}

{% block content %}
  <div id="user-profile-block" class="row" style="border: 1px solid gray; padding:15px;">
  	<h3>Tableau de bord - Fonds {{collection.verbose_name}}</h3>
    <h2><small>Filtres et tri</small></h2>
    <form class="form" method="GET" target="">
      <div class="row">
        <div class="form-group col-md-4">
          <label>Trier par 
<!--             <a class="btn btn-default btn-sm">Ajouter un tri</a> -->
          </label><br>
          <select id="first_ordering_select" name="first" class="form-control">
            <option id="first_oldest" value="oldest">Date (plus vieux d'abord)</option>
            <option id="first_recent" value="recent">Date (plus récents d'abord)</option>
            <option id="first_most_viewed" value="most_viewed">Nombre de vues</option>
            <option id="first_most_commented" value="most_commented">Nombre de commentaires</option>
            <option id="first_most_revised" value="most_revised">Nombre de révisions</option>
            <option id="first_most_tagged" value="most_tagged">Nombre de mots-clés</option>
          </select>
<!--           <select id="second_ordering_select" name="second" class="form-control"> -->
<!--             <option id="second_oldest" value="oldest">Date (plus vieux d'abord)</option> -->
<!--             <option id="second_recent" value="recent">Date (plus récents d'abord)</option> -->
<!--             <option id="second_most_viewed" value="most_viewed">Nombre de vues</option> -->
<!--             <option id="second_most_commented" value="most_commented">Nombre de commentaires</option> -->
<!--             <option id="second_most_revised" value="most_revised">Nombre de révisions</option> -->
<!--             <option id="second_most_tagged" value="most_tagged">Nombre de mots-clés</option> -->
<!--           </select> -->
<!--           <select id="third_ordering_select" name="third" class="form-control"> -->
<!--             <option id="third_oldest" value="oldest">Date (plus vieux d'abord)</option> -->
<!--             <option id="third_recent" value="recent">Date (plus récents d'abord)</option> -->
<!--             <option id="third_most_viewed" value="most_viewed">Nombre de vues</option> -->
<!--             <option id="third_most_commented" value="most_commented">Nombre de commentaires</option> -->
<!--             <option id="third_most_revised" value="most_revised">Nombre de révisions</option> -->
<!--             <option id="third_most_tagged" value="most_tagged">Nombre de mots-clés</option> -->
<!--           </select> -->
<!--           <select id="fourth_ordering_select" name="fourth" class="form-control"> -->
<!--             <option id="fourth_oldest" value="oldest">Date (plus vieux d'abord)</option> -->
<!--             <option id="fourth_recent" value="recent">Date (plus récents d'abord)</option> -->
<!--             <option id="fourth_most_viewed" value="most_viewed">Nombre de vues</option> -->
<!--             <option id="fourth_most_commented" value="most_commented">Nombre de commentaires</option> -->
<!--             <option id="fourth_most_revised" value="most_revised">Nombre de révisions</option> -->
<!--             <option id="fourth_most_tagged" value="most_tagged">Nombre de mots-clés</option> -->
<!--           </select> -->
        </div>
        <div class="form-group col-md-6">
          <label>Filtrer par</label><br>
          <b>Mots-clés pertinents:</b> qualification minimale <input type="number" name="min_relevancy" min="0" max="5"></input><br>
          <b>Mots-clés précis:</b> qualification minimale <input type="number" name="min_accuracy" min="0" max="5"></input><br>
          <b>Nombre de commentaires:</b> au moins <input type="number" name="min_comments" min="0"></input><br>
          <b>Nombre de révisions:</b> au moins <input type="number" name="min_revisions" min="0"></input><br>
          <b>Métacatégories:</b><br>
          {% for metacategory in collection.metacategories.all %}
            au moins <input type="number" name="min_metacategory_{{metacategory.id}}" min="0"></input> {{metacategory.label}}<br>
          {% endfor %}
        </div>
      </div>
      <input class="btn btn-default" type="submit" value="Filtrer"></input>
    </form>
    <h2><small>Listes des annotations</small></h2>
    {% include "partials/image_annotations_list.html" with annotation_list=collection_filtered_annotations collection_name=collection.name %}
  </div>
{% endblock %}