gestioCOF/gestioncof/cms/translation.py

42 lines
899 B
Python
Raw Normal View History

2017-08-07 23:31:27 +02:00
from modeltranslation.decorators import register
2019-01-06 00:17:57 +01:00
from wagtail_modeltranslation.translator import WagtailTranslationOptions
from .models import (
COFActuIndexPage,
COFActuPage,
COFDirectoryEntryPage,
COFDirectoryPage,
COFPage,
COFRootPage,
)
2017-08-07 23:31:27 +02:00
2017-08-09 00:07:56 +02:00
@register(COFRootPage)
2019-01-06 00:17:57 +01:00
class COFRootPageTr(WagtailTranslationOptions):
2019-01-06 00:25:41 +01:00
fields = ("introduction",)
2017-08-09 00:07:56 +02:00
2019-01-06 00:17:57 +01:00
2017-08-07 23:31:27 +02:00
@register(COFPage)
class COFPageTr(WagtailTranslationOptions):
2019-01-06 00:25:41 +01:00
fields = ("body",)
2017-08-09 00:07:56 +02:00
2019-01-06 00:17:57 +01:00
2017-08-09 00:07:56 +02:00
@register(COFActuIndexPage)
class COFActuIndexPageTr(WagtailTranslationOptions):
2019-01-06 00:25:41 +01:00
fields = ()
2017-08-09 00:07:56 +02:00
2019-01-06 00:17:57 +01:00
2017-08-09 00:07:56 +02:00
@register(COFActuPage)
class COFActuPageTr(WagtailTranslationOptions):
2019-01-06 00:25:41 +01:00
fields = ("chapo", "body")
2017-08-09 00:07:56 +02:00
2019-01-06 00:17:57 +01:00
2017-08-09 00:07:56 +02:00
@register(COFDirectoryPage)
class COFDirectoryPageTr(WagtailTranslationOptions):
2019-01-06 00:25:41 +01:00
fields = ("introduction",)
2019-01-06 00:17:57 +01:00
2017-08-09 00:07:56 +02:00
@register(COFDirectoryEntryPage)
class COFDirectoryEntryPageTr(WagtailTranslationOptions):
2019-01-06 00:25:41 +01:00
fields = ("body", "links")