Commit c7dd3195 authored by Amap's avatar Amap

redirection vers le profil aprés un credit

veuillez saisir le message de validation pour vos modifications. Les lignes
parent e6ba07ce
......@@ -35,7 +35,7 @@
<h2>Etat des livraisons</h2>
<h2>Utilisateurs non livrés</h2>
{{ controlform.management_form }}
<table class="table table-striped">
<thead>
......@@ -52,6 +52,7 @@
</tr>
</thead>
{% for form in controlform.forms %}
{% if not form.livre %}
{% bootstrap_form_errors form %}
<tr>
<td>{{ form.instance.user }}</td>
......@@ -67,8 +68,47 @@
{{ hidden }}
{% endfor %}
</tr>
{% endif %}
{% endfor %}
</table>
<h2>Utilisateurs déjà livrés</h2>
{{ controlform.management_form }}
<table class="table table-striped">
<thead>
<tr>
<th>Utilisateur</th>
<th>Designation</th>
<th>Prix unitaire</th>
<th>Quantite</th>
<th>Date de livraison</th>
<th>Livré</th>
<th>Sac à disposition</th>
<th>Gérer les sacs</th>
<th></th>
</tr>
</thead>
{% for form in controlform.forms %}
{% if form.livre %}
{% bootstrap_form_errors form %}
<tr>
<td>{{ form.instance.user }}</td>
<td>{{ form.instance.nom }}</td>
<td>{{ form.instance.prix_unitaire }}</td>
<td>{{ form.instance.quantite }}</td>
<td>{{ form.instance.date }}</td>
<td>{{ form.livre }}</td>
<td>{{ form.instance.user.sac_consignes }}</td>
<td><a class="btn btn-primary btn-sm" role="button" href="{% url 'panier:add-sac' form.instance.user.id %}"><i class="glyphicon glyphicon-plus"></i> Ajouter</a></td>
<td> <a class="btn btn-primary btn-sm" role="button" href="{% url 'panier:del-sac' form.instance.user.id %}"><i class="glyphicon glyphicon-minus"></i> Retirer</a></td>
{% for hidden in form.hidden_fields %}
{{ hidden }}
{% endfor %}
</tr>
{% endif %}
{% endfor %}
</table>
{% endif %}
{% bootstrap_button "Valider" button_type="submit" icon="star" %}
......
......@@ -239,7 +239,7 @@ def add_credit(request, userid):
reversion.set_user(request.user)
reversion.set_comment("Creation")
messages.success(request, "Le credit a ete ajoute")
return redirect("/panier/")
return redirect("/users/profil/" + userid)
return form({'panierform': credit}, 'panier/panier.html', request)
@login_required
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment