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

adminbase ...

parent 3e0e6013
......@@ -115,7 +115,7 @@ class Feature(models.Model):
class BddAdmin(models.Model):
"""Model for BDD administrator(s)"""
name = models.CharField('name', max_length=30, unique=True)
name = models.CharField('name', max_length=30, unique=True, blank=False)
contact = models.EmailField('email')
def __str__(self):
return self.name
......
......@@ -33,6 +33,7 @@
<p>***eplouribousse est une application web destinée à faciliter la gestion du dédoublonnement des périodiques dans les bibliothèques.***</p>
<p>Version : {{ version }}</p>
<p>Serveur : {{ host }}</p>
<p>{{ date }}</p>
<p>Licence : <a target="_blank" href="https://www.gnu.org/licenses/gpl-3.0.txt">GPLv3</a></p>
<p>Développée avec Django 2.2.12 (LTS) et Python 3.5.2, ReportLab open-source [3.5.42], HTML5, CSS3.</p>
......
{% load i18n %}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
{% load static %}
<link rel="stylesheet" type="text/css" href="{% static 'css/style.css' %}">
<link rel="shortcut icon" type="image/x-icon" href="{% static './favicon.ico' %}">
</head>
<div id="sticky-section">
<nav id="sticky-menu">
<a href="/{{ bdd }}">{% trans "Accueil" %}</a>
<a href="/{{ bdd }}/dashboard">{% trans "Supervision" %}</a>
<a href="/{{ bdd }}/search">{% trans "Recherche (bêta)" %}</a>
<a target="_blank" href="{% static 'doc/User_Documentation.pdf' %}">{% trans "Manuel de l'utilisateur" %}</a>
<a target="_blank" href="/./default/about">{% trans "A propos" %}</a>
</nav>
{% if k != 0 %}
<p style="text-align:right;"><b><font color= #017a04 >@ </font></b>{{ k }} (<a href="/./{{ bdd }}/disconnect">{% trans "Déconnexion" %}</a>)</p>
{% else %}
<!-- <b><font color= #ff0004 >(User : Anonymous)</font></b> -->
<!-- (User : Anonymous) -->
{% endif %}
</div>
<div id="content">
<h2>{% trans "Administration du projet" %} : {{ name }}</h2>
<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.name }}</p>
{% trans "Modification des propriétés d'une bibliothèque" %} : {{ librform.name }}
<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>
</form>
</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>
<p>eplouribousse utilise des données sous <a target="_blank" href="http://www.abes.fr/Media/Fichiers/Footer/Presentation-de-l-ABES/licence-Etalab-francais">licence etalab</a> fournies par l'<a target="_blank" href="https://abes.fr/l-abes/presentation/">Abes</a>.</p>
<p>Version : {{ version }}</p>
</div>
</body>
</html>
......@@ -17,10 +17,11 @@
<body>
<div id="content">
<div id="logo"><img src="{% static "pictures/signature_eplouribousse.svg" %}" alt="Logo eplouribousse Unistra"/></div>
{% if k != 0 %}
<b><font color= #017a04 >@ </font></b>{{ k }} (<a href="/./{{ bdd }}/disconnect">{% trans "Déconnexion" %}</a>)
<p style="text-align:right;"><b><font color= #017a04 >@ </font></b>{{ k }} (<a href="/./{{ bdd }}/disconnect">{% trans "Déconnexion" %}</a>)</p>
<!-- <b><font color= #017a04 >@ </font></b>{{ k }} (<a href="/./{{ bdd }}/disconnect">{% trans "Déconnexion" %}</a>) -->
{% else %}
<!-- <b><font color= #ff0004 >(User : Anonymous)</font></b> -->
<!-- (User : Anonymous) -->
......@@ -29,7 +30,6 @@
<h1>{% trans "Accueil" %}</h1>
<h2>{% trans "Projet" %} : {{ project }}</h2>
<div id="content">
<p>{% trans "Intervention possible pour le contrôleur" %} : <a href="/{{ bdd }}/allinstr/999999999/title">{% trans "Instructions" %}</a></p>
......
......@@ -46,7 +46,7 @@
<div id="footer">
<p><a href="/{{ bdd }}/search">{% trans "Recherche (bêta)" %}</a> - <a href="/{{ bdd }}/dashboard">{% trans "Supervision" %}</a> - <a target="_blank" href="{% static 'doc/User_Documentation.pdf' %}">{% trans "Manuel de l'utilisateur" %}</a> - <a target="_blank" href="/./accounts/password_change">{% trans "Changer mon mot de passe" %}</a> - [<a href="/./admin/">{% trans "Administration (réservé)" %}</a>] - <a href="/./default/lang">{% trans "en / de" %}</a></p>
<p><a href="/{{ bdd }}/search">{% trans "Recherche (bêta)" %}</a> - <a href="/{{ bdd }}/dashboard">{% trans "Supervision" %}</a> - <a target="_blank" href="{% static 'doc/User_Documentation.pdf' %}">{% trans "Manuel de l'utilisateur" %}</a> - <a target="_blank" href="/./accounts/password_change">{% trans "Changer mon mot de passe" %}</a> - [<a href="/{{ bdd }}/adminbase">{% trans "Administration du projet (réservé)" %}</a>] - [<a href="/./admin/">{% trans "Administration générale (réservé)" %}</a>] - <a href="/./default/lang">{% trans "en / de" %}</a></p>
</div>
......
......@@ -41,7 +41,7 @@
<div id="footer">
<p><a target="_blank" href="{% static 'doc/User_Documentation.pdf' %}">{% trans "Manuel de l'utilisateur" %}</a> - <a target="_blank" href="/./accounts/password_change">{% trans "Changer mon mot de passe" %}</a> - [<a href="/./admin/">{% trans "Administration (réservé)" %}</a>] - <a href="/./default/lang">{% trans "en / de" %}</a></p>
<p><a target="_blank" href="{% static 'doc/User_Documentation.pdf' %}">{% trans "Manuel de l'utilisateur" %}</a> - <a target="_blank" href="/./accounts/password_change">{% trans "Changer mon mot de passe" %}</a> - [<a href="/./admin/">{% trans "Administration générale (réservé)" %}</a>] - <a href="/./default/lang">{% trans "en / de" %}</a></p>
</div>
......
from django.urls import path
from . import views, views_pdf, views_csv
# from django.contrib.staticfiles.storage import staticfiles_storage
# from django.views.generic.base import RedirectView
# from django.conf import settings
# from django.urls import include
urlpatterns = [
path('', views.selectbdd, name='bddselect'),
path('<str:bdd>', views.home, name='project_home'),
path('<str:bdd>/adminbase', views.adminbase, name='project administration'),
path('default/about', views.about, name='about'),
path('default/contact', views.contact, name='contact'),
path('default/webmaster', views.webmstr, name='webmaster'),
......@@ -77,5 +74,4 @@ urlpatterns = [
path('<str:bdd>/ednotmotherpdf/<str:lid>/<str:xlid>', views_pdf.xnotmotherpdf, name='xnotmothertopdf'),
path('<str:bdd>/csv/<str:lid>/<str:xlid>/<path:recset>/<str:what>/<str:length>', views_csv.simple_csv, name='csv export'),
# path("favicon.ico", RedirectView.as_view(url=staticfiles_storage.url("favicon.ico")), ),
]
......@@ -24,7 +24,7 @@ from django.contrib.auth.models import User
from django.contrib.auth import logout
from django.http import HttpResponseRedirect, HttpResponse
import os
lastrked =None
webmaster =""
......@@ -54,16 +54,13 @@ def coll_cn(e):
def selectbdd(request):
version =epl_version
i, k =0, 1
BDD_CHOICES =('',_('Sélectionnez votre projet')),
while k ==1:
try:
BDD_CHOICES += ('{:02d}'.format(i), Project.objects.using('{:02d}'.format(i)).all().order_by('pk')[0].name),
i +=1
except:
k =0
# BDD_CHOICES =BDD_CHOICES[1:]
for i in [n for n in range(10)]:
if os.path.isfile('{:02d}.db'.format(i)):
p = Project.objects.using('{:02d}'.format(i)).all().order_by('pk')[0].name
BDD_CHOICES += ('{:02d}'.format(i), p),
if len(BDD_CHOICES) ==2:
return HttpResponseRedirect(BDD_CHOICES[1][0])
......@@ -85,11 +82,10 @@ def selectbdd(request):
instrnbr =0
usernbr =len(User.objects.all())
projnbr =len(BDD_CHOICES) -1
for e in BDD_CHOICES[1:]:
librnbr +=len(Library.objects.using(e[0]).all())
itemrecnbr +=len(ItemRecord.objects.using(e[0]).all())
instrnbr +=len(Instruction.objects.using(e[0]).all())
for bdd in BDD_CHOICES[1:]:
librnbr +=len(Library.objects.using(bdd[0]).all())
itemrecnbr +=len(ItemRecord.objects.using(bdd[0]).all())
instrnbr +=len(Instruction.objects.using(bdd[0]).all())
return render(request, 'epl/selectbdd.html', locals())
......@@ -154,6 +150,58 @@ def home(request, bdd):
return render(request, 'epl/home.html', locals())
def adminbase(request, bdd):
#contrôle d'accès ici
k =logstatus(request)
version =epl_version
EXCLUSION_CHOICES = ('', ''),
for e in Exclusion.objects.using(bdd).all().order_by('label'):
EXCLUSION_CHOICES += (e.label, e.label),
EXCLUSION_CHOICES += ("Autre (Commenter)", _("Autre (Commenter)")),
exclnbr =len(EXCLUSION_CHOICES) -1
project = Project.objects.using(bdd).all().order_by('pk')[0].name
class ProjectForm(forms.Form):
exclusup = forms.CharField(required =False, widget=forms.TextInput(attrs={'size': '30'}), max_length=30, label =_("exclusion suppl"))
name = 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']
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 LibraryForm(forms.ModelForm):
class Meta:
model = Library
fields = ('name',)
widgets = {
'name' : forms.Select(choices=LIBRARY_CHOICES),
}
i =Library()
libriform = LibraryForm(request.POST or None, instance =i)
if libriform.is_valid():
libname =i.name
contact =i.contact
contact_bis =i.contact_bis
contact_ter =i.contact_ter
j =Library(libname =libname)
return render(request, 'epl/adminbase.html', locals())
def about(request):
k =logstatus(request)
......
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