Commit 75edb373 authored by Georges Gressot's avatar Georges Gressot 💬
Browse files

work in progress ...

parent a2617115
......@@ -115,10 +115,9 @@ class Feature(models.Model):
class BddAdmin(models.Model):
"""Model for BDD administrator(s)"""
name = models.CharField('name', max_length=30, unique=True, blank=False)
contact = models.EmailField('email')
def __str__(self):
return self.name
return self.contact
#Checking choices :
CHECKING_CHOICES = (('Visa', _("Visa OK (La fiche est conforme)")), ('Notify', _("Anomalie (L'administrateur de la base sera informé)")),)
......
......@@ -43,47 +43,15 @@
<p><center><font color= #FF0000 >{% trans "Attention : Une seule validation à la fois" %}.</font></center></p>
<p><form method="post">{% csrf_token %}{% trans "Motifs actuels" %} ({{ exclnbr }}) : {% for ex in EXCLUSION_CHOICES %} {{ ex.0 }} - {% endfor %} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<p><form method="post">{% csrf_token %}{% trans "Motifs d'exclusion actuels" %} ({{ exclnbr }}) : {% for ex in EXCLUSION_CHOICES %} {{ ex.0 }} - {% endfor %} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{% trans "Le cas échéant, motif à ajouter" %} : {{ exclform.exclusup }} <input type="submit" value="{% trans "Valider" %}"></form></p>
</div>
<div id="content">
<table border="1">
<thead>
<th>{% trans "Propriété" %}</th>
<th>{% trans "Valeur actuelle" %}</th>
<th>{% trans "Le cas échéant, nouvelle valeur" %}</th>
</thead>
<tbody>
<tr>
<td>{% trans "Nom du projet" %}</td>
<td>{{ project }}</td>
<td><form method="post">{% csrf_token %}{{ projform.projname }} <input type="submit" value="{% trans "Valider" %}"></form></td>
</tr>
<tr>
<td>{% trans "Résumé" %}</td>
<td>{{ abstract }}</td>
<td><form method="post">{% csrf_token %}{{ projform.descr }} <input type="submit" value="{% trans "Valider" %}"></form></td>
</tr>
<tr>
<td>{% trans "Date d'extraction de la base" %}</td>
<td>{{ extractdate }}</td>
<td><form method="post">{% csrf_token %}{{ projform.date }} <input type="submit" value="{% trans "Valider" %}"></form></td>
</tr>
</tbody>
</table>
<p><form method="post">{% csrf_token %}{% trans "Modification des propriétés d'une bibliothèque" %} : {{ libriform.librname }} <input type="submit" value="{% trans "Valider" %}"></form></p>
{% if g != 0 %}
<p><center><font color= #FF0000 >{% trans "Attention : Le cas échéant, pensez à administrer les utilisateurs dans la base principale" %}.</font></center></p>
<table border="1">
<thead>
......@@ -123,6 +91,72 @@
{% endif %}
<p><b><center>{% trans "Attention : Le cas échéant, pensez à administrer les utilisateurs dans la base principale" %}. <a target="_blank" href="/./admin/">{% trans "OK j'y vais" %}</a></center></b></p>
<table border="1">
<thead>
<th>{% trans "Administrateur du projet (email)" %}</th>
<th>{% trans "Le cas échéant, modifier l'email" %}</th>
<th>{% trans "Le cas échéant, cocher et valider pour supprimer cet administrateur" %}</th>
</thead>
<tbody>
{% for ad in admintupl %}
<tr>
<td>{{ ad.0 }}</td>
<td><form method="post"> {% csrf_token %} {{ ad.1.contact }} <input type="submit" value="{% trans "Valider" %}"> </form></td>
<td><center><form method="post"> {% csrf_token %} {{ ad.2.flag }} <input type="submit" value="{% trans "Valider" %}"> </form></center></td>
</tr>
{% endfor %}
</tbody>
</table>
<p><form method="post">{% csrf_token %}{% trans "Le cas échéant, ajouter un administrateur pour ce projet (email)" %} : {{ projadmform.contact }} <input type="submit" value="{% trans "Valider" %}"></form></p>
<table border="1">
<thead>
<th>{% trans "Propriété" %}</th>
<th>{% trans "Valeur actuelle" %}</th>
<th>{% trans "Le cas échéant, nouvelle valeur" %}</th>
</thead>
<tbody>
<tr>
<td>{% trans "Nom du projet" %}</td>
<td>{{ project }}</td>
<td><form method="post">{% csrf_token %}{{ projform.projname }} <input type="submit" value="{% trans "Valider" %}"></form></td>
</tr>
<tr>
<td>{% trans "Résumé" %}</td>
<td>{{ abstract }}</td>
<td><form method="post">{% csrf_token %}{{ projform.descr }} <input type="submit" value="{% trans "Valider" %}"></form></td>
</tr>
<tr>
<td>{% trans "Date d'extraction de la base" %}</td>
<td>{{ extractdate }}</td>
<td><form method="post">{% csrf_token %}{{ projform.date }} <input type="submit" value="{% trans "Valider" %}"></form></td>
</tr>
</tbody>
</table>
<center><a href="/{{ bdd }}">{% trans "Retour à l'accueil" %}</a></center>
</div>
......
......@@ -175,6 +175,11 @@ def adminbase(request, bdd):
exclusup = forms.CharField(required =True, widget=forms.TextInput(attrs={'size': '30'}), max_length=30, label =_("exclusion suppl"))
exclform =ExcluForm(request.POST or None)
if exclform.is_valid():
newexcl =Exclusion()
newexcl.label =exclform.cleaned_data['exclusup']
newexcl.save(using =bdd)
LIBRARY_CHOICES = ('', 'Sélectionnez la bibliothèque'),
if Library.objects.using(bdd).all().exclude(name ='checker'):
for l in Library.objects.using(bdd).all().exclude(name ='checker').order_by('name'):
......@@ -186,9 +191,9 @@ def adminbase(request, bdd):
newlibrname = forms.CharField(required =True, widget=forms.TextInput(attrs={'size': '30'}), max_length=30, label =_("nom de la bib"))
contact1 = forms.EmailField(required =True, label ='email 1')
contact2 = forms.EmailField(required =True, label ='email 2')
suppr2 = forms.BooleanField(required=False)
suppr2 = forms.BooleanField(required=True)
contact3 = forms.EmailField(required =True, label ='email 3')
suppr3 = forms.BooleanField(required=False)
suppr3 = forms.BooleanField(required=True)
libriform = LibrIForm(request.POST or None)
......@@ -222,7 +227,16 @@ def adminbase(request, bdd):
# if librmform.is_valid():
# a =1
# gift =a
class ProjadmForm(forms.Form):
contact = forms.EmailField(required =True, label ='email')
adminlist =BddAdmin.objects.using(bdd).all()
admintupl =('', ProjadmForm(), CheckForm()),
for ad in adminlist:
admintupl += (ad.contact, ProjadmForm(), CheckForm()),
admintupl =admintupl[1:]
projadmform =ProjadmForm(request.POST or None)
return render(request, 'epl/adminbase.html', locals())
......
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