Adding carousel

This commit is contained in:
2024-09-15 04:36:27 +02:00
parent eee8f5310d
commit 16190d5f15
49 changed files with 1152 additions and 10 deletions

View File

@@ -2,11 +2,13 @@ from __future__ import unicode_literals
from django.db import models
from wagtail.fields import RichTextField
from wagtail.admin.panels import FieldPanel, MultiFieldPanel
from wagtail.models import Page
from wagtail.admin.panels import FieldPanel, MultiFieldPanel, InlinePanel
from wagtail.models import Page, Orderable
from modelcluster.models import ParentalKey
from saburly.custom_editor import FULL_EDITOR
class ServicesPage(Page):
section_one_title = RichTextField(blank=True, features=FULL_EDITOR)
section_one_text = RichTextField(blank=True, features=FULL_EDITOR)
@@ -97,4 +99,24 @@ class ServicesPage(Page):
FieldPanel('sub_section_six'),
FieldPanel('sub_section_six_img'),
], heading="Section 5 Subfields"),
InlinePanel('carousel_services', heading="Carousel Services", label="Carousel Services"),
]
class ServicesPageCarousel(Orderable):
page = ParentalKey(ServicesPage, on_delete=models.CASCADE, related_name='carousel_services')
carousel_name = models.CharField(max_length=255, blank=True)
carousel_image = models.ForeignKey(
'wagtailimages.Image',
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+'
)
panels = [
FieldPanel('carousel_name'),
FieldPanel('carousel_image'),
]