💄 Improve Django Admin

This commit is contained in:
Yohann D'ANELLO 2020-08-01 15:13:29 +02:00
parent 59bfdbbfc7
commit b6453ce03d
7 changed files with 180 additions and 85 deletions

View File

@ -4,6 +4,9 @@
from django.contrib import admin from django.contrib import admin
from django.contrib.auth.admin import UserAdmin from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.utils.translation import gettext_lazy as _
from note.templatetags.pretty_money import pretty_money
from note_kfet.admin import admin_site from note_kfet.admin import admin_site
from .forms import ProfileForm from .forms import ProfileForm
@ -18,6 +21,7 @@ class ProfileInline(admin.StackedInline):
can_delete = False can_delete = False
@admin.register(User, site=admin_site)
class CustomUserAdmin(UserAdmin): class CustomUserAdmin(UserAdmin):
inlines = (ProfileInline,) inlines = (ProfileInline,)
list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff') list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff')
@ -33,9 +37,33 @@ class CustomUserAdmin(UserAdmin):
return super().get_inline_instances(request, obj) return super().get_inline_instances(request, obj)
# Update Django User with profile @admin.register(Club, site=admin_site)
admin_site.register(User, CustomUserAdmin) class ClubAdmin(admin.ModelAdmin):
list_display = ('name', 'parent_club', 'email', 'require_memberships', 'pretty_fee_paid',
'pretty_fee_unpaid', 'membership_start', 'membership_end',)
ordering = ('name',)
search_fields = ('name', 'email',)
# Add other models def pretty_fee_paid(self, obj):
admin_site.register(Club) return pretty_money(obj.membership_fee_paid)
admin_site.register(Membership)
def pretty_fee_unpaid(self, obj):
return pretty_money(obj.membership_fee_unpaid)
pretty_fee_paid.short_description = _("membership fee (paid students)")
pretty_fee_unpaid.short_description = _("membership fee (unpaid students)")
@admin.register(Membership, site=admin_site)
class MembershipAdmin(admin.ModelAdmin):
list_display = ('user', 'club', 'date_start', 'date_end', 'view_roles', 'pretty_fee',)
ordering = ('-date_start', 'club')
def view_roles(self, obj):
return ", ".join(role.name for role in obj.roles.all())
def pretty_fee(self, obj):
return pretty_money(obj.fee)
view_roles.short_description = _("roles")
pretty_fee.short_description = _("fee")

View File

