This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
polynum/polynum/request/templates/list_request.html

168 lines
7.9 KiB
HTML
Raw Normal View History

2012-06-14 01:22:04 +02:00
{% extends "request_base.html" %}
{% load sekizai_tags %}
2012-06-14 01:22:04 +02:00
{% load urlbuilder %}
{% load url from future %}
{% load polynum %}
2012-06-14 01:22:04 +02:00
{% block breadcrumb %}
<p>Tableau de bord</p>
{% endblock %}
2012-06-14 01:22:04 +02:00
{% block content %}
{% addtoblock "endscripts" %}
<script type="text/javascript">
$(function () {
$('#from-date-datepicker').datepicker();
$('#from_date').change(
function (ev) {
$('#date-form').submit();
});
$('#to-date-datepicker').datepicker();
$('#to_date').change(
function (ev) {
$('#date-form').submit();
});
});
</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}}">&nbsp;</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>
<div id="filter-panel">
<div id="filter-text-libre"><label class="filter-title">Texte libre</label>
<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>
{% for key, value in request.GET.iteritems %}
{% if key != "filter_free_text" %}
<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 %}
<div id="filter-{{ filter_choice.caption|slugify}}"><label class="filter-title">{{ filter_choice.caption }}</label>
<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 %}
<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>
<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>
</form>
2012-06-22 18:13:18 +02:00
</div>
2012-06-14 01:22:04 +02:00
</div>
{% 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 %}
<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>
<p><a href="csv/?{{request.GET.urlencode}}" rel="tooltip" title="exportez le résultat de votre recherche au format « tableur »">Export tableur</a></p>
{% 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>
<th></th>
<th><a href="{% sort_url 'id' %}">{% sort_indicator 'id' '↑' '↓' '' %}N&deg;</a></th>
{% if has_role_reprography %}
<th>Valideur</th>
{% else %}
<th><a href="{% sort_url 'user' %}">{% sort_indicator 'user' '↑' '↓' '' %}Demandeur (commanditaire)</a></th>
{% endif %}
<th><a href="{% sort_url 'entity__name' %}">{% sort_indicator 'entity__name' '↑' '↓' '' %}Service</a></th>
<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>
<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>
<th><a href="{% sort_url 'financial_code' %}">{% sort_indicator 'financial_code' '↑' '↓' '' %}Code d'imputation</a></th>
<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 %}
<tr class="request-row request-status-{{request.status.code}}" data-detail="{{the_url}}">
<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>
{% 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 %}
<td class="sponsor"><a href="{{the_url}}">{{ request.sponsor_display|widont }}</a></td>
{% endif %}
<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>
<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>
<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>
<td class="cost">{% if request.cost %}{{ request.cost|floatformat:"-2" }}{% else %}&#8776;&nbsp;{{ request.estimated_cost|floatformat:"-2" }}{% endif %}&nbsp;</td>
2012-06-14 01:22:04 +02:00
</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 %}
2012-06-14 01:22:04 +02:00
{% endif %}
</caption>
2012-06-14 01:22:04 +02:00
</table>
{% endwith %}
2012-06-22 18:13:18 +02:00
{% endif %}
2012-06-14 01:22:04 +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 %}