from __future__ import unicode_literals from django.db import models from wagtail.fields import RichTextField 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) section_one_img = RichTextField(blank=True, features=FULL_EDITOR) section_two_title = RichTextField(blank=True, features=FULL_EDITOR) section_two_text = RichTextField(blank=True, features=FULL_EDITOR) section_two_img = RichTextField(blank=True, features=FULL_EDITOR) section_three_title = RichTextField(blank=True, features=FULL_EDITOR) section_three_text = RichTextField(blank=True, features=FULL_EDITOR) section_three_img = RichTextField(blank=True, features=FULL_EDITOR) section_four_title = RichTextField(blank=True, features=FULL_EDITOR) section_four_text = RichTextField(blank=True, features=FULL_EDITOR) section_four_img = RichTextField(blank=True, features=FULL_EDITOR) section_five_title = RichTextField(blank=True, features=FULL_EDITOR) section_five_text = RichTextField(blank=True, features=FULL_EDITOR) section_five_img = RichTextField(blank=True, features=FULL_EDITOR) sub_section_one = RichTextField(blank=True, features=FULL_EDITOR) sub_section_one_img = RichTextField(blank=True, features=FULL_EDITOR) sub_section_two = RichTextField(blank=True, features=FULL_EDITOR) sub_section_two_img = RichTextField(blank=True, features=FULL_EDITOR) sub_section_three = RichTextField(blank=True, features=FULL_EDITOR) sub_section_three_img = RichTextField(blank=True, features=FULL_EDITOR) sub_section_four = RichTextField(blank=True, features=FULL_EDITOR) sub_section_four_img = RichTextField(blank=True, features=FULL_EDITOR) sub_section_five = RichTextField(blank=True, features=FULL_EDITOR) sub_section_five_img = RichTextField(blank=True, features=FULL_EDITOR) sub_section_six = RichTextField(blank=True, features=FULL_EDITOR) sub_section_six_img = RichTextField(blank=True, features=FULL_EDITOR) content_panels = Page.content_panels + [ MultiFieldPanel([ FieldPanel('section_one_title'), FieldPanel('section_one_text'), FieldPanel('section_one_img'), ], heading="Section 1"), MultiFieldPanel([ FieldPanel('section_two_title'), FieldPanel('section_two_text'), FieldPanel('section_two_img'), ], heading="Section 2"), MultiFieldPanel([ FieldPanel('section_three_title'), FieldPanel('section_three_text'), FieldPanel('section_three_img'), ], heading="Section 3"), MultiFieldPanel([ FieldPanel('section_four_title'), FieldPanel('section_four_text'), FieldPanel('section_four_img'), ], heading="Section 4"), MultiFieldPanel([ FieldPanel('section_five_title'), FieldPanel('section_five_text'), FieldPanel('section_five_img'), ], heading="Section 5"), MultiFieldPanel([ FieldPanel('sub_section_one'), FieldPanel('sub_section_one_img'), FieldPanel('sub_section_two'), FieldPanel('sub_section_two_img'), FieldPanel('sub_section_three'), FieldPanel('sub_section_three_img'), FieldPanel('sub_section_four'), FieldPanel('sub_section_four_img'), FieldPanel('sub_section_five'), FieldPanel('sub_section_five_img'), 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'), ]