2020-01-05 02:36:23 +00:00
|
|
|
from django.db import models
|
|
|
|
from django.conf import settings
|
2020-01-02 18:32:15 +00:00
|
|
|
from cms.models import BasePage, BaseSection
|
|
|
|
from cms.decorators import register_model
|
2020-01-02 00:56:15 +00:00
|
|
|
|
|
|
|
class Page(BasePage):
|
|
|
|
'''Add custom fields here. Already existing fields: position, title,
|
|
|
|
slug, menu
|
|
|
|
|
|
|
|
'''
|
2019-12-31 12:05:12 +00:00
|
|
|
|
|
|
|
class Section(BaseSection):
|
2020-01-02 00:56:15 +00:00
|
|
|
'''Add custom fields here. Already existing fields: type, position,
|
2020-01-05 02:36:23 +00:00
|
|
|
title, content, image, video, button_text, button_link
|
2019-12-31 12:05:12 +00:00
|
|
|
|
|
|
|
'''
|
2020-01-05 02:36:23 +00:00
|
|
|
color = models.PositiveIntegerField('kleur', default=1, choices=settings.SECTION_COLORS)
|
2019-12-31 12:05:12 +00:00
|
|
|
|
2020-01-02 18:32:15 +00:00
|
|
|
@register_model('Tekst')
|
2019-12-31 12:05:12 +00:00
|
|
|
class TextSection(Section):
|
2020-01-05 02:36:23 +00:00
|
|
|
fields = ['type', 'position', 'title', 'color', 'content']
|
|
|
|
class Meta:
|
|
|
|
proxy = True
|
|
|
|
|
|
|
|
@register_model('Button')
|
|
|
|
class ButtonSection(Section):
|
|
|
|
fields = ['type', 'position', 'title', 'button_text', 'button_link']
|
2019-12-31 12:05:12 +00:00
|
|
|
class Meta:
|
|
|
|
proxy = True
|
|
|
|
|
2020-01-02 18:32:15 +00:00
|
|
|
@register_model('Afbeelding')
|
2019-12-31 12:05:12 +00:00
|
|
|
class ImageSection(Section):
|
2019-12-31 13:06:08 +00:00
|
|
|
fields = ['type', 'position', 'title', 'image']
|
2019-12-31 12:05:12 +00:00
|
|
|
class Meta:
|
|
|
|
proxy = True
|
2020-01-02 18:32:15 +00:00
|
|
|
|
2020-01-05 02:36:23 +00:00
|
|
|
@register_model('Video')
|
|
|
|
class VideoSection(Section):
|
|
|
|
fields = ['type', 'position', 'title', 'video']
|
|
|
|
class Meta:
|
|
|
|
proxy = True
|
|
|
|
|
2020-01-02 18:32:15 +00:00
|
|
|
@register_model('Contact')
|
|
|
|
class ContactSection(Section):
|
|
|
|
fields = ['type', 'position', 'title']
|
|
|
|
class Meta:
|
|
|
|
proxy = True
|