Commit 6c9d807f authored by Georges Gressot's avatar Georges Gressot 💬
Browse files

rolling ever

parent 226095f9
......@@ -67,7 +67,7 @@
<tr>
<td>{% trans "Nom de la bibliothèque" %}</td>
<td>{{ l.name }}</td>
<td>{{ l.name }} {% if l.name == 'checker' %} ({% trans "Non modifiable" %}) {% endif %}</td>
<!-- <td>{% if l.name != 'checker' %}<form method="post">{% csrf_token %}{{ formlibname.newlibrname }} <input type="submit" value="{% trans "Valider" %}"> {% trans "Rétroactif (instructions)" %}</form>{% else %} ({% trans "Non modifiable" %}) {% endif %}</td> -->
</tr>
<tr>
......@@ -91,35 +91,33 @@
<!-- <p><b><font color= #FF0000 >{% trans "Le nom courant est à indiquer dans tous les cas (drag & drop) ; une seule validation à la fois" %}</font></b></p> -->
<b><font color= #FF0000 >{{ info }}</font></b>
<p><form method="post"> {% csrf_token %}
{% trans "Nom courant de la bibliothèque" %} : {{ formlibname.currname }}
{% trans "Nom courant de la bibliothèque" %} : {{ formlibname.curname }}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{% trans "Nouveau nom de la bibliothèque" %} : {{ formlibname.newlibrname }}
{% trans "Nouveau nom de la bibliothèque" %} : {{ formnewlibname.newlibrname }}
<input type="submit" value="{% trans "Valider" %}"> </form></p>
<p><form method="post"> {% csrf_token %}
{% trans "Nom courant de la bibliothèque" %} : {{ formlibname.currname }}
{% trans "Nom courant de la bibliothèque" %} : {{ formlibname.curname }}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{% trans "email contact 1" %} : {{ formlibct1.contact1 }} {% trans "Identifiant" %} : {{ formlibct1.ident }}
<input type="submit" value="{% trans "Valider" %}"> </form></p>
<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -->
<p><form method="post"> {% csrf_token %}{% trans "Nom courant de la bibliothèque" %} : {{ formlibname.currname }}
<p><form method="post"> {% csrf_token %}{% trans "Nom courant de la bibliothèque" %} : {{ formlibname.curname }}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{% trans "email contact 2" %} : {{ formlibct2.contact2 }} {% trans "Identifiant" %} : {{ formlibct2.ident }}
<input type="submit" value="{% trans "Valider" %}"> </form></p>
<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -->
<p><form method="post"> {% csrf_token %}{% trans "Nom courant de la bibliothèque" %} : {{ formlibname.currname }}
<p><form method="post"> {% csrf_token %}{% trans "Nom courant de la bibliothèque" %} : {{ formlibname.curname }}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{% trans "email contact 3" %} : {{ formlibct3.contact3 }} {% trans "Identifiant" %} : {{ formlibct3.ident }}
<input type="submit" value="{% trans "Valider" %}"> </form>
</p>
<p><form method="post"> {% csrf_token %}{% trans "Nom courant de la bibliothèque" %} : {{ formlibname.currname }}
<p><form method="post"> {% csrf_token %}{% trans "Nom courant de la bibliothèque" %} : {{ formlibname.curname }}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{% trans "Supprimer le contact 2" %} : {{ formlibsu2.suppr2 }}
<input type="submit" value="{% trans "Valider" %}"> </form></p>
<!-- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -->
<p><form method="post"> {% csrf_token %}{% trans "Nom courant de la bibliothèque" %} : {{ formlibname.currname }}
<p><form method="post"> {% csrf_token %}{% trans "Nom courant de la bibliothèque" %} : {{ formlibname.curname }}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{% trans "Supprimer le contact 3" %} : {{ formlibsu3.suppr3 }}
<input type="submit" value="{% trans "Valider" %}"> </form>
......
......@@ -31,7 +31,8 @@
<button type="submit">{% trans "Me connecter" %}</button>
</form>
<p></p>
<a href="/accounts/password_reset">{% trans "Mot de passe perdu" %}</a> ?
<a href="/accounts/password_reset">{% trans "Mot de passe perdu ou pas encore défini" %}</a> ?
<p></p>
</div>
......
......@@ -157,7 +157,6 @@ def adminbase(request, bdd):
k =logstatus(request)
version =epl_version
url ="/" + bdd + "/adminbase"
info =_('Le nom courant est à indiquer dans tous les cas (drag & drop)')
EXCLUSION_CHOICES = ('', ''),
for e in Exclusion.objects.using(bdd).all().order_by('label'):
......@@ -210,8 +209,9 @@ def adminbase(request, bdd):
for l in Library.objects.using(bdd).all().exclude(name ='checker').order_by('name'):
LIBRARY_CHOICES += (l.name, l.name),
class LibrMNameForm(forms.Form):
currname = forms.CharField(required =True, widget=forms.TextInput(attrs={'size': '30'}), max_length=30, label =_("nom de la bib"))
class LibrMCurNameForm(forms.Form):
curname = forms.CharField(required =True, widget=forms.TextInput(attrs={'size': '30'}), max_length=30, label =_("nom de la bib"))
class LibrMNewNameForm(forms.Form):
newlibrname = forms.CharField(required =True, widget=forms.TextInput(attrs={'size': '30'}), max_length=30, label =_("nom de la bib"))
class LibrMCtc1Form(forms.Form):
contact1 = forms.EmailField(required =True, label ='email 1')
......@@ -230,24 +230,32 @@ def adminbase(request, bdd):
liblist =Library.objects.using(bdd).all()
sizelib =len(liblist)
formlibname = LibrMNameForm(request.POST or None)
formlibname = LibrMCurNameForm(request.POST or None)
formnewlibname = LibrMNewNameForm(request.POST or None)
formlibct1 = LibrMCtc1Form(request.POST or None)
formlibct2 = LibrMCtc2Form(request.POST or None)
formlibsu2 = LibrMSu2Form(request.POST or None)
formlibct3 = LibrMCtc3Form(request.POST or None)
formlibsu3 = LibrMSu3Form(request.POST or None)
if formlibname.is_valid():
if not libriname ==formlibname.cleaned_data['newlibrname'] and not formlibname.cleaned_data['newlibrname'] =='checker':
lib.name =formlibname.cleaned_data['newlibrname']
lib.save(using =bdd)
for insn in Instruction.objects.using(bdd).filter(name =formlibname.cleaned_data['newlibrname']):
insn.name =formlibname.cleaned_data['newlibrname']
insn.save(using =bdd)
for inso in Instruction.objects.using(bdd).filter(oname =formlibname.cleaned_data['newlibrname']):
inso.oname =formlibname.cleaned_data['newlibrname']
inso.save(using =bdd)
# pour supprimr contact2 ou contact3 !!!& Changement rétroactif sur l'ensemble des instructions (name et oname aussi)
if formlibname.is_valid() and formnewlibname.is_valid():
if not formlibname.cleaned_data['curname'] ==formnewlibname.cleaned_data['newlibrname']:
if formlibname.cleaned_data['curname'] =='checker' or formnewlibname.cleaned_data['newlibrname'] =='checker':
return HttpResponseRedirect(url)
else:
curname = formlibname.cleaned_data['curname']
newname = formnewlibname.cleaned_data['newlibrname']
for insn in Instruction.objects.using(bdd).filter(name =curname):
insn.name =newname
insn.save(using =bdd)
for inso in Instruction.objects.using(bdd).filter(oname =curname):
inso.oname =newname
inso.save(using =bdd)
lib = Library.objects.using(bdd).get(name =curname)
lib.name =formnewlibname.cleaned_data['newlibrname']
lib.save(using =bdd)
return HttpResponseRedirect(url)
# pour supprimr contact2 ou contact3 !!!
# class SupAjForm(forms.Form):
# suppr = forms.BooleanField(required=False)
# ajo = forms.BooleanField(required=False)
......
Supports Markdown
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