141 lines
6.2 KiB
HTML
141 lines
6.2 KiB
HTML
{% extends "request_base.html" %}
|
||
{% load sekizai_tags %}
|
||
{% load urlbuilder %}
|
||
{% load url from future %}
|
||
|
||
{% block breadcrumb %}
|
||
<p>Tableau de bord</p>
|
||
{% endblock %}
|
||
|
||
{% block content %}
|
||
{% addtoblock "endscripts" %}
|
||
<script type="text/javascript">
|
||
$(function () {
|
||
$('#from-date-datepicker').datepicker().on('hide',
|
||
function (ev) {
|
||
if (ev.date.valueOf()) {
|
||
$('#date-form').submit();
|
||
}
|
||
});
|
||
$('#to-date-datepicker').datepicker().on('hide',
|
||
function (ev) {
|
||
if (ev.date.valueOf()) {
|
||
$('#date-form').submit();
|
||
}
|
||
});
|
||
});
|
||
</script>
|
||
{% endaddtoblock %}
|
||
|
||
|
||
{% comment %}
|
||
Here starts the filter block
|
||
{% endcomment %}
|
||
|
||
|
||
{% if filters or filter_choices %}
|
||
<div id="filters" class="well">
|
||
{% 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>
|
||
{% endif %}
|
||
{% if filter_choices %}
|
||
<div id="filter-choices-container"><a data-toggle="collapse" data-target="#filter-choices" id="filter-choices-title"><h5>Ajouter des filtres</h5></a>
|
||
<div id="filter-choices">
|
||
{% for filter_choice in filter_choices %}
|
||
<div><label class="filter-title">{{ filter_choice.caption }}</label>
|
||
<p class="{% if filter_choice.choices|length > 5 %}long{% endif %}">{% for url, caption in filter_choice.choices %}
|
||
<a href="{{ url }}">{{ caption }}</a>
|
||
{% endfor %}</p>
|
||
</div>
|
||
{% endfor %}
|
||
<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">
|
||
<label for="from_date">À livrer après:</label>
|
||
<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>
|
||
<label for="to_date">À livrer avant:</label>
|
||
<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">
|
||
<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>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
|
||
{% if not paginator.count %}
|
||
<h1>Aucune demande trouvée</h1>
|
||
{% else %}
|
||
<p class="alert alert-info">
|
||
Pour obtenir des détails sur une demande, cliquer sur sa ligne.
|
||
</p>
|
||
<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>
|
||
<p><a href="{{csv_qs}}" rel="tooltip" title="exportez le résultat de votre recherche au format « tableur »">Export CSV</a></p>
|
||
<table id="request-list-table" class="table table-bordered table-striped table-condensed">
|
||
<thead>
|
||
<tr>
|
||
<th></th>
|
||
<th>N°</th>
|
||
<th><a href="{% sort_url 'user' %}">{% sort_indicator 'user' '↑' '↓' '' %}Demandeur (commanditaire)</a></th>
|
||
<th><a href="{% sort_url 'entity__name' %}">{% sort_indicator 'entity__name' '↑' '↓' '' %}Service</a></th>
|
||
<th><a href="{% sort_url 'nb_pages' %}">{% sort_indicator 'nb_pages' '↑' '↓' '' %}Nb. pages</a></th>
|
||
<th><a href="{% sort_url 'copies' %}">{% sort_indicator 'copies' '↑' '↓' '' %}Nb. copies</a></th>
|
||
<th><a href="{% sort_url 'status' %}">{% sort_indicator 'status' '↑' '↓' '' %}ÉTAT</a></th>
|
||
<th><a href="{% sort_url 'creation_date' %}">{% sort_indicator 'creation_date' '↑' '↓' '' %}Création</a></th>
|
||
<th><a href="{% sort_url 'delivery_date' %}">{% sort_indicator 'delivery_date' '↑' '↓' '' %}Livraison</a></th>
|
||
<th><a href="{% sort_url 'financial_code' %}">{% sort_indicator 'financial_code' '↑' '↓' '' %}Code financier</a></th>
|
||
<th><a href="{% sort_url 'cost' %}">{% sort_indicator 'cost' '↑' '↓' '' %}Coût</a></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for request in requests %}
|
||
{% with doc=request.document id=request.id%}
|
||
{% url 'request_detail' pk=request.pk as the_url %}
|
||
<tr class="request-row" data-detail="{{the_url}}">
|
||
<td><a href="{{the_url}}" class="btn"><strong>Voir</strong></a></td>
|
||
<td><a href="{{the_url}}">{{ request.request_number }}</a></td>
|
||
<td><a href="{{the_url}}">{{ request.sponsor_display }}</a></td>
|
||
<td><a href="{{the_url}}">{% if request.entity %}{{ request.entity.get_description|title }}{% else %}Aucune{% endif %}</a></td>
|
||
<td><a href="{{the_url}}">{{ request.nb_pages }}</a></td>
|
||
<td><a href="{{the_url}}">{{ request.copies}}</a></td>
|
||
<td class="status-column status-{{ request.status }}"><a href="{{the_url}}" {% if request.status.description %}rel="tooltip" title="{{request.status.description}}"{% endif %}>{{ request.status }}</a></td>
|
||
<td><a href="{{the_url}}">{{ request.creation_date|date:"d.m.y" }}</a></td>
|
||
<td><a href="{{the_url}}">{% if request.delivery_date %}{{ request.delivery_date|date:"d.m.y" }}{% else %}Aucune{% endif %}</a></td>
|
||
<td>{{ request.financial_code }}</td>
|
||
<td>{% if request.cost %}{{cost}}{% else %}{{ request.estimated_cost|floatformat }}<span class="estimated-cost-asterisk">*</span>{% endif %} €</td>
|
||
</tr>
|
||
{% endwith %}
|
||
{% endfor %}
|
||
</tbody>
|
||
<caption>
|
||
{% 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 %}
|
||
{% endif %}
|
||
<p class="pull-right"><span class="estimated-cost-asterisk">*</span> coût estimé</span></p>
|
||
</caption>
|
||
</table>
|
||
{% endif %}
|
||
|
||
{% addtoblock "endscripts" %}
|
||
<script type="text/javascript" src="{{ STATIC_URL }}list_request.js"></script>
|
||
{% endaddtoblock %}
|
||
|
||
{% endblock %}
|