Commit c475b730 authored by Georges Gressot's avatar Georges Gressot 💬
Browse files

resume ...

parent 0dbbb266
......@@ -34,19 +34,96 @@
</div>
<div id="content">
<body>
<div id="content">
<h2>{% trans "Administration du projet" %} : {{ project }}</h2>
<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;
{% 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>
<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 de la bibliothèque" %}</td>
<td>{{ libriname }}</td>
<td><form method="post">{% csrf_token %}{{ librmform.newlibrname }} <input type="submit" value="{% trans "Valider" %}"> {% trans "Rétroactif (instructions)" %}</form></td>
</tr>
<tr>
<td>{% trans "Contact principal" %}</td>
<td>{{ ctcti1 }}</td>
<td><form method="post">{% csrf_token %}{{ librmform.contact1 }} <input type="submit" value="{% trans "Valider" %}"></form></td>
</tr>
<tr>
<td>{% trans "Second contact" %}</td>
<td>{{ ctcti2 }}</td>
<td><form method="post">{% csrf_token %}{{ librmform.contact2 }} <input type="submit" value="{% trans "Valider" %}"></form> <form method="post">{% csrf_token %} {% trans "ou supprimer" %} {{ librmform.suppr2 }} <input type="submit" value="{% trans "Valider" %}"></form></td>
</tr>
<tr>
<td>{% trans "Troisième contact" %}</td>
<td>{{ ctcti3 }}</td>
<td><form method="post">{% csrf_token %}{{ librmform.contact3 }} <input type="submit" value="{% trans "Valider" %}"></form> <form method="post">{% csrf_token %} {% trans "ou supprimer" %} {{ librmform.suppr3 }} <input type="submit" value="{% trans "Valider" %}"></form></td>
</tr>
</tbody>
</table>
<p><center><font color= #FF0000 >{% trans "Attention : Pensez à créer les utilisateurs dans la base principale" %}.</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; {% trans "Le cas échéant, motif à ajouter" %} : {{ form.exclusup }}</p>
<p>{% trans "Nom actuel du projet" %} : {{ project }}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% trans "Le cas échéant, nouveau nom" %} : {{ form.projname }}</p>
{% trans "Modification des propriétés d'une bibliothèque" %} : {{ libriform.name }} {{ librmform }}
<p><input type="submit" value="{% trans "Valider" %}"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <button><b><a href="/{{ bdd }}/current_status/{{ sid }}/{{ bib.lid }}">{% trans "Annuler" %}</a></b></button></p>
{% endif %}
<center><a href="/{{ bdd }}">{% trans "Retour à l'accueil" %}</a></center>
</form>
</div>
<div id="credits">
......@@ -57,6 +134,6 @@
</div>
</body>
</body>
</html>
......@@ -198,7 +198,7 @@
</table>
</div>
<div id="credits">
<p>Conservation et valorisation des collections · Service des bibliothèques de l'Université de Strasbourg · <a target="_blank" href="/./default/about">{% trans "A propos" %}</a> . <a target="_blank" href="https://groupes.renater.fr/sympa/info/eplouribousse-newsletter">{% trans "Me tenir au courant" %}</a> · <a target="_blank" href="https://groupes.renater.fr/sympa/info/eplouribousse">{% trans "Forum des utilisateurs" %}</a> · <a target="_blank" href="https://bugs.launchpad.net/eplouribousse">{% trans "Suivi des bugs" %}</a>{% if webmaster != "" %} · <a target="_blank" href="/default/webmaster">{% trans "Administrateur du site" %}</a>{% endif %}</p>
......
......@@ -163,41 +163,65 @@ def adminbase(request, bdd):
EXCLUSION_CHOICES += ("Autre (Commenter)", _("Autre (Commenter)")),
exclnbr =len(EXCLUSION_CHOICES) -1
project = Project.objects.using(bdd).all().order_by('pk')[0].name
abstract =Project.objects.using(bdd).all().order_by('pk')[0].descr
extractdate =Project.objects.using(bdd).all().order_by('pk')[0].date
class ProjectForm(forms.Form):
exclusup = forms.CharField(required =False, widget=forms.TextInput(attrs={'size': '30'}), max_length=30, label =_("exclusion suppl"))
projname = forms.CharField(required =False, widget=forms.TextInput(attrs={'size': '30'}), max_length=30, label =_("project code name"))
descr =forms.CharField(required =False, widget=forms.Textarea(), max_length=300, label =_("project description"))
date =forms.CharField(required =False, widget=forms.TextInput(attrs={'size': '50'}), max_length=50, label =_("database extraction date"))
form = ProjectForm(request.POST or None)
# if form.is_valid():
# recipient = form.cleaned_data['email']
# recipient_confirm = form.cleaned_data['email_confirm']
# subject2 = form.cleaned_data['object']
# body = form.cleaned_data['content']
projname = forms.CharField(required =True, widget=forms.TextInput(attrs={'size': '30'}), max_length=30, label =_("project code name"))
descr =forms.CharField(required =True, widget=forms.Textarea(attrs={'rows':5, 'cols':60},), max_length=300, label =_("project description"))
date =forms.CharField(required =True, widget=forms.TextInput(attrs={'size': '50'}), max_length=50, label =_("database extraction date"))
projform = ProjectForm(request.POST or None)
class ExcluForm(forms.Form):
exclusup = forms.CharField(required =True, widget=forms.TextInput(attrs={'size': '30'}), max_length=30, label =_("exclusion suppl"))
exclform =ExcluForm(request.POST or None)
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'):
LIBRARY_CHOICES += (l.name, l.name),
class LibrForm(forms.Form):
librname = forms.CharField(required =False, widget=forms.TextInput(attrs={'size': '30'}), max_length=30, label =_("nom de la bib"))
class LibrIForm(forms.Form):
librname = forms.ChoiceField(required =True, widget=forms.Select, choices = LIBRARY_CHOICES, label =_("nom de la bib"))
class LibrMForm(forms.Form):
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)
contact3 = forms.EmailField(required =True, label ='email 3')
suppr3 = forms.BooleanField(required=False)
libriform = LibrForm(request.POST or None)
libriform = LibrIForm(request.POST or None)
libriform = LibraryForm(request.POST or None, instance =i)
g =0
if libriform.is_valid():
libname =i.name
contact =i.contact
contact_bis =i.contact_bis
contact_ter =i.contact_ter
j =Library(name =libname)#modified
librmform = LibraryForm(request.POST or None, instance =j)
if librmform.is_valid():
a =1
gift =a
g =1
libriname = libriform.cleaned_data['librname']
ctcti1 =Library.objects.using(bdd).get(name =libriname).contact
ctcti2 =Library.objects.using(bdd).get(name =libriname).contact_bis
ctcti3 =Library.objects.using(bdd).get(name =libriname).contact_ter
librmform = LibrMForm(request.POST or None)
# pour supprimr contact2 ou contact3 !!!& Changement rétroactif sur l'ensemble des instructions (name et oname aussi)
# class SupAjForm(forms.Form):
# suppr = forms.BooleanField(required=False)
# ajo = forms.BooleanField(required=False)
#
# modeform =SupAjForm(request.POST or None)
#
# if request.method =="POST" and f.is_valid() and modeform.is_valid():
# sup = modeform.cleaned_data['suppr']
# aj = modeform.cleaned_data['ajo']
# recipient = form.cleaned_data['librname']
a=1
# libname =i.name
# contact =i.contact
# contact_bis =i.contact_bis
# contact_ter =i.contact_ter
# j =Library(name =libname)#modified
# librmform = LibrForm(request.POST or None, instance =j)
# if librmform.is_valid():
# a =1
# gift =a
return render(request, 'epl/adminbase.html', locals())
......
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