Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
re2o
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nounous
re2o
Commits
aa02016c
Commit
aa02016c
authored
Mar 31, 2018
by
Maël Kervella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Translation: Setup re2o to use locale and add French
parent
a7d47b97
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
571 additions
and
17 deletions
+571
-17
cotisations/forms.py
cotisations/forms.py
+5
-5
cotisations/locale/fr/LC_MESSAGES/django.mo
cotisations/locale/fr/LC_MESSAGES/django.mo
+0
-0
cotisations/locale/fr/LC_MESSAGES/django.po
cotisations/locale/fr/LC_MESSAGES/django.po
+553
-0
cotisations/models.py
cotisations/models.py
+5
-5
cotisations/views.py
cotisations/views.py
+6
-6
re2o/settings.py
re2o/settings.py
+2
-1
No files found.
cotisations/forms.py
View file @
aa02016c
...
...
@@ -80,11 +80,11 @@ class NewFactureForm(FormRevMixin, ModelForm):
banque
=
cleaned_data
.
get
(
'banque'
)
if
not
paiement
:
raise
forms
.
ValidationError
(
_
(
"A payment method must be specified"
)
_
(
"A payment method must be specified
.
"
)
)
elif
paiement
.
type_paiement
==
'check'
and
not
(
cheque
and
banque
):
raise
forms
.
ValidationError
(
_
(
"A cheque number and a bank must be specified"
)
_
(
"A cheque number and a bank must be specified
.
"
)
)
return
cleaned_data
...
...
@@ -225,7 +225,7 @@ class PaiementForm(FormRevMixin, ModelForm):
self
.
fields
[
'moyen'
]
.
label
=
_
(
"Payment method name"
)
self
.
fields
[
'type_paiement'
]
.
label
=
_
(
"Payment type"
)
self
.
fields
[
'type_paiement'
]
.
help_text
=
\
_
(
"The payement type is use for specific behaviour.
\
_
(
"The payement type is use
d
for specific behaviour.
\
The
\"
cheque
\"
type means a cheque number and a bank name
\
may be added when using this payment method."
)
...
...
@@ -349,7 +349,7 @@ class RechargeForm(FormRevMixin, Form):
if
value
<
OptionalUser
.
get_cached_value
(
'min_online_payment'
):
raise
forms
.
ValidationError
(
_
(
"Requested amount is too small. Minimum amount possible :
\
%(min_online_amount)
s €"
)
%
{
%(min_online_amount)
s €
.
"
)
%
{
min_online_amount
:
OptionalUser
.
get_cached_value
(
'min_online_payment'
)
...
...
@@ -358,7 +358,7 @@ class RechargeForm(FormRevMixin, Form):
if
value
+
self
.
user
.
solde
>
OptionalUser
.
get_cached_value
(
'max_solde'
):
raise
forms
.
ValidationError
(
_
(
"Requested amount is too high. Your balance can't exceed
\
%(max_online_balance)
s €"
)
%
{
%(max_online_balance)
s €
.
"
)
%
{
max_online_balance
:
OptionalUser
.
get_cached_value
(
'max_solde'
)
...
...
cotisations/locale/fr/LC_MESSAGES/django.mo
0 → 100644
View file @
aa02016c
File added
cotisations/locale/fr/LC_MESSAGES/django.po
0 → 100644
View file @
aa02016c
This diff is collapsed.
Click to expand it.
cotisations/models.py
View file @
aa02016c
...
...
@@ -105,7 +105,7 @@ class Facture(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
abstract
=
False
permissions
=
(
# TODO : change facture to invoice
(
'change_facture_control'
,
_
(
"Can change the
controlled
state"
)),
(
'change_facture_control'
,
_
(
"Can change the
\"
controlled
\"
state"
)),
# TODO : seems more likely to be call create_facture_pdf or create_invoice_pdf
(
'change_facture_pdf'
,
_
(
"Can create a custom PDF invoice"
)),
(
'view_facture'
,
_
(
"Can see an invoice's details"
)),
...
...
@@ -185,7 +185,7 @@ class Facture(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
@
staticmethod
def
can_change_control
(
user_request
,
*
args
,
**
kwargs
):
return
user_request
.
has_perm
(
'cotisations.change_facture_control'
),
_
(
"You don't have the right to edit the
controlled
state."
)
return
user_request
.
has_perm
(
'cotisations.change_facture_control'
),
_
(
"You don't have the right to edit the
\"
controlled
\"
state."
)
@
staticmethod
def
can_change_pdf
(
user_request
,
*
args
,
**
kwargs
):
...
...
@@ -338,7 +338,7 @@ class Vente(RevMixin, AclMixin, models.Model):
def
can_edit
(
self
,
user_request
,
*
args
,
**
kwargs
):
if
not
user_request
.
has_perm
(
'cotisations.change_vente'
):
return
False
,
_
(
"You don't have the right
s
to edit the purchases."
)
return
False
,
_
(
"You don't have the right to edit the purchases."
)
elif
not
user_request
.
has_perm
(
'cotisations.change_all_facture'
)
and
not
self
.
facture
.
user
.
can_edit
(
user_request
,
*
args
,
**
kwargs
)[
0
]:
return
False
,
_
(
"You don't have the right to edit this user's purchases."
)
elif
not
user_request
.
has_perm
(
'cotisations.change_all_vente'
)
and
\
...
...
@@ -541,7 +541,7 @@ class Cotisation(RevMixin, AclMixin, models.Model):
COTISATION_TYPE
=
(
(
'Connexion'
,
_
(
"Connexion"
)),
(
'Adhesion'
,
_
(
"
Adhesion
"
)),
(
'Adhesion'
,
_
(
"
Membership
"
)),
(
'All'
,
_
(
"Both of them"
)),
)
...
...
@@ -591,7 +591,7 @@ class Cotisation(RevMixin, AclMixin, models.Model):
def
can_view
(
self
,
user_request
,
*
args
,
**
kwargs
):
if
not
user_request
.
has_perm
(
'cotisations.view_cotisation'
)
and
\
self
.
vente
.
facture
.
user
!=
user_request
:
return
False
,
_
(
"You don't have the right to
display
someone else's cotisation history."
)
return
False
,
_
(
"You don't have the right to
see
someone else's cotisation history."
)
else
:
return
True
,
None
...
...
cotisations/views.py
View file @
aa02016c
...
...
@@ -296,7 +296,7 @@ def del_facture(request, facture, factureid):
if
request
.
method
==
"POST"
:
messages
.
success
(
request
,
_
(
"The invoice has been successfully deleted"
)
_
(
"The invoice has been successfully deleted
.
"
)
)
return
redirect
(
reverse
(
'cotisations:index'
))
return
form
({
...
...
@@ -327,7 +327,7 @@ def credit_solde(request, user, userid):
new_vente
.
save
()
messages
.
success
(
request
,
_
(
"Ba
n
lance successfully updated."
)
_
(
"Balance successfully updated."
)
)
return
redirect
(
reverse
(
'cotisations:index'
))
return
form
({
'factureform'
:
facture
,
'action_name'
:
'Créditer'
},
'cotisations/facture.html'
,
request
)
...
...
@@ -442,14 +442,14 @@ def del_paiement(request, instances):
messages
.
success
(
request
,
_
(
"The payment method
%(method_name)
s has been
\
successfully deleted"
)
%
{
successfully deleted
.
"
)
%
{
method_name
:
paiement_del
}
)
except
ProtectedError
:
messages
.
error
(
request
,
_
(
"The payment method
%(method_name)
can't be deleted
\
_
(
"The payment method
%(method_name)
s
can't be deleted
\
because there are invoices using it."
)
%
{
method_name
:
paiement_del
}
...
...
@@ -677,8 +677,8 @@ def new_facture_solde(request, userid):
for
art_item
in
articles
if
art_item
.
cleaned_data
):
messages
.
success
(
request
,
_
(
"The
balance
of
%(member_name)
s has been successfully
\
extended to
%(end_date)
s"
)
%
{
_
(
"The
cotisation
of
%(member_name)
s has been successfully
\
extended to
%(end_date)
s
.
"
)
%
{
member_name
:
user
.
pseudo
,
end_date
:
user
.
end_adhesion
()
}
...
...
re2o/settings.py
View file @
aa02016c
...
...
@@ -82,6 +82,7 @@ INSTALLED_APPS = (
MIDDLEWARE_CLASSES
=
(
'django.contrib.sessions.middleware.SessionMiddleware'
,
'django.middleware.locale.LocaleMiddleware'
,
'django.middleware.common.CommonMiddleware'
,
'django.middleware.csrf.CsrfViewMiddleware'
,
'django.contrib.auth.middleware.AuthenticationMiddleware'
,
...
...
@@ -120,7 +121,7 @@ WSGI_APPLICATION = 're2o.wsgi.application'
# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/
LANGUAGE_CODE
=
'
fr-fr
'
LANGUAGE_CODE
=
'
en
'
TIME_ZONE
=
'Europe/Paris'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment