Commit 8a2efba3 authored by Gabriel Detraz's avatar Gabriel Detraz

N'affiche pas le filtre club quand on recherche un adh et inversement + corrections diverses

parent c81c04e0
......@@ -13,8 +13,6 @@ class SearchForm(forms.Form):
fid = forms.IntegerField(label=u'Fid', required=False)
cname = forms.CharField(label=u'Nom du club', max_length=40, required=False)
local = forms.CharField(label=u'Local', max_length=5, required=False)
cid = forms.IntegerField(label=u'Cid', required=False)
host = forms.CharField(label=u'Nom de machine', max_length=40, required=False)
......
......@@ -116,6 +116,7 @@
</tbody>
</table>
{% if "adherent" in objet or "machine" == objet or "facture" == objet %}
<h2>Filtre adhérent</h2>
<div class="row">
<div class="three columns">
......@@ -164,21 +165,22 @@
{{ form.uid.help_text }}
</div>
</div>
{% endif %}
{% if "club" in objet or "machine" == objet or "facture" == objet %}
<h2>Filtre club</h2>
<div class="row">
<div class="three columns">
{{ form.cname.label_tag }}
{{ form.cname }}
{{ form.cname.errors }}
{{ form.cname.help_text }}
{{ form.nom.label_tag }}
{{ form.nom }}
{{ form.nom.errors }}
{{ form.nom.help_text }}
</div>
<div class="three columns">
{{ form.local.label_tag }}
{{ form.local }}
{{ form.local.errors }}
{{ form.local.help_text }}
{{ form.chbre.label_tag }}
{{ form.chbre }}
{{ form.chbre.errors }}
{{ form.chbre.help_text }}
</div>
<div class="three columns">
{{ form.cid.label_tag }}
......@@ -186,7 +188,14 @@
{{ form.cid.errors }}
{{ form.cid.help_text }}
</div>
<div class="three columns">
{{ form.uid.label_tag }}
{{ form.uid }}
{{ form.uid.errors }}
{{ form.uid.help_text }}
</div>
</div>
{% endif %}
<h2>Filtre machine</h2>
<div class="row">
......
......@@ -24,14 +24,6 @@ else:
use_ldap_admin = lc_ldap.shortcuts.with_ldap_conn(retries=2, delay=5,
constructor=lc_ldap.shortcuts.lc_ldap_admin)
def is_adm(request):
"""Renvoie True si l'utilisateur connecté est adm"""
luser = conn_pool.get_user(request.user)
li = False
if "Nounou" in luser['droits']:
li = True
return li
@login_required
def afficher(request):
""" Accueil de l'interface de cablage """
......@@ -82,12 +74,14 @@ def rechercher(request, ldap, objet):
})
return render(request, "cablage/recherche.html", {
'form': form,
'objet': objet,
})
else:
return render(request, "cablage/recherche.html", {
'form': form,
'objet': objet,
})
else:
form = SearchForm()
context = {'form': form}
context = {'form': form, 'objet': objet}
return render(request, "cablage/recherche.html", context)
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