mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-25 22:22:26 +00:00
Mark strings for translation in logs
This commit is contained in:
parent
2454de2032
commit
07ce7bd8a7
3 changed files with 22 additions and 21 deletions
|
@ -41,6 +41,7 @@ def can_view(user):
|
||||||
can = user.has_module_perms("admin")
|
can = user.has_module_perms("admin")
|
||||||
return (
|
return (
|
||||||
can,
|
can,
|
||||||
None if can else _("You don't have the right to view this" " application."),
|
None if can else _("You don't have the right to view this"
|
||||||
|
" application."),
|
||||||
"admin",
|
"admin",
|
||||||
)
|
)
|
||||||
|
|
|
@ -241,7 +241,7 @@ def stats_general(request):
|
||||||
Club.objects.filter(state=Club.STATE_ARCHIVE).count(),
|
Club.objects.filter(state=Club.STATE_ARCHIVE).count(),
|
||||||
],
|
],
|
||||||
"full_archive_users": [
|
"full_archive_users": [
|
||||||
_("Full Archived users"),
|
_("Fully archived users"),
|
||||||
User.objects.filter(state=User.STATE_FULL_ARCHIVE).count(),
|
User.objects.filter(state=User.STATE_FULL_ARCHIVE).count(),
|
||||||
(
|
(
|
||||||
Adherent.objects.filter(
|
Adherent.objects.filter(
|
||||||
|
@ -321,7 +321,7 @@ def stats_general(request):
|
||||||
_("Total number of IP addresses"),
|
_("Total number of IP addresses"),
|
||||||
_("Number of assigned IP addresses"),
|
_("Number of assigned IP addresses"),
|
||||||
_("Number of IP address assigned to an activated machine"),
|
_("Number of IP address assigned to an activated machine"),
|
||||||
_("Number of nonassigned IP addresses"),
|
_("Number of unassigned IP addresses"),
|
||||||
],
|
],
|
||||||
ip_dict, # Data already prepared
|
ip_dict, # Data already prepared
|
||||||
],
|
],
|
||||||
|
@ -336,7 +336,7 @@ def stats_models(request):
|
||||||
nombre d'users, d'écoles, de droits, de bannissements,
|
nombre d'users, d'écoles, de droits, de bannissements,
|
||||||
de factures, de ventes, de banque, de machines, etc"""
|
de factures, de ventes, de banque, de machines, etc"""
|
||||||
stats = {
|
stats = {
|
||||||
_("Users"): {
|
_("Users (members and clubs)"): {
|
||||||
"users": [User._meta.verbose_name, User.objects.count()],
|
"users": [User._meta.verbose_name, User.objects.count()],
|
||||||
"adherents": [Adherent._meta.verbose_name, Adherent.objects.count()],
|
"adherents": [Adherent._meta.verbose_name, Adherent.objects.count()],
|
||||||
"clubs": [Club._meta.verbose_name, Club.objects.count()],
|
"clubs": [Club._meta.verbose_name, Club.objects.count()],
|
||||||
|
@ -350,14 +350,14 @@ def stats_models(request):
|
||||||
"ban": [Ban._meta.verbose_name, Ban.objects.count()],
|
"ban": [Ban._meta.verbose_name, Ban.objects.count()],
|
||||||
"whitelist": [Whitelist._meta.verbose_name, Whitelist.objects.count()],
|
"whitelist": [Whitelist._meta.verbose_name, Whitelist.objects.count()],
|
||||||
},
|
},
|
||||||
_("Subscriptions"): {
|
Cotisation._meta.verbose_name_plural.title(): {
|
||||||
"factures": [Facture._meta.verbose_name, Facture.objects.count()],
|
"factures": [Facture._meta.verbose_name, Facture.objects.count()],
|
||||||
"vente": [Vente._meta.verbose_name, Vente.objects.count()],
|
"vente": [Vente._meta.verbose_name, Vente.objects.count()],
|
||||||
"cotisation": [Cotisation._meta.verbose_name, Cotisation.objects.count()],
|
"cotisation": [Cotisation._meta.verbose_name, Cotisation.objects.count()],
|
||||||
"article": [Article._meta.verbose_name, Article.objects.count()],
|
"article": [Article._meta.verbose_name, Article.objects.count()],
|
||||||
"banque": [Banque._meta.verbose_name, Banque.objects.count()],
|
"banque": [Banque._meta.verbose_name, Banque.objects.count()],
|
||||||
},
|
},
|
||||||
_("Machines"): {
|
Machine._meta.verbose_name_plural.title(): {
|
||||||
"machine": [Machine._meta.verbose_name, Machine.objects.count()],
|
"machine": [Machine._meta.verbose_name, Machine.objects.count()],
|
||||||
"typemachine": [
|
"typemachine": [
|
||||||
MachineType._meta.verbose_name,
|
MachineType._meta.verbose_name,
|
||||||
|
@ -412,31 +412,31 @@ def stats_users(request):
|
||||||
de moyens de paiements par user, de banque par user,
|
de moyens de paiements par user, de banque par user,
|
||||||
de bannissement par user, etc"""
|
de bannissement par user, etc"""
|
||||||
stats = {
|
stats = {
|
||||||
_("User"): {
|
User._meta.verbose_name: {
|
||||||
_("Machines"): User.objects.annotate(num=Count("machine")).order_by("-num")[
|
Machine._meta.verbose_name_plural: User.objects.annotate(num=Count("machine")).order_by("-num")[
|
||||||
:10
|
:10
|
||||||
],
|
],
|
||||||
_("Invoice"): User.objects.annotate(num=Count("facture")).order_by("-num")[
|
Facture._meta.verbose_name_plural: User.objects.annotate(num=Count("facture")).order_by("-num")[
|
||||||
:10
|
:10
|
||||||
],
|
],
|
||||||
_("Ban"): User.objects.annotate(num=Count("ban")).order_by("-num")[:10],
|
Ban._meta.verbose_name_plural: User.objects.annotate(num=Count("ban")).order_by("-num")[:10],
|
||||||
_("Whitelist"): User.objects.annotate(num=Count("whitelist")).order_by(
|
Whitelist._meta.verbose_name_plural: User.objects.annotate(num=Count("whitelist")).order_by(
|
||||||
"-num"
|
"-num"
|
||||||
)[:10],
|
)[:10],
|
||||||
_("Rights"): User.objects.annotate(num=Count("groups")).order_by("-num")[
|
_("rights"): User.objects.annotate(num=Count("groups")).order_by("-num")[
|
||||||
:10
|
:10
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
_("School"): {
|
School._meta.verbose_name: {
|
||||||
_("User"): School.objects.annotate(num=Count("user")).order_by("-num")[:10]
|
User._meta.verbose_name_plural: School.objects.annotate(num=Count("user")).order_by("-num")[:10]
|
||||||
},
|
},
|
||||||
_("Payment method"): {
|
Paiement._meta.verbose_name: {
|
||||||
_("User"): Paiement.objects.annotate(num=Count("facture")).order_by("-num")[
|
User._meta.verbose_name_plural: Paiement.objects.annotate(num=Count("facture")).order_by("-num")[
|
||||||
:10
|
:10
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
_("Bank"): {
|
Banque._meta.verbose_name: {
|
||||||
_("User"): Banque.objects.annotate(num=Count("facture")).order_by("-num")[
|
User._meta.verbose_name_plural: Banque.objects.annotate(num=Count("facture")).order_by("-num")[
|
||||||
:10
|
:10
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -451,8 +451,8 @@ def stats_actions(request):
|
||||||
utilisateurs.
|
utilisateurs.
|
||||||
Affiche le nombre de modifications aggrégées par utilisateurs"""
|
Affiche le nombre de modifications aggrégées par utilisateurs"""
|
||||||
stats = {
|
stats = {
|
||||||
_("User"): {
|
User._meta.verbose_name: {
|
||||||
_("Action"): User.objects.annotate(num=Count("revision")).order_by("-num")[
|
_("actions"): User.objects.annotate(num=Count("revision")).order_by("-num")[
|
||||||
:40
|
:40
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue