X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/b2d342589a7889a3b096e7192453d53bd28eed7d..972f33fb2d98a9ff59c931ac6a8a82def7cea6fe:/src/chunks/admin.py diff --git a/src/chunks/admin.py b/src/chunks/admin.py index 6da19ec2b..90b69ae7d 100644 --- a/src/chunks/admin.py +++ b/src/chunks/admin.py @@ -1,21 +1,31 @@ -# -*- coding: utf-8 -*- # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.contrib import admin - -from chunks.models import Chunk, Attachment +from django import forms +from chunks import models +from modeltranslation.admin import TranslationStackedInline class ChunkAdmin(admin.ModelAdmin): list_display = ('key', 'description',) search_fields = ('key', 'content',) -admin.site.register(Chunk, ChunkAdmin) +admin.site.register(models.Chunk, ChunkAdmin) class AttachmentAdmin(admin.ModelAdmin): list_display = ('key',) search_fields = ('key',) -admin.site.register(Attachment, AttachmentAdmin) +admin.site.register(models.Attachment, AttachmentAdmin) + + +class MenuItemInline(TranslationStackedInline): + model = models.MenuItem + extra = 1 + + +@admin.register(models.Menu) +class MenuAdmin(admin.ModelAdmin): + inlines = [MenuItemInline]