2012-06-14 01:22:04 +02:00
{% extends "request_base.html" %}
2012-06-22 23:12:17 +02:00
{% load sekizai_tags %}
2012-06-14 01:22:04 +02:00
{% load urlbuilder %}
{% load url from future %}
2012-07-24 15:13:58 +02:00
{% load polynum %}
2012-06-14 01:22:04 +02:00
{% block breadcrumb %}
< p > Tableau de bord< / p >
{% endblock %}
2012-06-22 23:12:17 +02:00
2012-06-14 01:22:04 +02:00
{% block content %}
2012-06-22 23:12:17 +02:00
{% addtoblock "endscripts" %}
< script type = "text/javascript" >
$(function () {
2012-10-03 12:14:58 +02:00
$('#from-date-datepicker').datepicker();
$('#from_date').change(
2012-06-22 23:12:17 +02:00
function (ev) {
2012-10-03 12:14:58 +02:00
$('#date-form').submit();
2012-06-22 23:12:17 +02:00
});
2012-10-03 12:14:58 +02:00
$('#to-date-datepicker').datepicker();
$('#to_date').change(
2012-06-22 23:12:17 +02:00
function (ev) {
2012-10-03 12:14:58 +02:00
$('#date-form').submit();
2012-06-22 23:12:17 +02:00
});
});
< / script >
{% endaddtoblock %}
2012-06-22 18:13:18 +02:00
{% comment %}
Here starts the filter block
{% endcomment %}
{% if filters or filter_choices %}
2012-06-14 01:22:04 +02:00
< div id = "filters" class = "well" >
2012-06-22 18:13:18 +02:00
{% if filters %}
< div >
< span class = "title" > Filtres< / span >
{% for name, value, display_list in filters %}
< div id = "filter-group-{{name}}" class = "filter-group" >
{% for caption, delete_url in display_list %}
< span class = "filter-element label" > {{ caption }} < a class = "icon-remove" href = "{{delete_url}}" > < / a > < / span >
{% endfor %}
< / div >
{% endfor %}
< / div >
2012-06-14 01:22:04 +02:00
{% endif %}
2012-06-22 18:13:18 +02:00
{% if filter_choices %}
2012-10-03 12:16:18 +02:00
< div id = "filter-choices-container" > < a data-toggle = "collapse" data-target = "#filter-panel" id = "filter-choices-title" > < h4 > Ajouter des filtres< / h4 > < / a >
2012-07-24 14:47:06 +02:00
< div id = "filter-panel" >
2012-09-06 12:04:00 +02:00
< div id = "filter-text-libre" > < label class = "filter-title" > Texte libre< / label >
2012-11-28 17:56:39 +01:00
< form style = "margin-bottom: 0px" class = "form-search" >
< div class = "input-append" >
< input name = "filter_free_text" type = "text" value = "{{ request.GET.filter_free_text }}" placeholder = "Titre du document, Nom du commanditaire, Destinataire, Nom du fichier" class = "input-xxlarge search-query" / >
< button type = "submit" class = "btn" > Filtrer< / button >
< / div >
2012-09-06 12:04:00 +02:00
{% for key, value in request.GET.iteritems %}
2012-09-06 15:31:27 +02:00
{% if key != "filter_free_text" %}
2012-09-06 12:04:00 +02:00
< input name = "{{key}}" value = "{{value}}" type = "hidden" / >
{% endif %}
{% endfor %}
< / form >
< / div >
2012-06-22 18:13:18 +02:00
{% for filter_choice in filter_choices %}
2012-07-24 14:20:09 +02:00
< div id = "filter-{{ filter_choice.caption|slugify}}" > < label class = "filter-title" > {{ filter_choice.caption }}< / label >
2012-07-24 14:47:06 +02:00
< p class = "filter-choices {% if filter_choice.choices|length > 5 %}long{% endif %}" >
{% for url, caption in filter_choice.choices %}
< span class = "filter-label" > < a href = "{{ url }}" > {{ caption }}< / a > < / span >
{% endfor %}
< / p >
2012-06-22 18:13:18 +02:00
< / div >
{% endfor %}
2012-06-22 23:12:17 +02:00
< form action = "{{qs}}" id = 'date-form' method = 'post' >
{% csrf_token %}
< div id = "from-date-datepicker" class = "input-append date" data-date = "{% if request.GET.filter_from_date %}{{request.GET.filter_from_date}}{% else %}{{ now }}{% endif %}" data-date-format = "yyyy-mm-dd" >
2012-07-24 14:47:06 +02:00
< label for = "from_date" > À livrer après:< / label >
< div class = "filter-choices" >
< input name = "from_date" id = "from_date" type = "text" value = "{{request.GET.filter_from_date}}" readonly > < span class = "add-on" > < i class = "icon-th" > < / i > < / span >
< / div >
< / div >
< div id = "to-date-datepicker" class = "input-append date" data-date = "{% if request.GET.filter_to_date %}{{request.GET.filter_to_date}}{% else %}{{ now }}{% endif %}" data-date-format = "yyyy-mm-dd" >
< label for = "to_date" > À livrer avant:< / label >
< div class = "filter-choices" >
< input name = "to_date" id = "to_date" type = "text" value = "{{request.GET.filter_to_date}}" readonly > < span class = "add-on" > < i class = "icon-th" > < / i > < / span >
< / div >
< / div >
2012-06-22 23:12:17 +02:00
< / form >
2012-06-22 18:13:18 +02:00
< / div >
2012-06-14 01:22:04 +02:00
< / div >
2012-06-14 12:34:42 +02:00
{% endif %}
2012-06-14 01:22:04 +02:00
< / div >
2012-06-22 18:13:18 +02:00
{% endif %}
2012-06-14 01:22:04 +02:00
2012-06-22 18:13:18 +02:00
{% if not paginator.count %}
2012-06-26 09:59:14 +02:00
< h1 > Aucune demande trouvée< / h1 >
2012-06-22 18:13:18 +02:00
{% else %}
2012-06-22 23:12:17 +02:00
< p class = "alert alert-info" >
Pour obtenir des détails sur une demande, cliquer sur sa ligne.
< / p >
2012-06-22 18:13:18 +02:00
< p > {{ paginator.count }} demande{% if paginator.count > 1 %}s{% endif %} trouvée{% if paginator.count > 1 %}s{% endif %} pour un coût de {{ total_cost|floatformat }} €< / p >
2012-09-06 12:59:08 +02:00
< p > < a href = "csv/?{{request.GET.urlencode}}" rel = "tooltip" title = "exportez le résultat de votre recherche au format « tableur »" > Export tableur< / a > < / p >
2016-02-29 00:40:30 +01:00
{% with has_role_reprography=user.has_role_reprography %}
2012-06-14 01:22:04 +02:00
< table id = "request-list-table" class = "table table-bordered table-striped table-condensed" >
< thead >
< tr >
2012-07-10 17:35:16 +02:00
< th > < / th >
2012-09-05 16:20:55 +02:00
< th > < a href = "{% sort_url 'id' %}" > {% sort_indicator 'id' '↑' '↓' '' %}N° < / a > < / th >
2016-02-29 00:40:30 +01:00
{% if has_role_reprography %}
< th > Valideur< / th >
{% else %}
2012-07-23 23:07:11 +02:00
< th > < a href = "{% sort_url 'user' %}" > {% sort_indicator 'user' '↑' '↓' '' %}Demandeur (commanditaire)< / a > < / th >
2016-02-29 00:40:30 +01:00
{% endif %}
2012-07-23 23:07:11 +02:00
< th > < a href = "{% sort_url 'entity__name' %}" > {% sort_indicator 'entity__name' '↑' '↓' '' %}Service< / a > < / th >
2012-09-05 13:44:48 +02:00
< th > < a href = "{% sort_url 'nb_pages' %}" title = "Nombre de pages du document" > {% sort_indicator 'nb_pages' '↑' '↓' '' %}Nb. pages< / a > < / th >
< th > < a href = "{% sort_url 'copies' %}" title = "Nombre d'exemplaires" > {% sort_indicator 'copies' '↑' '↓' '' %}Nb. d'ex.< / a > < / th >
2012-06-14 01:22:04 +02:00
< th > < a href = "{% sort_url 'status' %}" > {% sort_indicator 'status' '↑' '↓' '' %}ÉTAT< / a > < / th >
2012-09-05 13:44:48 +02:00
< th > < a href = "{% sort_url 'creation_date' %}" title = "Date de création" > {% sort_indicator 'creation_date' '↑' '↓' '' %}Création< / a > < / th >
< th > < a href = "{% sort_url 'delivery_date' %}" title = "Date de livraison" > {% sort_indicator 'delivery_date' '↑' '↓' '' %}Livraison< / a > < / th >
2017-11-29 10:47:58 +01:00
< th > < a href = "{% sort_url 'financial_code' %}" > {% sort_indicator 'financial_code' '↑' '↓' '' %}Code d'imputation< / a > < / th >
2012-07-23 23:07:11 +02:00
< th > < a href = "{% sort_url 'cost' %}" > {% sort_indicator 'cost' '↑' '↓' '' %}Coût< / a > < / th >
2012-06-14 01:22:04 +02:00
< / tr >
< / thead >
< tbody >
{% for request in requests %}
{% with doc=request.document id=request.id%}
{% url 'request_detail' pk=request.pk as the_url %}
2016-02-29 00:20:07 +01:00
< tr class = "request-row request-status-{{request.status.code}}" data-detail = "{{the_url}}" >
2012-07-24 15:13:58 +02:00
< td class = "see-button" > < a href = "{{the_url}}" class = "btn" > < strong > Voir< / strong > < / a > < / td >
< td class = "number" > < a href = "{{the_url}}" > {{ request.request_number }}< / a > < / td >
2016-02-29 00:40:30 +01:00
{% if has_role_reprography %}
< td class = "sponsor" > < a href = "{{the_url}}" > {{ request.history_set.last_show_in_details.user.get_full_name }}< / a > < / td >
{% else %}
2012-07-25 02:01:22 +02:00
< td class = "sponsor" > < a href = "{{the_url}}" > {{ request.sponsor_display|widont }}< / a > < / td >
2016-02-29 00:40:30 +01:00
{% endif %}
2012-07-24 15:13:58 +02:00
< td class = "entity" > < a href = "{{the_url}}" > {% if request.entity %}{{ request.entity.get_description|title|widont }}{% else %}Aucune{% endif %}< / a > < / td >
< td class = "pages" > < a href = "{{the_url}}" > {{ request.nb_pages }}< / a > < / td >
< td class = "copies" > < a href = "{{the_url}}" > {{ request.copies}}< / a > < / td >
2012-07-25 02:01:22 +02:00
< td class = "status-column status-{{ request.status|widont }}" > < a href = "{{the_url}}" { % if request . status . description % } rel = "tooltip" title = "{{request.status.description}}" { % endif % } > {{ request.status }}< / a > < / td >
2012-07-24 15:13:58 +02:00
< td class = "creation-date" > < a href = "{{the_url}}" > {{ request.creation_date|date:"d.m.y" }}< / a > < / td >
< td class = "delivery-date" > < a href = "{{the_url}}" > {% if request.delivery_date %}{{ request.delivery_date|date:"d.m.y" }}{% else %}Aucune{% endif %}< / a > < / td >
< td class = "financial-code" > {{ request.financial_code }}< / td >
2012-09-05 16:56:00 +02:00
< td class = "cost" > {% if request.cost %}{{ request.cost|floatformat:"-2" }}{% else %}≈ {{ request.estimated_cost|floatformat:"-2" }}{% endif %} €< / td >
2012-06-14 01:22:04 +02:00
< / tr >
{% endwith %}
{% endfor %}
< / tbody >
< caption >
2012-06-29 17:57:14 +02:00
{% if is_paginated %}
{% if page_obj.has_previous %}
< span class = "page-link" > < a href = "{% param_url " page " page_obj . previous_page_number % } " > précédents< / a > < / span > |
{% endif %}
< span class = "page-current" > {{ page_obj.number }}< / span >
{% if page_obj.has_next%}
| < span class = "page-link" > < a href = "{% param_url " page " page_obj . next_page_number % } " > suivants< / a > < / span >
{% endif %}
2012-06-14 01:22:04 +02:00
{% endif %}
2012-06-29 17:57:14 +02:00
< / caption >
2012-06-14 01:22:04 +02:00
< / table >
2016-02-29 00:40:30 +01:00
{% endwith %}
2012-06-22 18:13:18 +02:00
{% endif %}
2012-06-14 01:22:04 +02:00
2012-06-26 09:59:07 +02:00
{% addtoblock "endscripts" %}
< script type = "text/javascript" src = "{{ STATIC_URL }}list_request.js" > < / script >
{% endaddtoblock %}
2012-06-14 01:22:04 +02:00
{% endblock %}