X-Git-Url: https://git.mdrn.pl/prawokultury.git/blobdiff_plain/44090c986d9a16f6913047c25319c446bb9308ad..3a2b863daf220221f8360db6e24072c6e102a50d:/events/admin.py diff --git a/events/admin.py b/events/admin.py index 2fb55d6..2d85789 100644 --- a/events/admin.py +++ b/events/admin.py @@ -2,7 +2,29 @@ # This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # +from django.conf import settings from django.contrib import admin +from fnpdjango.utils.models.translation import translated_fields from events.models import Event -admin.site.register(Event) + +class EventAdmin(admin.ModelAdmin): + fieldsets = ( + (None, {'fields': ('date', 'date_end', 'link')}), + ) + tuple( + (ln, {'fields': ( + ('published_%s' % lc), + 'title_%s' % lc, + 'organizer_%s' % lc, + 'place_%s' % lc, + )}) + for lc, ln in settings.LANGUAGES + ) + list_display = translated_fields( + ('title', 'place', 'organizer', 'published'), settings.LANGUAGES + ) + ('date',) + date_hierarchy = 'date' + list_filter = translated_fields(('published',)) + + +admin.site.register(Event, EventAdmin)