8
0
Fork 0
mirror of https://gitlab.federez.net/re2o/re2o synced 2024-06-02 07:52:23 +00:00

Barre de recherche fonctionnelle

This commit is contained in:
Dalahro 2016-07-03 01:37:58 +02:00
parent c486cc03f2
commit 87a182a9ca
5 changed files with 20 additions and 4 deletions

View file

@ -51,6 +51,7 @@
<th>Prix unitaire</th>
<th>Moyen de paiement</th>
<th>Date</th>
<th></th>
</tr>
</thead>
{% for facture in facture_list %}
@ -61,6 +62,7 @@
<td>{{ facture.prix }}</td>
<td>{{ facture.paiement }}</td>
<td>{{ facture.date }}</td>
<td><a href="{% url 'cotisations:edit-facture' facture.id %}">Editer</a></td>
</tr>
{% endfor %}
</table>
@ -74,6 +76,7 @@
<th>Raison</th>
<th>Date de début</th>
<th>Date de fin</th>
<th></th>
</tr>
</thead>
{% for ban in ban_list %}
@ -82,9 +85,16 @@
<td>{{ ban.raison }}</td>
<td>{{ ban.date_start }}</td>
<td>{{ ban.date_end }}</td>
<td><a href="{% url 'users:edit-ban' ban.id %}">Editer</a></td>
</tr>
{% endfor %}
</table>
{% endif %}
{% if not ban_list and not machine_list and not users_list and not facture_list%}
<h3>Aucun résultat</h3>
{% endif %}
<br />
<br />
<br />
{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends "search/sidebar.html" %}
{% extends "users/sidebar.html" %}
{% load bootstrap3 %}
{% block title %}Création et modification d'utilisateur{% endblock %}

View file

@ -34,14 +34,15 @@
<li><a href="#">Statistiques</a></li>
</ul>
<div class="col-sm-3 col-md-3 navbar-right">
<form class="navbar-form" role="search">
<form action="{% url "search:search"%}" method="POST" class="navbar-form" role="search">
{% csrf_token %}
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="srch-term" id="srch-term">
<input type="text" class="form-control" placeholder="Search" name="search_field" id="search-term">
<div class="input-group-btn">
<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
</form>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>

View file

@ -12,6 +12,11 @@ from users.forms import PassForm
from re2o.login import makeSecret, hashNT
def end_ban(user):
""" Renvoie la date de fin de ban d'un user, False sinon """
date_max = Ban.objects.all().filter(user=user).aggregate(Max('date_end'))['date_end__max']
return date_max
def form(ctx, template, request):
c = ctx
c.update(csrf(request))