Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
intranet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nounous-archives
intranet
Commits
ed90a2c0
Commit
ed90a2c0
authored
Dec 15, 2015
by
Daniel STAN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
impressions: traduction views et forms
parent
d3e789c9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
431 additions
and
64 deletions
+431
-64
impressions/forms.py
impressions/forms.py
+39
-30
impressions/locale/en/LC_MESSAGES/django.po
impressions/locale/en/LC_MESSAGES/django.po
+195
-11
impressions/locale/fr/LC_MESSAGES/django.po
impressions/locale/fr/LC_MESSAGES/django.po
+182
-9
impressions/views.py
impressions/views.py
+15
-14
No files found.
impressions/forms.py
View file @
ed90a2c0
...
...
@@ -2,6 +2,8 @@
from
django
import
forms
from
intranet
import
settings
from
django.utils.translation
import
ugettext_lazy
as
_
import
models
class
UploadForm
(
forms
.
Form
):
...
...
@@ -13,45 +15,52 @@ class UploadForm(forms.Form):
if
out
.
has_key
(
"fichier"
):
fichier
=
out
[
"fichier"
]
if
fichier
!=
None
and
fichier
.
size
>
settings
.
MAX_PRINTFILE_SIZE
:
raise
forms
.
ValidationError
(
u
"Fichier trop volumineux (%s octets), maximum %s"
%
(
fichier
.
size
,
settings
.
MAX_PRINTFILE_SIZE
))
raise
forms
.
ValidationError
(
_
(
u
"Fichier trop volumineux, le maximum est de %(max) octets (actuellement %(size)s octets)"
)
%
{
'size'
:
fichier
.
size
,
'max'
:
settings
.
MAX_PRINTFILE_SIZE
,
})
return
out
class
PrintForm
(
forms
.
Form
):
"""Formulaire pour spécifier les paramètres d'impression"""
couleur
=
forms
.
ChoiceField
(
label
=
"Couleur ou N&B"
,
choices
=
[(
'nb'
,
'Noir & Blanc'
),
(
'couleur'
,
'Couleur'
)],
couleur
=
forms
.
ChoiceField
(
label
=
_
(
u
"Couleur ou N&B"
)
,
choices
=
[(
'nb'
,
_
(
u
'Noir & Blanc'
)),
(
'couleur'
,
_
(
u
'Couleur'
)
)],
initial
=
'nb'
)
disposition
=
forms
.
ChoiceField
(
label
=
"Disposition"
,
choices
=
[(
'recto-verso'
,
'Recto/Verso'
),
(
'recto'
,
'Recto'
),
(
'livret'
,
'Livret'
)],
disposition
=
forms
.
ChoiceField
(
label
=
_
(
u
"Disposition"
)
,
choices
=
[(
'recto-verso'
,
_
(
u
'Recto/Verso'
)),
(
'recto'
,
_
(
u
'Recto'
)),
(
'livret'
,
_
(
u
'Livret'
)
)],
initial
=
'recto-verso'
)
format
=
forms
.
ChoiceField
(
label
=
"Format de papier"
,
choices
=
[(
'A4'
,
'A4'
),
(
'A3'
,
'A3'
)],
format
=
forms
.
ChoiceField
(
label
=
_
(
"Format de papier"
)
,
choices
=
[(
'A4'
,
u
'A4'
),
(
'A3'
,
u
'A3'
)],
initial
=
'A4'
)
agrafes
=
forms
.
ChoiceField
(
label
=
"Agrafes"
,
choices
=
[(
"none"
,
"Aucune"
),
(
"hg"
,
"une en haut à gauche"
),
(
"hd"
,
"une en haut à droite"
),
# ("bg", "une en bas à gauche"),
# ("bd", "une en bas à droite")],
(
"g"
,
"deux sur le bord gauche"
),
(
"d"
,
"deux sur le bord droit"
)],
initial
=
"none"
)
agrafes
=
forms
.
ChoiceField
(
label
=
_
(
"Agrafes"
),
choices
=
[
(
"none"
,
_
(
u
"Aucune"
)),
(
"hg"
,
_
(
u
"une en haut à gauche"
)),
(
"hd"
,
_
(
u
"une en haut à droite"
)),
# ("bg", _(u"une en bas à gauche")), #TO TRANSLATE
# ("bd", _(u"une en bas à droite")), #TO TRANSLATE
(
"g"
,
_
(
u
"deux sur le bord gauche"
)),
(
"d"
,
_
(
u
"deux sur le bord droit"
)),
],
initial
=
"none"
)
# Les options commentées n'existent pas
perforation
=
forms
.
ChoiceField
(
label
=
"Perforation"
,
choices
=
[(
"None"
,
"Aucune"
),
(
"2HolePunchLeft"
,
"2 trous à gauche"
),
(
"2HolePunchRight"
,
"2 trous à droite"
),
(
"2HolePunchTop"
,
"2 trous en haut"
),
(
"2HolePunchBottom"
,
"2 trous en bas"
),
# ("3HolePunchLeft", "3 trous à gauche"),
# ("3HolePunchRight", "3 trous à droite"),
# ("3HolePunchTop", "3 trous en haut"),
(
"4HolePunchLeft"
,
"4 trous à gauche"
),
(
"4HolePunchRight"
,
"4 trous à droite"
)],
# ("4HolePunchTop", "4 trous en haut")],
initial
=
"None"
)
copies
=
forms
.
IntegerField
(
label
=
"Nombre de copies"
,
initial
=
1
,
min_value
=
1
)
choices
=
[
(
"None"
,
_
(
u
"Aucune"
)),
(
"2HolePunchLeft"
,
_
(
u
"2 trous à gauche"
)),
(
"2HolePunchRight"
,
_
(
u
"2 trous à droite"
)),
(
"2HolePunchTop"
,
_
(
u
"2 trous en haut"
)),
(
"2HolePunchBottom"
,
_
(
u
"2 trous en bas"
)),
# ("3HolePunchLeft", _(u"3 trous à gauche")), #TO TRANSLATE
# ("3HolePunchRight", _(u"3 trous à droite")), #TO TRANSLATE
# ("3HolePunchTop", _(u"3 trous en haut")), #TO TRANSLATE
(
"4HolePunchLeft"
,
_
(
u
"4 trous à gauche"
)),
(
"4HolePunchRight"
,
_
(
u
"4 trous à droite"
)),
# ("4HolePunchTop", _(u"4 trous en haut")), #TO TRANSLATE
],
initial
=
"None"
)
copies
=
forms
.
IntegerField
(
label
=
_
(
"Nombre de copies"
),
initial
=
1
,
min_value
=
1
)
filenom
=
forms
.
CharField
(
widget
=
forms
.
HiddenInput
())
# Pour mettre à jour le coût, on utilise javascript
javascript_function
=
"javascript:update_prix();"
...
...
@@ -66,7 +75,7 @@ class PrintForm(forms.Form):
class
ClubForm
(
forms
.
Form
):
club_list
=
forms
.
ChoiceField
(
label
=
u
'Imprimer pour'
,
required
=
False
)
club_list
=
forms
.
ChoiceField
(
label
=
_
(
u
'Imprimer pour'
)
,
required
=
False
)
def
__init__
(
self
,
ldap_user
,
*
args
,
**
kwargs
):
super
(
ClubForm
,
self
).
__init__
(
*
args
,
**
kwargs
)
liste_compte
=
[]
...
...
impressions/locale/en/LC_MESSAGES/django.po
View file @
ed90a2c0
...
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-12-1
0 23:08
+0100\n"
"POT-Creation-Date: 2015-12-1
5 18:53
+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
...
@@ -18,6 +18,131 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: forms.py:18
#, python-format
msgid ""
"Fichier trop volumineux, le maximum est de %(max) octets (actuellement "
"%(size)s octets)"
msgstr ""
"The file is too large. It is of size %(size)s bytes where maximum is"
"%(max)s"
#: forms.py:27
msgid "Couleur ou N&B"
msgstr "Color or Grayscale"
#: forms.py:28
msgid "Noir & Blanc"
msgstr "Grayscale"
#: forms.py:28
msgid "Couleur"
msgstr "Color"
#: forms.py:30
msgid "Disposition"
msgstr "Disposition"
#: forms.py:31
msgid "Recto/Verso"
msgstr "Two sided"
#: forms.py:31
msgid "Recto"
msgstr "One sided"
#: forms.py:31
msgid "Livret"
msgstr "Booklet"
#: forms.py:33
#, fuzzy
#| msgid "Format du papier :"
msgid "Format de papier"
msgstr "Paper format"
#: forms.py:36
msgid "Agrafes"
msgstr "Stapling"
#: forms.py:38 forms.py:50
msgid "Aucune"
msgstr "None"
#: forms.py:39
msgid "une en haut à gauche"
msgstr "One top left"
#: forms.py:40
msgid "une en haut à droite"
msgstr "One top right"
#: forms.py:41
msgid "une en bas à gauche"
msgstr "One bottom left"
#: forms.py:42
msgid "une en bas à droite"
msgstr "One bottom right"
#: forms.py:43
msgid "deux sur le bord gauche"
msgstr "Two left sided"
#: forms.py:44
msgid "deux sur le bord droit"
msgstr "Two right sided"
#: forms.py:51
msgid "2 trous à gauche"
msgstr "Two left sided holes"
#: forms.py:52
msgid "2 trous à droite"
msgstr "Two right sided holes"
#: forms.py:53
msgid "2 trous en haut"
msgstr "Two top holes"
#: forms.py:54
msgid "2 trous en bas"
msgstr "Two bottom holes"
#: forms.py:55
msgid "3 trous à gauche"
msgstr "3 left sided holes"
#: forms.py:56
msgid "3 trous à droite"
msgstr "3 right sided holes"
#: forms.py:57
msgid "3 trous en haut"
msgstr "3 top holes"
#: forms.py:58
msgid "4 trous à gauche"
msgstr "4 left sided holes"
#: forms.py:59
msgid "4 trous à droite"
msgstr "4 right sided holes"
#: forms.py:60
msgid "4 trous en haut"
msgstr "4 top holes"
#: forms.py:63
#, fuzzy
#| msgid "Nombre de page :"
msgid "Nombre de copies"
msgstr "Page count"
#: forms.py:78
msgid "Imprimer pour"
msgstr "Printing account"
#: templates/impressions/affichage.html:3
msgid "Impression"
msgstr "Printing System"
...
...
@@ -55,35 +180,35 @@ msgstr "Printer status"
msgid "Envoyer"
msgstr "Submit"
#: templates/impressions/imprimante.html:1
1
#: templates/impressions/imprimante.html:1
3
msgid "Nom de domaine :"
msgstr "Hostname:"
#: templates/impressions/imprimante.html:1
5
#: templates/impressions/imprimante.html:1
7
msgid "Status :"
msgstr "Status:"
#: templates/impressions/imprimante.html:2
0
#: templates/impressions/imprimante.html:2
2
msgid "Bac de papiers"
msgstr "Paper Tray"
#: templates/impressions/imprimante.html:2
5
#: templates/impressions/imprimante.html:2
7
msgid "Nombre de page :"
msgstr "Page count"
#: templates/impressions/imprimante.html:
27
#: templates/impressions/imprimante.html:
33
msgid "Format du papier :"
msgstr "Paper format"
#: templates/impressions/imprimante.html:
37
#: templates/impressions/imprimante.html:
43
msgid "Consommables"
msgstr "Supplies"
#: templates/impressions/imprimante.html:4
2
#: templates/impressions/imprimante.html:4
8
msgid "Pourcentage :"
msgstr "Percent:"
#: templates/impressions/imprimante.html:
5
3
#: templates/impressions/imprimante.html:
6
3
msgid "Alertes"
msgstr "Alert"
...
...
@@ -123,7 +248,7 @@ msgstr "Printed jobs"
#: templates/impressions/liste.html:49
msgid "Job id"
msgstr ""
msgstr "
Job id
"
#: templates/impressions/liste.html:52 templates/impressions/liste.html:63
msgid "Lancé"
...
...
@@ -139,7 +264,7 @@ msgstr "Status"
#: templates/impressions/liste.html:60
msgid "Jid"
msgstr ""
msgstr "
Jid
"
#: templates/impressions/liste.html:78
msgid "Pas de tâche terminée en mémoire"
...
...
@@ -148,3 +273,62 @@ msgstr "No job"
#: templates/impressions/liste.html:83
msgid "Retour à l'interface d'impression"
msgstr "Back to the printing interface"
#: views.py:195
#, python-format
msgid "Votre fichier %s n'est pas un fichier PDF."
msgstr "Your file %s is not a PDF file."
#: views.py:204
msgid "Impossible de récupérer les informations sur le fichier PDF."
msgstr "Cannot get PDF information."
#: views.py:288
msgid "Solde insuffisant pour effectuer l'impression"
msgstr "Insufficient credit for printing"
#: views.py:299
msgid ""
"Votre fichier a bien été envoyé à l'impression \n"
" Le code pour entrer dans le batiment J est B7806 \n"
" Un code pour entrer dans le local impression a été généré : "
msgstr ""
"Your file has been sent to the printing system.\n"
"The code for building J entrance is B7806.\n"
"A code to enter the printing room has been generated: "
#: views.py:302 views.py:304
msgid "Formulaire non pris en charge."
msgstr "Unsupported form."
#: views.py:390
#, python-format
msgid "La tâche %s a été annulée."
msgstr "Job %s has been cancelled."
#: views.py:413
#, fuzzy
#| msgid "Pas de tâche dans la file d'attente du serveur"
msgid "Cette tâche n'est plus dans la file d'attente du serveur."
msgstr "No job in the queue"
#: views.py:420
msgid ""
"Vous n'êtes pas le propriétaire de cette tâche, vous ne pouvez pas l'annuler."
msgstr "You are not the owner of this job, you cannot cancel it."
#: views.py:423 views.py:445
msgid "Tâche introuvable, impossible de recréditer"
msgstr "Cannot find job, refund is not possible."
#: views.py:426
msgid "Impossible de recréditer la tâche"
msgstr "Cannot refund the job."
#: views.py:437
msgid "Action impossible, jid introuvable"
msgstr "Unavailable, cannot find jid."
#: views.py:442
msgid "Droits imprimeurs requis"
msgstr "Imprimeur rights required."
impressions/locale/fr/LC_MESSAGES/django.po
View file @
ed90a2c0
...
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-12-1
0 23:08
+0100\n"
"POT-Creation-Date: 2015-12-1
5 18:53
+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
...
@@ -18,6 +18,125 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: forms.py:18
#, python-format
msgid ""
"Fichier trop volumineux, le maximum est de %(max) octets (actuellement "
"%(size)s octets)"
msgstr ""
#: forms.py:27
msgid "Couleur ou N&B"
msgstr ""
#: forms.py:28
msgid "Noir & Blanc"
msgstr ""
#: forms.py:28
msgid "Couleur"
msgstr ""
#: forms.py:30
msgid "Disposition"
msgstr ""
#: forms.py:31
msgid "Recto/Verso"
msgstr ""
#: forms.py:31
msgid "Recto"
msgstr ""
#: forms.py:31
msgid "Livret"
msgstr ""
#: forms.py:33
msgid "Format de papier"
msgstr ""
#: forms.py:36
msgid "Agrafes"
msgstr ""
#: forms.py:38 forms.py:50
msgid "Aucune"
msgstr ""
#: forms.py:39
msgid "une en haut à gauche"
msgstr ""
#: forms.py:40
msgid "une en haut à droite"
msgstr ""
#: forms.py:41
msgid "une en bas à gauche"
msgstr ""
#: forms.py:42
msgid "une en bas à droite"
msgstr ""
#: forms.py:43
msgid "deux sur le bord gauche"
msgstr ""
#: forms.py:44
msgid "deux sur le bord droit"
msgstr ""
#: forms.py:51
msgid "2 trous à gauche"
msgstr ""
#: forms.py:52
msgid "2 trous à droite"
msgstr ""
#: forms.py:53
msgid "2 trous en haut"
msgstr ""
#: forms.py:54
msgid "2 trous en bas"
msgstr ""
#: forms.py:55
msgid "3 trous à gauche"
msgstr ""
#: forms.py:56
msgid "3 trous à droite"
msgstr ""
#: forms.py:57
msgid "3 trous en haut"
msgstr ""
#: forms.py:58
msgid "4 trous à gauche"
msgstr ""
#: forms.py:59
msgid "4 trous à droite"
msgstr ""
#: forms.py:60
msgid "4 trous en haut"
msgstr ""
#: forms.py:63
msgid "Nombre de copies"
msgstr ""
#: forms.py:78
msgid "Imprimer pour"
msgstr ""
#: templates/impressions/affichage.html:3
msgid "Impression"
msgstr ""
...
...
@@ -55,35 +174,35 @@ msgstr ""
msgid "Envoyer"
msgstr ""
#: templates/impressions/imprimante.html:1
1
#: templates/impressions/imprimante.html:1
3
msgid "Nom de domaine :"
msgstr ""
#: templates/impressions/imprimante.html:1
5
#: templates/impressions/imprimante.html:1
7
msgid "Status :"
msgstr ""
#: templates/impressions/imprimante.html:2
0
#: templates/impressions/imprimante.html:2
2
msgid "Bac de papiers"
msgstr ""
#: templates/impressions/imprimante.html:2
5
#: templates/impressions/imprimante.html:2
7
msgid "Nombre de page :"
msgstr ""
#: templates/impressions/imprimante.html:
27
#: templates/impressions/imprimante.html:
33
msgid "Format du papier :"
msgstr ""
#: templates/impressions/imprimante.html:
37
#: templates/impressions/imprimante.html:
43
msgid "Consommables"
msgstr ""
#: templates/impressions/imprimante.html:4
2
#: templates/impressions/imprimante.html:4
8
msgid "Pourcentage :"
msgstr ""
#: templates/impressions/imprimante.html:
5
3
#: templates/impressions/imprimante.html:
6
3
msgid "Alertes"
msgstr ""
...
...
@@ -148,3 +267,57 @@ msgstr ""
#: templates/impressions/liste.html:83
msgid "Retour à l'interface d'impression"
msgstr ""
#: views.py:195
#, python-format
msgid "Votre fichier %s n'est pas un fichier PDF."
msgstr ""
#: views.py:204
msgid "Impossible de récupérer les informations sur le fichier PDF."
msgstr ""
#: views.py:288
msgid "Solde insuffisant pour effectuer l'impression"
msgstr ""
#: views.py:299
msgid ""
"Votre fichier a bien été envoyé à l'impression \n"
" Le code pour entrer dans le batiment J est B7806 \n"
" Un code pour entrer dans le local impression a été généré : "
msgstr ""
#: views.py:302 views.py:304
msgid "Formulaire non pris en charge."
msgstr ""
#: views.py:390
#, python-format
msgid "La tâche %s a été annulée."
msgstr ""
#: views.py:413
msgid "Cette tâche n'est plus dans la file d'attente du serveur."
msgstr ""
#: views.py:420
msgid ""
"Vous n'êtes pas le propriétaire de cette tâche, vous ne pouvez pas l'annuler."
msgstr ""
#: views.py:423 views.py:445
msgid "Tâche introuvable, impossible de recréditer"
msgstr ""
#: views.py:426
msgid "Impossible de recréditer la tâche"
msgstr ""
#: views.py:437
msgid "Action impossible, jid introuvable"
msgstr ""
#: views.py:442
msgid "Droits imprimeurs requis"
msgstr ""
impressions/views.py
View file @
ed90a2c0
...
...
@@ -12,6 +12,7 @@ from django.contrib.auth.decorators import login_required, permission_required
from
django.utils.decorators
import
method_decorator
from
django.shortcuts
import
render_to_response
,
render
from
django.views.generic.detail
import
DetailView
from
django.utils.translation
import
ugettext_lazy
as
_
# Pour stocker des messages dans la session courante
from
django.contrib
import
messages
...
...
@@ -191,7 +192,7 @@ def view(request):
try
:
infos
=
pdfinfo
(
filepath
)
except
NotPdfFile
:
messages
.
error
(
request
,
u
"""Votre fichier %s n'est pas un fichier PDF."""
%
(
filename
))
messages
.
error
(
request
,
_
(
u
"Votre fichier %s n'est pas un fichier PDF."
)
%
(
filename
))
clubform
=
ClubForm
(
ldap_user
)
return
render
(
request
,
"impressions/impressions.html"
,
{
'uploadform'
:
uploadform
,
...
...
@@ -200,7 +201,7 @@ def view(request):
try
:
pageno
=
int
(
infos
[
"Pages"
])
except
(
KeyError
,
ValueError
)
as
e
:
messages
.
error
(
request
,
u
"""Impossible de récupérer les informations sur le fichier PDF."""
)
messages
.
error
(
request
,
_
(
u
"Impossible de récupérer les informations sur le fichier PDF."
)
)
clubform
=
ClubForm
(
ldap_user
)
return
render
(
request
,
"impressions/impressions.html"
,
{
'uploadform'
:
uploadform
,
...
...
@@ -284,7 +285,7 @@ def view(request):
try
:
job
.
imprime
()
except
ValueError
:
messages
.
error
(
request
,
u
"""Solde insuffisant pour effectuer l'impression"""
)
messages
.
error
(
request
,
_
(
u
"Solde insuffisant pour effectuer l'impression"
)
)
jo
.
result
=
"Cancelled"
jo
.
save
()
return
django
.
shortcuts
.
redirect
(
"/impressions/"
)
...
...
@@ -295,12 +296,12 @@ def view(request):
jo
.
save
()
unused_digits
=
Code
.
gen_random_code
()
code
=
Code
.
objects
.
create
(
digits
=
unused_digits
,
owner
=
request
.
user
)
messages
.
success
(
request
,
u
"""Votre fichier a bien été envoyé à l'impression
\n
Le code pour entrer dans le batiment J est B7806
\n
Un code pour entrer dans le local impression a été généré : """
+
unicode
(
unused_digits
)
+
u
"""#"""
)