@ -10,6 +10,7 @@ from note_kfet.admin import admin_site
from .models.notes import Alias, Note, NoteClub, NoteSpecial, NoteUser from .models.notes import Alias, Note, NoteClub, NoteSpecial, NoteUser
from .models.transactions import Transaction, TemplateCategory, TransactionTemplate, \ from .models.transactions import Transaction, TemplateCategory, TransactionTemplate, \
RecurrentTransaction, MembershipTransaction, SpecialTransaction RecurrentTransaction, MembershipTransaction, SpecialTransaction
from .templatetags.pretty_money import pretty_money
class AliasInlines(admin.TabularInline): class AliasInlines(admin.TabularInline):
@ -37,7 +38,7 @@ class NoteAdmin(PolymorphicParentModelAdmin):
# Organize notes by registration date # Organize notes by registration date
date_hierarchy = 'created_at' date_hierarchy = 'created_at'
ordering = ['-created_at'] ordering = ['name']
# Search by aliases # Search by aliases
search_fields = ['alias__name'] search_fields = ['alias__name']
@ -74,6 +75,18 @@ class NoteSpecialAdmin(PolymorphicChildModelAdmin):
""" """
readonly_fields = ('balance',) readonly_fields = ('balance',)
def has_add_permission(self, request):
"""
A club note should not be manually added
"""
return False
def has_delete_permission(self, request, obj=None):
"""
A club note should not be manually removed
"""
return False
@admin.register(NoteUser, site=admin_site) @admin.register(NoteUser, site=admin_site)
class NoteUserAdmin(PolymorphicChildModelAdmin): class NoteUserAdmin(PolymorphicChildModelAdmin):
@ -103,11 +116,11 @@ class TransactionAdmin(PolymorphicParentModelAdmin):
""" """
Admin customisation for Transaction Admin customisation for Transaction
""" """
child_models = (RecurrentTransaction, MembershipTransaction, SpecialTransaction) child_models = (Transaction, RecurrentTransaction, MembershipTransaction, SpecialTransaction)
list_display = ('created_at', 'poly_source', 'poly_destination', list_display = ('created_at', 'poly_source', 'poly_destination',
'quantity', 'amount', 'valid') 'quantity', 'amount', 'valid')
list_filter = ('valid',) list_filter = ('valid',)
autocomplete_fields = ( readonly_fields = (
'source', 'source',
'destination', 'destination',
) )
@ -146,6 +159,13 @@ class MembershipTransactionAdmin(PolymorphicChildModelAdmin):
""" """
@admin.register(RecurrentTransaction, site=admin_site)
class RecurrentTransactionAdmin(PolymorphicChildModelAdmin):
"""
Admin customisation for RecurrentTransaction
"""
@admin.register(SpecialTransaction, site=admin_site) @admin.register(SpecialTransaction, site=admin_site)
class SpecialTransactionAdmin(PolymorphicChildModelAdmin): class SpecialTransactionAdmin(PolymorphicChildModelAdmin):
""" """
@ -158,8 +178,9 @@ class TransactionTemplateAdmin(admin.ModelAdmin):
""" """
Admin customisation for TransactionTemplate Admin customisation for TransactionTemplate
""" """
list_display = ('name', 'poly_destination', 'amount', 'category', 'display',) list_display = ('name', 'poly_destination', 'pretty_amount', 'category', 'display', 'highlighted',)
list_filter = ('category', 'display') list_filter = ('category', 'display', 'highlighted',)
search_fields = ('name', 'destination__club__name', 'amount',)
autocomplete_fields = ('destination',) autocomplete_fields = ('destination',)
def poly_destination(self, obj): def poly_destination(self, obj):
@ -170,6 +191,11 @@ class TransactionTemplateAdmin(admin.ModelAdmin):
poly_destination.short_description = _('destination') poly_destination.short_description = _('destination')
def pretty_amount(self, obj):
return pretty_money(obj.amount)
pretty_amount.short_description = _("amount")
@admin.register(TemplateCategory, site=admin_site) @admin.register(TemplateCategory, site=admin_site)
class TemplateCategoryAdmin(admin.ModelAdmin): class TemplateCategoryAdmin(admin.ModelAdmin):
@ -177,4 +203,3 @@ class TemplateCategoryAdmin(admin.ModelAdmin):
Admin customisation for TransactionTemplate Admin customisation for TransactionTemplate
""" """
list_display = ('name',) list_display = ('name',)
list_filter = ('name',)

View File

@ -20,7 +20,9 @@ class PermissionAdmin(admin.ModelAdmin):
""" """
Admin customisation for Permission Admin customisation for Permission
""" """
list_display = ('type', 'model', 'field', 'mask', 'description', ) list_display = ('description', 'type', 'model', 'field', 'mask', )
list_filter = ('type', 'mask', 'model',)
search_fields = ('description', 'field',)
@admin.register(Role, site=admin_site) @admin.register(Role, site=admin_site)

View File

