Commit 23bff525 authored by chirac's avatar chirac

Machines sur le profil

parent e528ab13
......@@ -47,7 +47,7 @@ def edit_machine(request, interfaceid):
machine_form.save()
interface_form.save()
messages.success(request, "La machine a été modifiée")
return redirect("/users/")
return redirect("/machines/")
return form({'machineform': machine_form, 'interfaceform': interface_form}, 'machines/machine.html', request)
def new_interface(request, machineid):
......@@ -64,7 +64,7 @@ def new_interface(request, machineid):
new_interface.machine = machine
new_interface.save()
messages.success(request, "L'interface a été ajoutée")
return redirect("/users/")
return redirect("/machines/")
return form({'machineform': machine_form, 'interfaceform': interface_form}, 'machines/machine.html', request)
def index(request):
......
......@@ -28,7 +28,7 @@
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li><a href="{% url "users:index" %}">Adhérents</a></li>
<li><a href="#">Machines</a></li>
<li><a href="{% url "machines:index" %}">Machines</a></li>
<li><a href="{% url "cotisations:index" %}">Cotisations</a></li>
<li><a href="#">Topologie</a></li>
<li><a href="#">Statistiques</a></li>
......
......@@ -6,7 +6,7 @@
{% block content %}
<h2>Adhérent</h2>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-info' user.id %}"><i class="glyphicon glyphicon-fire"></i> Editer</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:password' user.id %}"><i class="glyphicon glyphicon-leaf"></i> Changer le mot de passe</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:password' user.id %}"><i class="glyphicon glyphicon-lock"></i> Changer le mot de passe</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:state' user.id %}"><i class="glyphicon glyphicon-flash"></i> Changer le statut</a>
<br />
<br />
......@@ -66,8 +66,9 @@
{% endif %}
</table>
<h2>Machines :</h2>
<h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-machine' user.id %}"><i class="glyphicon glyphicon-phone"></i> Ajouter une machine</a></h4>
{% if machine_list %}
<!-- {% include "machine/aff_machines.html" with machine_list=machine_list } -->
{% include "machines/aff_machines.html" with machine_list=machine_list %}
{% else %}
<p>Aucune machine</p>
{% endif %}
......@@ -79,7 +80,7 @@
<p>Aucune facture</p>
{% endif %}
<h2>Bannissements :</h2>
<h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-ban' user.id %}"><i class="glyphicon glyphicon-tint"></i> Ajouter un bannissement</a></h4>
<h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-ban' user.id %}"><i class="glyphicon glyphicon-pushpin"></i> Ajouter un bannissement</a></h4>
{% if ban_list %}
{% include "users/aff_bans.html" with ban_list=ban_list %}
{% else %}
......
......@@ -11,7 +11,7 @@ from django.utils import timezone
from users.models import User, Right, Ban, DelRightForm, UserForm, InfoForm, PasswordForm, StateForm, RightForm, BanForm, ProfilForm
from cotisations.models import Facture
from machines.models import Machine
from machines.models import Machine, Interface
from users.forms import PassForm
from search.models import SearchForm
from cotisations.views import is_adherent, end_adhesion
......@@ -156,7 +156,7 @@ def profil(request):
if profil.is_valid():
profils = profil.cleaned_data['user']
users = User.objects.get(pseudo = profils)
machines = None
machines = Interface.objects.filter(machine=Machine.objects.filter(user__pseudo = users))
factures = Facture.objects.filter(user__pseudo = users)
bans = Ban.objects.filter(user__pseudo = users)
end = None
......
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