@ -28,4 +28,15 @@ class RemittanceAdmin(admin.ModelAdmin):
return not obj.closed and super().has_change_permission(request, obj) return not obj.closed and super().has_change_permission(request, obj)
admin_site.register(SogeCredit) @admin.register(SogeCredit, site=admin_site)
class SogeCreditAdmin(admin.ModelAdmin):
"""
Admin customisation for Remittance
"""
list_display = ('user', 'valid',)
readonly_fields = ('transactions', 'credit_transaction',)
def has_add_permission(self, request):
# Don't create a credit manually
return False

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-01 10:47+0200\n" "POT-Creation-Date: 2020-08-01 15:06+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -193,7 +193,7 @@ msgstr ""
#: apps/activity/tables.py:79 apps/member/forms.py:107 #: apps/activity/tables.py:79 apps/member/forms.py:107
#: apps/registration/forms.py:69 apps/treasury/forms.py:122 #: apps/registration/forms.py:69 apps/treasury/forms.py:122
#: templates/note/transaction_form.html:127 #: templates/note/transaction_form.html:129
msgid "First name" msgid "First name"
msgstr "" msgstr ""
@ -291,6 +291,24 @@ msgstr ""
msgid "changelogs" msgid "changelogs"
msgstr "" msgstr ""
#: apps/member/admin.py:53 apps/member/models.py:178
#: templates/member/club_info.html:41
msgid "membership fee (paid students)"
msgstr ""
#: apps/member/admin.py:54 apps/member/models.py:183
#: templates/member/club_info.html:44
msgid "membership fee (unpaid students)"
msgstr ""
#: apps/member/admin.py:68 apps/member/models.py:270
msgid "roles"
msgstr ""
#: apps/member/admin.py:69 apps/member/models.py:284
msgid "fee"
msgstr ""
#: apps/member/apps.py:14 apps/wei/tables.py:150 apps/wei/tables.py:181 #: apps/member/apps.py:14 apps/wei/tables.py:150 apps/wei/tables.py:181
msgid "member" msgid "member"
msgstr "" msgstr ""
@ -324,7 +342,7 @@ msgid "Credit amount"
msgstr "" msgstr ""
#: apps/member/forms.py:112 apps/registration/forms.py:74 #: apps/member/forms.py:112 apps/registration/forms.py:74
#: apps/treasury/forms.py:124 templates/note/transaction_form.html:133 #: apps/treasury/forms.py:124 templates/note/transaction_form.html:135
msgid "Bank" msgid "Bank"
msgstr "" msgstr ""
@ -478,14 +496,6 @@ msgstr ""
msgid "Uncheck if this club don't require memberships." msgid "Uncheck if this club don't require memberships."
msgstr "" msgstr ""
#: apps/member/models.py:178 templates/member/club_info.html:41
msgid "membership fee (paid students)"
msgstr ""
#: apps/member/models.py:183 templates/member/club_info.html:44
msgid "membership fee (unpaid students)"
msgstr ""
#: apps/member/models.py:189 templates/member/club_info.html:33 #: apps/member/models.py:189 templates/member/club_info.html:33
msgid "membership duration" msgid "membership duration"
msgstr "" msgstr ""
@ -521,10 +531,6 @@ msgstr ""
msgid "clubs" msgid "clubs"
msgstr "" msgstr ""
#: apps/member/models.py:270
msgid "roles"
msgstr ""
#: apps/member/models.py:275 #: apps/member/models.py:275
msgid "membership starts on" msgid "membership starts on"
msgstr "" msgstr ""
@ -533,10 +539,6 @@ msgstr ""
msgid "membership ends on" msgid "membership ends on"
msgstr "" msgstr ""
#: apps/member/models.py:284
msgid "fee"
msgstr ""
#: apps/member/models.py:303 apps/member/views.py:535 apps/wei/views.py:797 #: apps/member/models.py:303 apps/member/views.py:535 apps/wei/views.py:797
msgid "User is not a member of the parent club" msgid "User is not a member of the parent club"
msgstr "" msgstr ""
@ -645,15 +647,20 @@ msgstr ""
msgid "Members of the club" msgid "Members of the club"
msgstr "" msgstr ""
#: apps/note/admin.py:121 apps/note/models/transactions.py:106 #: apps/note/admin.py:134 apps/note/models/transactions.py:106
msgid "source" msgid "source"
msgstr "" msgstr ""
#: apps/note/admin.py:129 apps/note/admin.py:171 #: apps/note/admin.py:142 apps/note/admin.py:192
#: apps/note/models/transactions.py:55 apps/note/models/transactions.py:119 #: apps/note/models/transactions.py:55 apps/note/models/transactions.py:119
msgid "destination" msgid "destination"
msgstr "" msgstr ""
#: apps/note/admin.py:197 apps/note/models/transactions.py:59
#: apps/note/models/transactions.py:137
msgid "amount"
msgstr ""
#: apps/note/forms.py:14 #: apps/note/forms.py:14
msgid "select an image" msgid "select an image"
msgstr "" msgstr ""
@ -775,10 +782,6 @@ msgstr ""
msgid "A template with this name already exist" msgid "A template with this name already exist"
msgstr "" msgstr ""
#: apps/note/models/transactions.py:59 apps/note/models/transactions.py:137
msgid "amount"
msgstr ""
#: apps/note/models/transactions.py:60 #: apps/note/models/transactions.py:60
msgid "in centimes" msgid "in centimes"
msgstr "" msgstr ""
@ -834,7 +837,7 @@ msgstr ""
#: apps/note/models/transactions.py:230 #: apps/note/models/transactions.py:230
#: templates/activity/activity_entry.html:13 templates/base.html:99 #: templates/activity/activity_entry.html:13 templates/base.html:99
#: templates/note/transaction_form.html:15 #: templates/note/transaction_form.html:15
#: templates/note/transaction_form.html:141 #: templates/note/transaction_form.html:143
msgid "Transfer" msgid "Transfer"
msgstr "" msgstr ""
@ -1128,7 +1131,7 @@ msgid "You can't change the type of the remittance."
msgstr "" msgstr ""
#: apps/treasury/forms.py:126 apps/treasury/tables.py:47 #: apps/treasury/forms.py:126 apps/treasury/tables.py:47
#: apps/treasury/tables.py:113 templates/note/transaction_form.html:95 #: apps/treasury/tables.py:113 templates/note/transaction_form.html:97
#: templates/treasury/remittance_form.html:18 #: templates/treasury/remittance_form.html:18
msgid "Amount" msgid "Amount"
msgstr "" msgstr ""
@ -1149,7 +1152,7 @@ msgstr ""
msgid "Description" msgid "Description"
msgstr "" msgstr ""
#: apps/treasury/models.py:48 templates/note/transaction_form.html:121 #: apps/treasury/models.py:48 templates/note/transaction_form.html:123
msgid "Name" msgid "Name"
msgstr "" msgstr ""
@ -1942,7 +1945,7 @@ msgid "Consum"
msgstr "" msgstr ""
#: templates/note/conso_form.html:39 templates/note/transaction_form.html:57 #: templates/note/conso_form.html:39 templates/note/transaction_form.html:57
#: templates/note/transaction_form.html:76 #: templates/note/transaction_form.html:78
msgid "Name or alias..." msgid "Name or alias..."
msgstr "" msgstr ""
@ -1966,7 +1969,7 @@ msgstr ""
msgid "Double consumptions" msgid "Double consumptions"
msgstr "" msgstr ""
#: templates/note/conso_form.html:150 templates/note/transaction_form.html:152 #: templates/note/conso_form.html:150 templates/note/transaction_form.html:154
msgid "Recent transactions history" msgid "Recent transactions history"
msgstr "" msgstr ""
@ -1974,23 +1977,23 @@ msgstr ""
msgid "Select emitters" msgid "Select emitters"
msgstr "" msgstr ""
#: templates/note/transaction_form.html:60 #: templates/note/transaction_form.html:61
msgid "I am the emitter" msgid "I am the emitter"
msgstr "" msgstr ""
#: templates/note/transaction_form.html:70 #: templates/note/transaction_form.html:72
msgid "Select receivers" msgid "Select receivers"
msgstr "" msgstr ""
#: templates/note/transaction_form.html:87 #: templates/note/transaction_form.html:89
msgid "Action" msgid "Action"
msgstr "" msgstr ""
#: templates/note/transaction_form.html:102 #: templates/note/transaction_form.html:104
msgid "Reason" msgid "Reason"
msgstr "" msgstr ""
#: templates/note/transaction_form.html:111 #: templates/note/transaction_form.html:113
msgid "Transfer type" msgid "Transfer type"
msgstr "" msgstr ""
@ -2102,7 +2105,7 @@ msgid "Log in again"
msgstr "" msgstr ""
#: templates/registration/login.html:7 templates/registration/login.html:8 #: templates/registration/login.html:7 templates/registration/login.html:8
#: templates/registration/login.html:22 #: templates/registration/login.html:31
#: templates/registration/password_reset_complete.html:10 #: templates/registration/password_reset_complete.html:10
msgid "Log in" msgid "Log in"
msgstr "" msgstr ""
@ -2116,6 +2119,12 @@ msgid ""
msgstr "" msgstr ""
#: templates/registration/login.html:23 #: templates/registration/login.html:23
msgid ""
"You must be logged with a staff account with the higher mask to access "
"Django Admin."
msgstr ""
#: templates/registration/login.html:32
msgid "Forgotten your password or username?" msgid "Forgotten your password or username?"
msgstr "" msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-01 10:47+0200\n" "POT-Creation-Date: 2020-08-01 15:06+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -194,7 +194,7 @@ msgstr "Nom de famille"
#: apps/activity/tables.py:79 apps/member/forms.py:107 #: apps/activity/tables.py:79 apps/member/forms.py:107
#: apps/registration/forms.py:69 apps/treasury/forms.py:122 #: apps/registration/forms.py:69 apps/treasury/forms.py:122
#: templates/note/transaction_form.html:127 #: templates/note/transaction_form.html:129
msgid "First name" msgid "First name"
msgstr "Prénom" msgstr "Prénom"
@ -292,6 +292,24 @@ msgstr "journal de modification"
msgid "changelogs" msgid "changelogs"
msgstr "journaux de modifications" msgstr "journaux de modifications"
#: apps/member/admin.py:53 apps/member/models.py:178
#: templates/member/club_info.html:41
msgid "membership fee (paid students)"
msgstr "cotisation pour adhérer (normalien élève)"
#: apps/member/admin.py:54 apps/member/models.py:183
#: templates/member/club_info.html:44
msgid "membership fee (unpaid students)"
msgstr "cotisation pour adhérer (normalien étudiant)"
#: apps/member/admin.py:68 apps/member/models.py:270
msgid "roles"
msgstr "rôles"
#: apps/member/admin.py:69 apps/member/models.py:284
msgid "fee"
msgstr "cotisation"
#: apps/member/apps.py:14 apps/wei/tables.py:150 apps/wei/tables.py:181 #: apps/member/apps.py:14 apps/wei/tables.py:150 apps/wei/tables.py:181
msgid "member" msgid "member"
msgstr "adhérent" msgstr "adhérent"
@ -325,7 +343,7 @@ msgid "Credit amount"
msgstr "Montant à créditer" msgstr "Montant à créditer"
#: apps/member/forms.py:112 apps/registration/forms.py:74 #: apps/member/forms.py:112 apps/registration/forms.py:74
#: apps/treasury/forms.py:124 templates/note/transaction_form.html:133 #: apps/treasury/forms.py:124 templates/note/transaction_form.html:135
msgid "Bank" msgid "Bank"
msgstr "Banque" msgstr "Banque"
@ -479,14 +497,6 @@ msgstr "nécessite des adhésions"
msgid "Uncheck if this club don't require memberships." msgid "Uncheck if this club don't require memberships."
msgstr "Décochez si ce club n'utilise pas d'adhésions." msgstr "Décochez si ce club n'utilise pas d'adhésions."
#: apps/member/models.py:178 templates/member/club_info.html:41
msgid "membership fee (paid students)"
msgstr "cotisation pour adhérer (normalien élève)"
#: apps/member/models.py:183 templates/member/club_info.html:44
msgid "membership fee (unpaid students)"
msgstr "cotisation pour adhérer (normalien étudiant)"
#: apps/member/models.py:189 templates/member/club_info.html:33 #: apps/member/models.py:189 templates/member/club_info.html:33
msgid "membership duration" msgid "membership duration"
msgstr "durée de l'adhésion" msgstr "durée de l'adhésion"
@ -526,10 +536,6 @@ msgstr "club"
msgid "clubs" msgid "clubs"
msgstr "clubs" msgstr "clubs"
#: apps/member/models.py:270
msgid "roles"
msgstr "rôles"
#: apps/member/models.py:275 #: apps/member/models.py:275
msgid "membership starts on" msgid "membership starts on"
msgstr "l'adhésion commence le" msgstr "l'adhésion commence le"
@ -538,10 +544,6 @@ msgstr "l'adhésion commence le"
msgid "membership ends on" msgid "membership ends on"
msgstr "l'adhésion finit le" msgstr "l'adhésion finit le"
#: apps/member/models.py:284
msgid "fee"
msgstr "cotisation"
#: apps/member/models.py:303 apps/member/views.py:535 apps/wei/views.py:797 #: apps/member/models.py:303 apps/member/views.py:535 apps/wei/views.py:797
msgid "User is not a member of the parent club" msgid "User is not a member of the parent club"
msgstr "L'utilisateur n'est pas membre du club parent" msgstr "L'utilisateur n'est pas membre du club parent"
@ -652,15 +654,20 @@ msgstr "Gérer les rôles d'un utilisateur dans le club"
msgid "Members of the club" msgid "Members of the club"
msgstr "Membres du club" msgstr "Membres du club"
#: apps/note/admin.py:121 apps/note/models/transactions.py:106 #: apps/note/admin.py:134 apps/note/models/transactions.py:106
msgid "source" msgid "source"
msgstr "source" msgstr "source"
#: apps/note/admin.py:129 apps/note/admin.py:171 #: apps/note/admin.py:142 apps/note/admin.py:192
#: apps/note/models/transactions.py:55 apps/note/models/transactions.py:119 #: apps/note/models/transactions.py:55 apps/note/models/transactions.py:119
msgid "destination" msgid "destination"
msgstr "destination" msgstr "destination"
#: apps/note/admin.py:197 apps/note/models/transactions.py:59
#: apps/note/models/transactions.py:137
msgid "amount"
msgstr "montant"
#: apps/note/forms.py:14 #: apps/note/forms.py:14
msgid "select an image" msgid "select an image"
msgstr "Choisissez une image" msgstr "Choisissez une image"
@ -783,10 +790,6 @@ msgstr "catégories de transaction"
msgid "A template with this name already exist" msgid "A template with this name already exist"
msgstr "Un modèle de transaction avec un nom similaire existe déjà." msgstr "Un modèle de transaction avec un nom similaire existe déjà."
#: apps/note/models/transactions.py:59 apps/note/models/transactions.py:137
msgid "amount"
msgstr "montant"
#: apps/note/models/transactions.py:60 #: apps/note/models/transactions.py:60
msgid "in centimes" msgid "in centimes"
msgstr "en centimes" msgstr "en centimes"
@ -844,7 +847,7 @@ msgstr ""
#: apps/note/models/transactions.py:230 #: apps/note/models/transactions.py:230
#: templates/activity/activity_entry.html:13 templates/base.html:99 #: templates/activity/activity_entry.html:13 templates/base.html:99
#: templates/note/transaction_form.html:15 #: templates/note/transaction_form.html:15
#: templates/note/transaction_form.html:141 #: templates/note/transaction_form.html:143
msgid "Transfer" msgid "Transfer"
msgstr "Virement" msgstr "Virement"
@ -1155,7 +1158,7 @@ msgid "You can't change the type of the remittance."
msgstr "Vous ne pouvez pas changer le type de la remise." msgstr "Vous ne pouvez pas changer le type de la remise."
#: apps/treasury/forms.py:126 apps/treasury/tables.py:47 #: apps/treasury/forms.py:126 apps/treasury/tables.py:47
#: apps/treasury/tables.py:113 templates/note/transaction_form.html:95 #: apps/treasury/tables.py:113 templates/note/transaction_form.html:97
#: templates/treasury/remittance_form.html:18 #: templates/treasury/remittance_form.html:18
msgid "Amount" msgid "Amount"
msgstr "Montant" msgstr "Montant"
@ -1176,7 +1179,7 @@ msgstr "Objet"
msgid "Description" msgid "Description"
msgstr "Description" msgstr "Description"
#: apps/treasury/models.py:48 templates/note/transaction_form.html:121 #: apps/treasury/models.py:48 templates/note/transaction_form.html:123
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
@ -2002,7 +2005,7 @@ msgid "Consum"
msgstr "Consommer" msgstr "Consommer"
#: templates/note/conso_form.html:39 templates/note/transaction_form.html:57 #: templates/note/conso_form.html:39 templates/note/transaction_form.html:57
#: templates/note/transaction_form.html:76 #: templates/note/transaction_form.html:78
msgid "Name or alias..." msgid "Name or alias..."
msgstr "Pseudo ou alias ..." msgstr "Pseudo ou alias ..."
@ -2026,7 +2029,7 @@ msgstr "Consommations simples"
msgid "Double consumptions" msgid "Double consumptions"
msgstr "Consommations doubles" msgstr "Consommations doubles"
#: templates/note/conso_form.html:150 templates/note/transaction_form.html:152 #: templates/note/conso_form.html:150 templates/note/transaction_form.html:154
msgid "Recent transactions history" msgid "Recent transactions history"
msgstr "Historique des transactions récentes" msgstr "Historique des transactions récentes"
@ -2034,23 +2037,23 @@ msgstr "Historique des transactions récentes"
msgid "Select emitters" msgid "Select emitters"
msgstr "Sélection des émetteurs" msgstr "Sélection des émetteurs"
#: templates/note/transaction_form.html:60 #: templates/note/transaction_form.html:61
msgid "I am the emitter" msgid "I am the emitter"
msgstr "Je suis l'émetteur" msgstr "Je suis l'émetteur"
#: templates/note/transaction_form.html:70 #: templates/note/transaction_form.html:72
msgid "Select receivers" msgid "Select receivers"
msgstr "Sélection des destinataires" msgstr "Sélection des destinataires"
#: templates/note/transaction_form.html:87 #: templates/note/transaction_form.html:89
msgid "Action" msgid "Action"
msgstr "Action" msgstr "Action"
#: templates/note/transaction_form.html:102 #: templates/note/transaction_form.html:104
msgid "Reason" msgid "Reason"
msgstr "Raison" msgstr "Raison"
#: templates/note/transaction_form.html:111 #: templates/note/transaction_form.html:113
msgid "Transfer type" msgid "Transfer type"
msgstr "Type de transfert" msgstr "Type de transfert"
@ -2166,7 +2169,7 @@ msgid "Log in again"
msgstr "Se connecter à nouveau" msgstr "Se connecter à nouveau"
#: templates/registration/login.html:7 templates/registration/login.html:8 #: templates/registration/login.html:7 templates/registration/login.html:8
#: templates/registration/login.html:22 #: templates/registration/login.html:31
#: templates/registration/password_reset_complete.html:10 #: templates/registration/password_reset_complete.html:10
msgid "Log in" msgid "Log in"
msgstr "Se connecter" msgstr "Se connecter"
@ -2183,6 +2186,14 @@ msgstr ""
"masque de permissions plus fort ?" "masque de permissions plus fort ?"
#: templates/registration/login.html:23 #: templates/registration/login.html:23
msgid ""
"You must be logged with a staff account with the higher mask to access "
"Django Admin."
msgstr ""
"Vous devez être connecté avec un compte staff avec le masque le plus haut "
"pour accéder à Django Admin."
#: templates/registration/login.html:32
msgid "Forgotten your password or username?" msgid "Forgotten your password or username?"
msgstr "Mot de passe ou pseudo oublié ?" msgstr "Mot de passe ou pseudo oublié ?"

View File

@ -17,6 +17,15 @@ SPDX-License-Identifier: GPL-2.0-or-later
{% endblocktrans %} {% endblocktrans %}
</p> </p>
{% endif %} {% endif %}
{% if request.resolver_match.view_name == 'admin:login' %}
<div class="alert alert-info">
{% blocktrans trimmed %}
You must be logged with a staff account with the higher mask to access Django Admin.
{% endblocktrans %}
</div>
{% endif %}
<form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %} <form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}
{{ form | crispy }} {{ form | crispy }}
<input type="submit" value="{% trans 'Log in' %}" class="btn btn-primary"> <input type="submit" value="{% trans 'Log in' %}" class="btn btn-primary">