Beispiel #1
0
class AboutUkRegionListingPage(
    panels.AboutUkRegionListingPagePanels,
    WagtailAdminExclusivePageMixin,
    BaseInternationalPage
):

    slug_identity = 'regions'

    parent_page_types = [
        'great_international.InvestmentAtlasLandingPage',
    ]
    subpage_types = [
        'great_international.AboutUkRegionPage',
    ]

    breadcrumbs_label = models.CharField(max_length=255)
    hero_title = models.CharField(max_length=255)
    hero_image = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        on_delete=models.SET_NULL,
        related_name='+',
        blank=True
    )
    hero_video = models.ForeignKey(
        'wagtailmedia.Media',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
    )

    intro = MarkdownField(blank=True)

    contact_title = models.CharField(max_length=255, blank=True)
    contact_text = MarkdownField(blank=True)
    contact_cta_text = models.CharField(max_length=255, blank=True)
    contact_cta_link = models.CharField(max_length=255, blank=True)

    related_page_one = models.ForeignKey(
        'wagtailcore.Page',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+'
    )
    related_page_two = models.ForeignKey(
        'wagtailcore.Page',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+'
    )
    related_page_three = models.ForeignKey(
        'wagtailcore.Page',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+'
    )
Beispiel #2
0
class HomePage(ExclusivePageMixin, BasePage):
    service_name_value = cms.EXPORT_READINESS
    slug_identity = cms.GREAT_HOME_SLUG
    subpage_types = [
        'export_readiness.TopicLandingPage',
        'export_readiness.ArticleListingPage', 'export_readiness.ArticlePage'
    ]

    banner_content = MarkdownField()
    banner_label = models.CharField(max_length=50, null=True, blank=True)
    news_title = models.CharField(max_length=255)
    news_description = MarkdownField()

    content_panels = [
        MultiFieldPanel(heading='EU Exit banner',
                        children=[
                            FieldPanel('banner_label'),
                            FieldPanel('banner_content'),
                        ]),
        MultiFieldPanel(heading='EU exit news',
                        children=[
                            FieldPanel('news_title'),
                            FieldPanel('news_description')
                        ]),
        SearchEngineOptimisationPanel(),
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
    ]
class InternationalTradeIndustryContactPage(
    panels.InternationalTradeIndustryContactPagePanels, ExclusivePageMixin, BreadcrumbMixin,
    BaseInternationalPage,
):
    parent_page_types = ['InternationalTradeHomePage']
    slug_identity = slugs.CONTACT_FORM_SLUG

    breadcrumbs_label = models.CharField(max_length=50)
    introduction_text = MarkdownField(blank=True)
    submit_button_text = models.CharField(max_length=100)
    success_message_text = MarkdownField(blank=True)
    success_back_link_text = models.CharField(max_length=100)
class CapitalInvestContactFormSuccessPage(
        panels.CapitalInvestContactFormSuccessPagePanels,
        WagtailAdminExclusivePageMixin, BaseInternationalPage):
    parent_page_types = [
        'great_international.CapitalInvestContactFormPage',
        'great_international.InvestmentAtlasLandingPage'
    ]
    slug_identity = slugs.FORM_SUCCESS_SLUG

    message_box_heading = models.CharField(max_length=255)
    message_box_description = MarkdownField(blank=True)
    what_happens_next_description = MarkdownField(blank=True)
Beispiel #5
0
class BannerComponent(BaseComponentsPage):
    view_path = ''

    banner_content = MarkdownField()
    banner_label = models.CharField(max_length=50, null=True, blank=True)

    content_panels = [
        MultiFieldPanel(
            heading='Banner component',
            children=[
                FieldPanel('banner_label'),
                FieldPanel('banner_content'),
            ]
        ),
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
    ]

    edit_handler = make_translated_interface(
        content_panels=content_panels,
        settings_panels=settings_panels,
    )
Beispiel #6
0
class ArticleSummary(models.Model):
    industry_name = models.CharField(
        max_length=255,
        blank=True,
        help_text='Informs the reader of which industry the article is for.')
    title = models.CharField(max_length=255)
    body = MarkdownField()
    image = models.ForeignKey('wagtailimages.Image',
                              null=True,
                              blank=True,
                              on_delete=models.SET_NULL,
                              related_name='+')
    video_media = models.ForeignKey('wagtailmedia.Media',
                                    null=True,
                                    blank=True,
                                    on_delete=models.SET_NULL,
                                    related_name='+')

    panels = [
        FieldPanel('industry_name'),
        FieldPanel('title'),
        FieldPanel('body'),
        ImageChooserPanel('image'),
        FieldPanel('video_media', widget=AdminMediaChooser),
    ]

    class Meta:
        abstract = True
Beispiel #7
0
class InternationalEUExitFormPage(
    WagtailAdminExclusivePageMixin,
    BaseInternationalPage,
    metaclass=FormPageMetaClass
):
    # metaclass creates <fild_name>_label and <field_name>_help_text
    form_field_names = [
        'first_name',
        'last_name',
        'email',
        'organisation_type',
        'company_name',
        'country',
        'city',
        'comment',
    ]

    full_path_override = '/eu-exit-news/contact/'
    slug_identity = slugs.EUEXIT_INTERNATIONAL_FORM

    subpage_types = [
        'great_international.InternationalEUExitFormSuccessPage']

    breadcrumbs_label = models.CharField(max_length=50)
    heading = models.CharField(max_length=255)
    body_text = MarkdownField()
    submit_button_text = models.CharField(max_length=50)
    disclaimer = models.TextField(max_length=500)

    content_panels_before_form = \
        panels.InternationalEUExitFormPagePanels.content_panels_before_form
    content_panels_after_form = \
        panels.InternationalEUExitFormPagePanels.content_panels_after_form
    settings_panels = panels.InternationalEUExitFormPagePanels.settings_panels
Beispiel #8
0
class InternationalArticleListingPage(panels.InternationalArticleListingPagePanels, BaseInternationalPage):
    parent_page_types = [
        'great_international.InternationalHomePage',
        'great_international.InternationalTopicLandingPage'
    ]
    subpage_types = [
        'great_international.InternationalArticlePage',
        'great_international.InternationalCampaignPage',
    ]

    landing_page_title = models.CharField(max_length=255)
    hero_image = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+'
    )
    hero_teaser = models.CharField(max_length=255, null=True, blank=True)
    list_teaser = MarkdownField(null=True, blank=True)
    tags = ParentalManyToManyField(snippets.Tag, blank=True)

    @property
    def articles_count(self):
        return self.get_descendants().type(
            InternationalArticlePage
        ).live().count()
Beispiel #9
0
class IndustryArticlePage(BaseFASPage):

    view_path = 'industry-articles/'

    breadcrumbs_label = models.CharField(max_length=50)
    introduction_title = models.CharField(max_length=255)
    body = MarkdownField(blank=True)
    author_name = models.CharField(max_length=255)
    job_title = models.CharField(max_length=255)
    proposition_text = models.CharField(max_length=255)
    call_to_action_text = models.CharField(max_length=500)
    show_table_of_content = models.BooleanField(
        default=False,
        help_text=(
            'Any H2 in the body will be listed in the table of content. '
            'Allows users to click to go to sections of the page. Useful for '
            'long articles.'))
    back_to_home_link_text = models.CharField(max_length=100)
    social_share_title = models.CharField(max_length=100)
    date = models.DateField()

    content_panels = [
        FieldPanel('breadcrumbs_label'),
        MultiFieldPanel(
            heading='Contact us',
            children=[
                FieldPanel('proposition_text'),
                FieldPanel('call_to_action_text'),
            ],
            classname='collapsible',
        ),
        MultiFieldPanel(heading='Article',
                        children=[
                            FieldPanel('introduction_title'),
                            FieldPanel('body'),
                        ]),
        MultiFieldPanel(heading='Author',
                        children=[
                            FieldPanel('author_name'),
                            FieldPanel('job_title'),
                            FieldPanel('date'),
                        ]),
        MultiFieldPanel(heading='Footer',
                        children=[
                            FieldPanel('back_to_home_link_text'),
                            FieldPanel('social_share_title'),
                        ]),
        SearchEngineOptimisationPanel(),
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
        MultiFieldPanel(heading='Page structure',
                        children=[FieldPanel('show_table_of_content')])
    ]

    edit_handler = make_translated_interface(content_panels=content_panels,
                                             settings_panels=settings_panels)
Beispiel #10
0
class WhyInvestInTheUKPage(
    panels.WhyInvestInTheUKPagePanels,
    BaseInternationalPage
):
    parent_page_types = ['great_international.InvestmentAtlasLandingPage', ]
    subpage_types = ['great_international.InternationalArticlePage']

    hero_image = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        on_delete=models.SET_NULL,
        related_name='+',
        blank=True,
        help_text='Main page hero image, above the title'
    )
    hero_video = models.ForeignKey(
        'wagtailmedia.Media',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
    )
    strapline = models.CharField(
        max_length=200,
        blank=False,
        null=True,
        help_text=(
            'A single sentence which goes beneath the page title'
        )
    )
    introduction = MarkdownField(
        blank=False,
        null=True,
    )
    intro_image = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        on_delete=models.SET_NULL,
        related_name='+',
        blank=True,
        help_text='Goes beside the intro text'
    )

    uk_strength_title = models.CharField(max_length=255, blank=True)
    uk_strength_intro = models.CharField(max_length=1000, blank=True)
    uk_strength_panels = StreamField(
        [
            ('article_panel', blocks.InternationalUKStrengthPanelBlock()),
        ],
        blank=True,
        null=True,
    )
Beispiel #11
0
class IndustryContactPage(ExclusivePageMixin, BreadcrumbMixin, BaseFASPage):

    view_path = 'industries/contact/'
    slug_identity = slugs.FIND_A_SUPPLIER_INDUSTRY_CONTACT
    # override the slug when generating the url
    slug_override = ''

    breadcrumbs_label = models.CharField(max_length=50)
    introduction_text = MarkdownField(blank=True)
    submit_button_text = models.CharField(max_length=100)
    success_message_text = MarkdownField(blank=True)
    success_back_link_text = models.CharField(max_length=100)

    content_panels = [
        MultiFieldPanel(heading='Contact form',
                        children=[
                            FieldPanel('breadcrumbs_label'),
                            FieldPanel('introduction_text'),
                            FieldPanel('submit_button_text'),
                        ]),
        MultiFieldPanel(heading='Success page',
                        children=[
                            FieldPanel('success_message_text'),
                            FieldPanel('success_back_link_text'),
                        ]),
        SearchEngineOptimisationPanel(),
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
    ]
    edit_handler = make_translated_interface(
        content_panels=content_panels,
        settings_panels=settings_panels,
    )
class InfoPage(BaseInvestPage):
    """
    Markdown page - used for terms and conditions
    and privacy policy
    """
    view_path = 'info/'
    content = MarkdownField()

    content_panels = [FieldPanel('content'), SearchEngineOptimisationPanel()]

    settings_panels = [FieldPanel('title_en_gb'), FieldPanel('slug')]

    edit_handler = make_translated_interface(
        content_panels=content_panels,
        settings_panels=settings_panels,
    )
Beispiel #13
0
class InvestmentGeneralContentPage(
        investment_atlas_panels.InvestmentGeneralContentPagePanels,
        BaseInternationalPage,
):
    parent_page_types = [
        'great_international.InvestmentAtlasLandingPage',
    ]
    subpage_types = [
        'great_international.InvestmentGeneralContentPage',
        'great_international.InternationalArticlePage',
    ]

    # Title comes from BaseInternationalPage, but heading is what we have
    hero_image = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        on_delete=models.SET_NULL,
        related_name='+',
        blank=True,
        help_text='Main page hero image, above the opportunity title')
    hero_video = models.ForeignKey(
        'wagtailmedia.Media',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
    )
    strapline = models.CharField(
        max_length=200,
        blank=False,
        help_text=('A single sentence which goes beneath the page title'))
    introduction = MarkdownField(blank=False, )
    intro_image = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        on_delete=models.SET_NULL,
        related_name='+',
        blank=True,
        help_text='Goes beside the opportunity intro text')

    main_content = single_struct_block_stream_field_factory(
        field_name='content_section',
        block_class_instance=investment_atlas_blocks.
        InvestmentGeneralContentPageBlock(),
        null=True,
        blank=True,
    )
Beispiel #14
0
class InternationalArticleListingPage(BasePage):
    service_name_value = cms.GREAT_INTERNATIONAL
    parent_page_types = [
        'great_international.GreatInternationalApp',
        'great_international.InternationalTopicLandingPage'
    ]
    subpage_types = [
        'great_international.InternationalArticlePage',
        'great_international.InternationalCampaignPage',
    ]

    landing_page_title = models.CharField(max_length=255)
    hero_image = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+'
    )
    hero_teaser = models.CharField(max_length=255, null=True, blank=True)
    list_teaser = MarkdownField(null=True, blank=True)
    tags = ParentalManyToManyField(Tag, blank=True)

    @property
    def articles_count(self):
        return self.get_descendants().type(
            InternationalArticlePage
        ).live().count()

    content_panels = [
        FieldPanel('landing_page_title'),
        MultiFieldPanel(
            heading='Hero',
            children=[
                ImageChooserPanel('hero_image'),
                FieldPanel('hero_teaser')
            ]
        ),
        FieldPanel('list_teaser'),
        SearchEngineOptimisationPanel(),
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
        FieldPanel('tags', widget=CheckboxSelectMultiple)
    ]
Beispiel #15
0
class AboutUkArticleField(panels.AboutUkArticleFieldPanels, models.Model):
    image = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        on_delete=models.SET_NULL,
        related_name='+',
        blank=True
    )
    title = models.CharField(max_length=255, blank=True)
    summary = MarkdownField(blank=True)
    link_text = models.CharField(max_length=255,
                                 blank=True,
                                 verbose_name='Link text')
    link_url = models.CharField(max_length=255,
                                blank=True,
                                verbose_name='Link URL')

    class Meta:
        abstract = True
Beispiel #16
0
class RegionCardField(models.Model):
    region_card_image = models.ForeignKey('wagtailimages.Image',
                                          null=True,
                                          on_delete=models.SET_NULL,
                                          related_name='+',
                                          blank=True)
    region_card_title = models.CharField(max_length=255, blank=True)
    region_card_summary = MarkdownField(blank=True)

    panels = [
        MultiFieldPanel([
            ImageChooserPanel('region_card_image'),
            FieldPanel('region_card_title'),
            FieldPanel('region_card_summary'),
        ]),
    ]

    class Meta:
        abstract = True
Beispiel #17
0
class EUExitInternationalFormPage(ExclusivePageMixin,
                                  BasePage,
                                  metaclass=FormPageMetaClass):
    # metaclass creates <fild_name>_label and <field_name>_help_text
    form_field_names = [
        'first_name',
        'last_name',
        'email',
        'organisation_type',
        'company_name',
        'country',
        'city',
        'comment',
    ]

    service_name_value = cms.EXPORT_READINESS
    view_path = 'international/eu-exit-news/contact/'
    slug_identity = cms.GREAT_EUEXIT_INTERNATIONAL_FORM_SLUG

    breadcrumbs_label = models.CharField(max_length=50)
    heading = models.CharField(max_length=255)
    body_text = MarkdownField()
    submit_button_text = models.CharField(max_length=50)
    disclaimer = models.TextField(max_length=500)

    content_panels_before_form = [
        MultiFieldPanel(heading='Hero',
                        children=[
                            FieldPanel('breadcrumbs_label'),
                            FieldPanel('heading'),
                            FieldPanel('body_text'),
                        ]),
    ]
    content_panels_after_form = [
        FieldPanel('disclaimer', widget=Textarea),
        FieldPanel('submit_button_text'),
        SearchEngineOptimisationPanel(),
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
    ]
Beispiel #18
0
class TermsAndConditionsPage(ExclusivePageMixin, BasePage):

    service_name_value = cms.EXPORT_READINESS
    view_path = 'terms-and-conditions/'
    slug_identity = cms.GREAT_TERMS_AND_CONDITIONS_SLUG

    body = MarkdownField(blank=False)

    content_panels = [
        MultiFieldPanel(heading='Terms and conditions',
                        children=[
                            FieldPanel('body'),
                        ]),
        SearchEngineOptimisationPanel(),
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
    ]
Beispiel #19
0
class CapitalInvestContactFormPage(panels.CapitalInvestContactFormPagePanels,
                                   WagtailAdminExclusivePageMixin,
                                   BaseInternationalPage):
    parent_page_types = ['great_international.InvestmentAtlasLandingPage']
    slug_identity = slugs.CONTACT_FORM_SLUG

    breadcrumbs_label = models.CharField(max_length=255, blank=True)
    heading = models.CharField(max_length=255)
    intro = MarkdownField(blank=True)
    comment = models.TextField(
        max_length=255,
        default=
        "To provide you with the best help, we may forward your message to "
        "appropriate Capital Investment team colleagues in British embassies, "
        "high commissions and consulates located internationally. ")
    cta_text = models.CharField(max_length=255)

    @classmethod
    def allowed_subpage_models(cls):
        return [CapitalInvestContactFormSuccessPage]
Beispiel #20
0
class PrivacyAndCookiesPage(BasePage):

    service_name_value = cms.EXPORT_READINESS
    subpage_types = ['export_readiness.PrivacyAndCookiesPage']
    view_path = 'privacy-and-cookies/'

    body = MarkdownField(blank=False)

    content_panels = [
        MultiFieldPanel(heading='Privacy and cookies',
                        children=[
                            FieldPanel('body'),
                        ]),
        SearchEngineOptimisationPanel(),
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
    ]

    promote_panels = []
Beispiel #21
0
class ArticleListingPage(BasePage):
    service_name_value = cms.EXPORT_READINESS
    subpage_types = [
        'export_readiness.ArticlePage',
    ]

    landing_page_title = models.CharField(max_length=255)

    hero_image = models.ForeignKey('wagtailimages.Image',
                                   null=True,
                                   blank=True,
                                   on_delete=models.SET_NULL,
                                   related_name='+')
    hero_teaser = models.CharField(max_length=255, null=True, blank=True)

    list_teaser = MarkdownField(null=True, blank=True)

    @property
    def articles_count(self):
        return self.get_descendants().type(ArticlePage).live().count()

    content_panels = [
        FieldPanel('landing_page_title'),
        MultiFieldPanel(heading='Hero',
                        children=[
                            ImageChooserPanel('hero_image'),
                            FieldPanel('hero_teaser')
                        ]),
        FieldPanel('list_teaser'),
        SearchEngineOptimisationPanel(),
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
    ]
Beispiel #22
0
class PerformanceDashboardNotesPage(ExclusivePageMixin, BasePage):

    service_name_value = cms.EXPORT_READINESS
    view_path = 'performance-dashboard/'
    slug_identity = cms.GREAT_PERFORMANCE_DASHBOARD_NOTES_SLUG

    body = MarkdownField(help_text=(
        'Please include an h1 in this field e.g. # Heading level 1'),
                         blank=False)

    content_panels = [
        MultiFieldPanel(heading='Performance dashboard notes',
                        children=[
                            FieldPanel('body'),
                        ]),
        SearchEngineOptimisationPanel(),
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
    ]

    promote_panels = []
Beispiel #23
0
class InternationalGuideLandingPage(BasePage):
    service_name_value = cms.GREAT_INTERNATIONAL
    parent_page_types = [
        'great_international.InternationalCuratedTopicLandingPage',
        'great_international.InternationalTopicLandingPage',
    ]
    subpage_types = [
        'great_international.InternationalArticlePage',
    ]

    display_title = models.CharField(max_length=255)

    hero_image = models.ForeignKey('wagtailimages.Image',
                                   null=True,
                                   blank=True,
                                   on_delete=models.SET_NULL,
                                   related_name='+')

    teaser = models.CharField(max_length=255)

    section_one_content = MarkdownField(verbose_name="content")
    section_one_image = models.ForeignKey('wagtailimages.Image',
                                          verbose_name="image",
                                          null=True,
                                          on_delete=models.SET_NULL,
                                          related_name='+')
    section_one_image_caption = models.CharField(
        verbose_name="image caption",
        max_length=100,
        blank=True,
        null=True,
    )

    section_two_heading = models.CharField(verbose_name="heading",
                                           max_length=100)
    section_two_teaser = models.TextField(verbose_name="teaser")
    section_two_button_text = models.CharField(verbose_name="button text",
                                               max_length=100)
    section_two_button_url = models.CharField(verbose_name="button URL",
                                              max_length=255)
    section_two_image = models.ForeignKey('wagtailimages.Image',
                                          verbose_name="image",
                                          null=True,
                                          on_delete=models.SET_NULL,
                                          related_name='+')

    guides_section_heading = models.CharField(
        verbose_name="section heading",
        max_length=100,
    )

    tags = ParentalManyToManyField(Tag, blank=True)

    content_panels = [
        FieldPanel('display_title'),
        ImageChooserPanel('hero_image'),
        FieldPanel('teaser'),
        MultiFieldPanel(heading="Attractive features",
                        children=[
                            FieldPanel('section_one_content'),
                            HelpPanel(
                                'For accessibility reasons, use only '
                                '"#### [Your text here]" for subheadings '
                                'in this markdown field'),
                            ImageChooserPanel('section_one_image'),
                            FieldPanel('section_one_image_caption'),
                        ]),
        MultiFieldPanel(heading="Feature banner",
                        children=[
                            FieldPanel('section_two_heading'),
                            FieldPanel('section_two_teaser'),
                            FieldPanel('section_two_button_text'),
                            FieldPanel('section_two_button_url'),
                            ImageChooserPanel('section_two_image'),
                        ]),
        MultiFieldPanel(heading="Guides section",
                        children=[
                            FieldPanel('guides_section_heading'),
                        ])
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        SearchEngineOptimisationPanel(),
        FieldPanel('slug'),
        FieldPanel('tags', widget=CheckboxSelectMultiple)
    ]
Beispiel #24
0
class InternationalCuratedTopicLandingPage(BasePage):
    service_name_value = cms.GREAT_INTERNATIONAL
    parent_page_types = ['great_international.GreatInternationalApp']
    subpage_types = [
        'great_international.InternationalArticlePage',
        'great_international.InternationalGuideLandingPage',
    ]

    display_title = models.CharField(max_length=255, blank=True, null=True)

    hero_image = models.ForeignKey('wagtailimages.Image',
                                   null=True,
                                   blank=True,
                                   on_delete=models.SET_NULL,
                                   related_name='+')

    teaser = models.CharField(max_length=255)

    feature_section_heading = models.CharField(max_length=255)

    feature_one_heading = models.CharField(max_length=100)
    feature_one_image = models.ForeignKey('wagtailimages.Image',
                                          verbose_name="image",
                                          null=True,
                                          blank=True,
                                          on_delete=models.SET_NULL,
                                          related_name='+')
    feature_one_content = MarkdownField(verbose_name="content")

    feature_two_heading = models.CharField(max_length=100)
    feature_two_image = models.ForeignKey('wagtailimages.Image',
                                          verbose_name="image",
                                          null=True,
                                          blank=True,
                                          on_delete=models.SET_NULL,
                                          related_name='+')
    feature_two_content = MarkdownField(verbose_name="content")

    feature_three_heading = models.CharField(max_length=100)
    feature_three_image = models.ForeignKey('wagtailimages.Image',
                                            verbose_name="image",
                                            null=True,
                                            blank=True,
                                            on_delete=models.SET_NULL,
                                            related_name='+')
    feature_three_url = models.URLField(verbose_name="URL")

    feature_four_heading = models.CharField(max_length=100)
    feature_four_image = models.ForeignKey('wagtailimages.Image',
                                           verbose_name="image",
                                           null=True,
                                           blank=True,
                                           on_delete=models.SET_NULL,
                                           related_name='+')
    feature_four_url = models.URLField(verbose_name="URL")

    feature_five_heading = models.CharField(max_length=100)
    feature_five_image = models.ForeignKey('wagtailimages.Image',
                                           verbose_name="image",
                                           null=True,
                                           blank=True,
                                           on_delete=models.SET_NULL,
                                           related_name='+')
    feature_five_url = models.URLField(verbose_name="URL")

    tags = ParentalManyToManyField(Tag, blank=True)

    content_panels = [
        FieldPanel('display_title'),
        ImageChooserPanel('hero_image'),
        FieldPanel('teaser'),
        MultiFieldPanel(heading="featured content section",
                        children=[
                            FieldPanel('feature_section_heading'),
                            FieldRowPanel([
                                MultiFieldPanel([
                                    FieldPanel('feature_one_heading'),
                                    ImageChooserPanel('feature_one_image'),
                                    FieldPanel('feature_one_content'),
                                ]),
                                MultiFieldPanel([
                                    FieldPanel('feature_two_heading'),
                                    ImageChooserPanel('feature_two_image'),
                                    FieldPanel('feature_two_content'),
                                ]),
                            ]),
                            FieldRowPanel([
                                MultiFieldPanel([
                                    FieldPanel('feature_three_heading'),
                                    ImageChooserPanel('feature_three_image'),
                                    FieldPanel('feature_three_url'),
                                ]),
                                MultiFieldPanel([
                                    FieldPanel('feature_four_heading'),
                                    ImageChooserPanel('feature_four_image'),
                                    FieldPanel('feature_four_url'),
                                ]),
                                MultiFieldPanel([
                                    FieldPanel('feature_five_heading'),
                                    ImageChooserPanel('feature_five_image'),
                                    FieldPanel('feature_five_url'),
                                ]),
                            ]),
                        ])
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        SearchEngineOptimisationPanel(),
        FieldPanel('slug'),
        FieldPanel('tags', widget=CheckboxSelectMultiple)
    ]
Beispiel #25
0
class InternationalCampaignPage(BasePage):
    service_name_value = cms.GREAT_INTERNATIONAL
    parent_page_types = [
        'great_international.InternationalArticleListingPage',
        'great_international.InternationalTopicLandingPage',
        'great_international.InternationalLocalisedFolderPage'
    ]
    subpage_types = ['great_international.InternationalArticlePage']
    view_path = 'campaigns/'

    campaign_teaser = models.CharField(max_length=255, null=True, blank=True)
    campaign_heading = models.CharField(max_length=255)
    campaign_hero_image = models.ForeignKey('wagtailimages.Image',
                                            null=True,
                                            blank=True,
                                            on_delete=models.SET_NULL,
                                            related_name='+')

    section_one_heading = models.CharField(max_length=255)
    section_one_intro = MarkdownField()
    section_one_image = models.ForeignKey('wagtailimages.Image',
                                          null=True,
                                          blank=True,
                                          on_delete=models.SET_NULL,
                                          related_name='+')

    selling_point_one_icon = models.ForeignKey('wagtailimages.Image',
                                               null=True,
                                               blank=True,
                                               on_delete=models.SET_NULL,
                                               related_name='+')
    selling_point_one_heading = models.CharField(max_length=255)
    selling_point_one_content = MarkdownField()

    selling_point_two_icon = models.ForeignKey('wagtailimages.Image',
                                               null=True,
                                               blank=True,
                                               on_delete=models.SET_NULL,
                                               related_name='+')
    selling_point_two_heading = models.CharField(
        max_length=255,
        null=True,
        blank=True,
    )
    selling_point_two_content = MarkdownField(null=True, blank=True)

    selling_point_three_icon = models.ForeignKey('wagtailimages.Image',
                                                 null=True,
                                                 blank=True,
                                                 on_delete=models.SET_NULL,
                                                 related_name='+')
    selling_point_three_heading = models.CharField(max_length=255,
                                                   null=True,
                                                   blank=True)
    selling_point_three_content = MarkdownField(null=True, blank=True)

    section_one_contact_button_url = models.CharField(max_length=255,
                                                      null=True,
                                                      blank=True)
    section_one_contact_button_text = models.CharField(max_length=255,
                                                       null=True,
                                                       blank=True)

    section_two_heading = models.CharField(max_length=255)
    section_two_intro = MarkdownField()

    section_two_image = models.ForeignKey('wagtailimages.Image',
                                          null=True,
                                          blank=True,
                                          on_delete=models.SET_NULL,
                                          related_name='+')

    section_two_contact_button_url = models.CharField(max_length=255,
                                                      null=True,
                                                      blank=True)
    section_two_contact_button_text = models.CharField(max_length=255,
                                                       null=True,
                                                       blank=True)

    related_content_heading = models.CharField(max_length=255)
    related_content_intro = MarkdownField()

    related_page_one = models.ForeignKey(
        'great_international.InternationalArticlePage',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
    )
    related_page_two = models.ForeignKey(
        'great_international.InternationalArticlePage',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
    )
    related_page_three = models.ForeignKey(
        'great_international.InternationalArticlePage',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
    )

    cta_box_message = models.CharField(max_length=255)
    cta_box_button_url = models.CharField(max_length=255)
    cta_box_button_text = models.CharField(max_length=255)

    tags = ParentalManyToManyField(Tag, blank=True)

    content_panels = [
        MultiFieldPanel(heading='Hero section',
                        children=[
                            FieldPanel('campaign_heading'),
                            FieldPanel('campaign_teaser'),
                            ImageChooserPanel('campaign_hero_image'),
                        ]),
        MultiFieldPanel(
            heading='Section one',
            children=[
                FieldPanel('section_one_heading'),
                FieldPanel('section_one_intro'),
                ImageChooserPanel('section_one_image'),
                FieldRowPanel([
                    MultiFieldPanel(children=[
                        ImageChooserPanel('selling_point_one_icon'),
                        FieldPanel('selling_point_one_heading'),
                        FieldPanel('selling_point_one_content'),
                    ]),
                    MultiFieldPanel(children=[
                        ImageChooserPanel('selling_point_two_icon'),
                        FieldPanel('selling_point_two_heading'),
                        FieldPanel('selling_point_two_content'),
                    ]),
                    MultiFieldPanel(children=[
                        ImageChooserPanel('selling_point_three_icon'),
                        FieldPanel('selling_point_three_heading'),
                        FieldPanel('selling_point_three_content'),
                    ]),
                ]),
                FieldRowPanel([
                    FieldPanel('section_one_contact_button_text'),
                    FieldPanel('section_one_contact_button_url'),
                ])
            ]),
        MultiFieldPanel(heading='Section two',
                        children=[
                            FieldPanel('section_two_heading'),
                            FieldPanel('section_two_intro'),
                            ImageChooserPanel('section_two_image'),
                            FieldRowPanel([
                                FieldPanel('section_two_contact_button_text'),
                                FieldPanel('section_two_contact_button_url'),
                            ])
                        ]),
        MultiFieldPanel(
            heading='Related content section',
            children=[
                FieldPanel('related_content_heading'),
                FieldPanel('related_content_intro'),
                FieldRowPanel([
                    PageChooserPanel(
                        'related_page_one',
                        'great_international.InternationalArticlePage'),
                    PageChooserPanel(
                        'related_page_two',
                        'great_international.InternationalArticlePage'),
                    PageChooserPanel(
                        'related_page_three',
                        'great_international.InternationalArticlePage'),
                ])
            ]),
        MultiFieldPanel(heading='Contact box',
                        children=[
                            FieldRowPanel([
                                FieldPanel('cta_box_message', widget=Textarea),
                                MultiFieldPanel([
                                    FieldPanel('cta_box_button_url'),
                                    FieldPanel('cta_box_button_text'),
                                ])
                            ])
                        ]),
        SearchEngineOptimisationPanel(),
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
        FieldPanel('tags', widget=CheckboxSelectMultiple)
    ]
Beispiel #26
0
class InternationalArticlePage(BasePage):
    service_name_value = cms.GREAT_INTERNATIONAL
    parent_page_types = [
        'great_international.InternationalArticleListingPage',
        'great_international.InternationalCampaignPage',
        'great_international.InternationalLocalisedFolderPage',
        'great_international.InternationalCuratedTopicLandingPage',
        'great_international.InternationalGuideLandingPage',
    ]
    subpage_types = []

    article_title = models.CharField(max_length=255)

    article_teaser = models.CharField(max_length=255)
    article_image = models.ForeignKey('wagtailimages.Image',
                                      null=True,
                                      blank=True,
                                      on_delete=models.SET_NULL,
                                      related_name='+')
    article_body_text = MarkdownField()

    related_page_one = models.ForeignKey(
        'great_international.InternationalArticlePage',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
    )
    related_page_two = models.ForeignKey(
        'great_international.InternationalArticlePage',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
    )
    related_page_three = models.ForeignKey(
        'great_international.InternationalArticlePage',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
    )
    tags = ParentalManyToManyField(Tag, blank=True)

    content_panels = [
        FieldPanel('article_title'),
        MultiFieldPanel(heading='Article content',
                        children=[
                            FieldPanel('article_teaser'),
                            ImageChooserPanel('article_image'),
                            FieldPanel('article_body_text')
                        ]),
        MultiFieldPanel(
            heading='Related articles',
            children=[
                FieldRowPanel([
                    PageChooserPanel(
                        'related_page_one',
                        'great_international.InternationalArticlePage'),
                    PageChooserPanel(
                        'related_page_two',
                        'great_international.InternationalArticlePage'),
                    PageChooserPanel(
                        'related_page_three',
                        'great_international.InternationalArticlePage'),
                ]),
            ]),
        SearchEngineOptimisationPanel(),
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
        FieldPanel('tags', widget=CheckboxSelectMultiple)
    ]
Beispiel #27
0
class InternationalSectorPage(BasePage):
    service_name_value = cms.GREAT_INTERNATIONAL
    parent_page_types = ['great_international.InternationalTopicLandingPage']
    subpage_types = []

    tags = ParentalManyToManyField(Tag, blank=True)

    heading = models.CharField(max_length=255)
    sub_heading = models.CharField(max_length=255, blank=True)
    hero_image = models.ForeignKey('wagtailimages.Image',
                                   null=True,
                                   on_delete=models.SET_NULL,
                                   related_name='+')
    heading_teaser = models.TextField(blank=True)

    section_one_body = MarkdownField(null=True,
                                     verbose_name='Bullets markdown')
    section_one_image = models.ForeignKey('wagtailimages.Image',
                                          null=True,
                                          on_delete=models.SET_NULL,
                                          related_name='+',
                                          verbose_name='Bullets image')
    section_one_image_caption = models.CharField(
        max_length=255, blank=True, verbose_name='Bullets image caption')
    section_one_image_caption_company = models.CharField(
        max_length=255,
        blank=True,
        verbose_name='Bullets image caption — company name')

    statistic_1_number = models.CharField(max_length=255)
    statistic_1_heading = models.CharField(max_length=255)
    statistic_1_smallprint = models.CharField(max_length=255, blank=True)

    statistic_2_number = models.CharField(max_length=255)
    statistic_2_heading = models.CharField(max_length=255)
    statistic_2_smallprint = models.CharField(max_length=255, blank=True)

    statistic_3_number = models.CharField(max_length=255, blank=True)
    statistic_3_heading = models.CharField(max_length=255, blank=True)
    statistic_3_smallprint = models.CharField(max_length=255, blank=True)

    statistic_4_number = models.CharField(max_length=255, blank=True)
    statistic_4_heading = models.CharField(max_length=255, blank=True)
    statistic_4_smallprint = models.CharField(max_length=255, blank=True)

    statistic_5_number = models.CharField(max_length=255, blank=True)
    statistic_5_heading = models.CharField(max_length=255, blank=True)
    statistic_5_smallprint = models.CharField(max_length=255, blank=True)

    statistic_6_number = models.CharField(max_length=255, blank=True)
    statistic_6_heading = models.CharField(max_length=255, blank=True)
    statistic_6_smallprint = models.CharField(max_length=255, blank=True)

    section_two_heading = models.CharField(max_length=255,
                                           verbose_name='Highlights heading')
    section_two_teaser = models.TextField(verbose_name='Highlights teaser')

    section_two_subsection_one_icon = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
        verbose_name='Highlight 1 icon')
    section_two_subsection_one_heading = models.CharField(
        max_length=255, verbose_name='Highlight 1 heading')
    section_two_subsection_one_body = models.TextField(
        verbose_name='Highlight 1 body')

    section_two_subsection_two_icon = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
        verbose_name='Highlight 2 icon')
    section_two_subsection_two_heading = models.CharField(
        max_length=255, verbose_name='Highlight 2 heading')
    section_two_subsection_two_body = models.TextField(
        verbose_name='Highlight 2 body')

    section_two_subsection_three_icon = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
        verbose_name='Highlight 3 icon')
    section_two_subsection_three_heading = models.CharField(
        max_length=255, verbose_name='Highlight 3 heading')
    section_two_subsection_three_body = models.TextField(
        verbose_name='Highlight 3 body')

    case_study_title = models.CharField(max_length=255, blank=True)
    case_study_description = models.CharField(max_length=255, blank=True)
    case_study_cta_text = models.TextField(blank=True)
    case_study_cta_page = models.ForeignKey('wagtailcore.Page',
                                            null=True,
                                            blank=True,
                                            on_delete=models.SET_NULL,
                                            related_name='+')
    case_study_image = models.ForeignKey('wagtailimages.Image',
                                         null=True,
                                         blank=True,
                                         on_delete=models.SET_NULL,
                                         related_name='+')

    section_three_heading = models.CharField(
        max_length=255, blank=True, verbose_name='Fact sheets heading')
    section_three_teaser = models.TextField(blank=True,
                                            verbose_name='Fact sheets teaser')

    section_three_subsection_one_heading = models.CharField(
        max_length=255, blank=True, verbose_name='Fact sheet 1 heading')
    section_three_subsection_one_teaser = models.TextField(
        blank=True, verbose_name='Fact sheet 1 teaser')
    section_three_subsection_one_body = MarkdownField(
        blank=True, null=True, verbose_name='Fact sheet 1 body')

    section_three_subsection_two_heading = models.CharField(
        max_length=255, blank=True, verbose_name='Fact sheet 2 heading')
    section_three_subsection_two_teaser = models.TextField(
        blank=True, verbose_name='Fact sheet 2 teaser')
    section_three_subsection_two_body = MarkdownField(
        blank=True, null=True, verbose_name='Fact sheet 2 body')

    related_page_one = models.ForeignKey('wagtailcore.Page',
                                         null=True,
                                         blank=True,
                                         on_delete=models.SET_NULL,
                                         related_name='+')
    related_page_two = models.ForeignKey('wagtailcore.Page',
                                         null=True,
                                         blank=True,
                                         on_delete=models.SET_NULL,
                                         related_name='+')
    related_page_three = models.ForeignKey('wagtailcore.Page',
                                           null=True,
                                           blank=True,
                                           on_delete=models.SET_NULL,
                                           related_name='+')

    content_panels = [
        MultiFieldPanel(heading='Heading',
                        children=[
                            FieldPanel('heading'),
                            FieldPanel('sub_heading'),
                            ImageChooserPanel('hero_image'),
                            FieldPanel('heading_teaser')
                        ]),
        MultiFieldPanel(
            heading='Bullets',
            children=[
                HelpPanel(
                    'For accessibility reasons, use only "## [Your text here]"'
                    ' for headings in this markdown field'),
                FieldRowPanel([
                    FieldPanel('section_one_body'),
                    MultiFieldPanel([
                        ImageChooserPanel('section_one_image'),
                        FieldPanel('section_one_image_caption'),
                        FieldPanel('section_one_image_caption_company')
                    ])
                ])
            ]),
        MultiFieldPanel(heading='Statistics',
                        children=[
                            FieldRowPanel([
                                MultiFieldPanel([
                                    FieldPanel('statistic_1_number'),
                                    FieldPanel('statistic_1_heading'),
                                    FieldPanel('statistic_1_smallprint')
                                ]),
                                MultiFieldPanel([
                                    FieldPanel('statistic_2_number'),
                                    FieldPanel('statistic_2_heading'),
                                    FieldPanel('statistic_2_smallprint')
                                ]),
                                MultiFieldPanel([
                                    FieldPanel('statistic_3_number'),
                                    FieldPanel('statistic_3_heading'),
                                    FieldPanel('statistic_3_smallprint')
                                ]),
                                MultiFieldPanel([
                                    FieldPanel('statistic_4_number'),
                                    FieldPanel('statistic_4_heading'),
                                    FieldPanel('statistic_4_smallprint')
                                ]),
                                MultiFieldPanel([
                                    FieldPanel('statistic_5_number'),
                                    FieldPanel('statistic_5_heading'),
                                    FieldPanel('statistic_5_smallprint')
                                ]),
                                MultiFieldPanel([
                                    FieldPanel('statistic_6_number'),
                                    FieldPanel('statistic_6_heading'),
                                    FieldPanel('statistic_6_smallprint')
                                ]),
                            ])
                        ]),
        MultiFieldPanel(
            heading='Highlights',
            children=[
                FieldPanel('section_two_heading'),
                FieldPanel('section_two_teaser'),
                FieldRowPanel([
                    MultiFieldPanel([
                        ImageChooserPanel('section_two_subsection_one_icon'),
                        FieldPanel('section_two_subsection_one_heading'),
                        FieldPanel('section_two_subsection_one_body')
                    ]),
                    MultiFieldPanel([
                        ImageChooserPanel('section_two_subsection_two_icon'),
                        FieldPanel('section_two_subsection_two_heading'),
                        FieldPanel('section_two_subsection_two_body')
                    ]),
                    MultiFieldPanel([
                        ImageChooserPanel('section_two_subsection_three_icon'),
                        FieldPanel('section_two_subsection_three_heading'),
                        FieldPanel('section_two_subsection_three_body')
                    ])
                ])
            ]),
        MultiFieldPanel(
            heading='Case Study',
            classname='collapsible',
            children=[
                FieldPanel('case_study_title'),
                FieldPanel('case_study_description'),
                FieldPanel('case_study_cta_text'),
                PageChooserPanel('case_study_cta_page', [
                    'great_international.InternationalArticlePage',
                    'great_international.InternationalCampaignPage',
                ]),
                ImageChooserPanel('case_study_image')
            ]),
        MultiFieldPanel(
            heading='Fact Sheets',
            classname='collapsible collapsed',
            children=[
                FieldPanel('section_three_heading'),
                FieldPanel('section_three_teaser'),
                FieldRowPanel([
                    MultiFieldPanel([
                        FieldPanel('section_three_subsection_one_heading'),
                        FieldPanel('section_three_subsection_one_teaser'),
                        HelpPanel('For accessibility reasons, use only '
                                  '"#### [Your text here]" for subheadings '
                                  'in this markdown field'),
                        FieldPanel('section_three_subsection_one_body')
                    ]),
                    MultiFieldPanel([
                        FieldPanel('section_three_subsection_two_heading'),
                        FieldPanel('section_three_subsection_two_teaser'),
                        HelpPanel('For accessibility reasons, use only '
                                  '"#### [Your text here]" for subheadings '
                                  'in this markdown field'),
                        FieldPanel('section_three_subsection_two_body')
                    ])
                ])
            ]),
        MultiFieldPanel(
            heading='Related articles',
            children=[
                FieldRowPanel([
                    PageChooserPanel('related_page_one', [
                        'great_international.InternationalArticlePage',
                        'great_international.InternationalCampaignPage',
                    ]),
                    PageChooserPanel('related_page_two', [
                        'great_international.InternationalArticlePage',
                        'great_international.InternationalCampaignPage',
                    ]),
                    PageChooserPanel('related_page_three', [
                        'great_international.InternationalArticlePage',
                        'great_international.InternationalCampaignPage',
                    ]),
                ])
            ]),
        SearchEngineOptimisationPanel()
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
        FieldPanel('tags', widget=CheckboxSelectMultiple)
    ]
Beispiel #28
0
class InternationalHomePage(ExclusivePageMixin, BasePage):
    service_name_value = cms.GREAT_INTERNATIONAL
    slug_identity = cms.GREAT_HOME_INTERNATIONAL_SLUG
    subpage_types = []

    tariffs_title = models.CharField(max_length=255)
    tariffs_description = MarkdownField()
    tariffs_link = models.URLField()
    tariffs_image = models.ForeignKey('wagtailimages.Image',
                                      null=True,
                                      blank=True,
                                      on_delete=models.SET_NULL,
                                      related_name='+')

    news_title = models.CharField(max_length=255)
    related_page_one = models.ForeignKey(
        'wagtailcore.Page',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
    )
    related_page_two = models.ForeignKey(
        'wagtailcore.Page',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
    )
    related_page_three = models.ForeignKey(
        'wagtailcore.Page',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
    )

    content_panels = [
        MultiFieldPanel(heading='Tariffs',
                        children=[
                            FieldPanel('tariffs_title'),
                            FieldPanel('tariffs_description'),
                            FieldPanel('tariffs_link'),
                            ImageChooserPanel('tariffs_image')
                        ]),
        MultiFieldPanel(
            heading='News section',
            children=[
                FieldPanel('news_title'),
                FieldRowPanel([
                    PageChooserPanel('related_page_one', [
                        'great_international.InternationalArticlePage',
                        'great_international.InternationalCampaignPage',
                    ]),
                    PageChooserPanel('related_page_two', [
                        'great_international.InternationalArticlePage',
                        'great_international.InternationalCampaignPage',
                    ]),
                    PageChooserPanel('related_page_three', [
                        'great_international.InternationalArticlePage',
                        'great_international.InternationalCampaignPage',
                    ]),
                ])
            ]),
        SearchEngineOptimisationPanel(),
    ]

    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
    ]
Beispiel #29
0
class SectorPage(BasePage):
    # Related sector are implemented as subpages
    service_name_value = cms.INVEST
    subpage_types = ['invest.sectorPage']
    view_path = 'industries/'

    featured = models.BooleanField(default=False)
    description = models.TextField()  # appears in card on external pages

    # page fields
    heading = models.CharField(max_length=255)

    hero_image = models.ForeignKey('wagtailimages.Image',
                                   null=True,
                                   blank=True,
                                   on_delete=models.SET_NULL,
                                   related_name='+')

    pullout_text = MarkdownField(blank=True, null=True)
    pullout_stat = models.CharField(max_length=255, blank=True, null=True)
    pullout_stat_text = models.CharField(max_length=255, blank=True, null=True)

    subsection_title_one = models.CharField(max_length=200)
    subsection_content_one = MarkdownField()
    subsection_map_one = models.ForeignKey('wagtailimages.Image',
                                           null=True,
                                           blank=True,
                                           on_delete=models.SET_NULL,
                                           related_name='+')

    subsection_title_two = models.CharField(max_length=200)
    subsection_content_two = MarkdownField()
    subsection_map_two = models.ForeignKey('wagtailimages.Image',
                                           null=True,
                                           blank=True,
                                           on_delete=models.SET_NULL,
                                           related_name='+')

    subsection_title_three = models.CharField(max_length=200, blank=True)
    subsection_content_three = MarkdownField(blank=True)
    subsection_map_three = models.ForeignKey('wagtailimages.Image',
                                             null=True,
                                             blank=True,
                                             on_delete=models.SET_NULL,
                                             related_name='+')

    subsection_title_four = models.CharField(max_length=200, blank=True)
    subsection_content_four = MarkdownField(blank=True)
    subsection_map_four = models.ForeignKey('wagtailimages.Image',
                                            null=True,
                                            blank=True,
                                            on_delete=models.SET_NULL,
                                            related_name='+')

    subsection_title_five = models.CharField(max_length=200, blank=True)
    subsection_content_five = MarkdownField(blank=True)
    subsection_map_five = models.ForeignKey('wagtailimages.Image',
                                            null=True,
                                            blank=True,
                                            on_delete=models.SET_NULL,
                                            related_name='+')

    subsection_title_six = models.CharField(max_length=200, blank=True)
    subsection_content_six = MarkdownField(blank=True)
    subsection_map_six = models.ForeignKey('wagtailimages.Image',
                                           null=True,
                                           blank=True,
                                           on_delete=models.SET_NULL,
                                           related_name='+')

    subsection_title_seven = models.CharField(max_length=200, blank=True)
    subsection_content_seven = MarkdownField(blank=True)
    subsection_map_seven = models.ForeignKey('wagtailimages.Image',
                                             null=True,
                                             blank=True,
                                             on_delete=models.SET_NULL,
                                             related_name='+')
    # subsections end

    image_panels = [
        ImageChooserPanel('hero_image'),
    ]
    content_panels = [
        FieldPanel('description'),
        FieldPanel('heading'),
        MultiFieldPanel([
            FieldPanel('pullout_text'),
            FieldPanel('pullout_stat'),
            FieldPanel('pullout_stat_text')
        ],
                        heading='Pullout',
                        classname='collapsible'),
        # subsections panels
        MultiFieldPanel([
            FieldPanel('subsection_title_one'),
            FieldPanel('subsection_content_one'),
            ImageChooserPanel('subsection_map_one')
        ],
                        heading='subsections one',
                        classname='collapsible'),
        MultiFieldPanel([
            FieldPanel('subsection_title_two'),
            FieldPanel('subsection_content_two'),
            ImageChooserPanel('subsection_map_two')
        ],
                        heading='subsections two',
                        classname='collapsible'),
        MultiFieldPanel([
            FieldPanel('subsection_title_three'),
            FieldPanel('subsection_content_three'),
            ImageChooserPanel('subsection_map_three')
        ],
                        heading='subsections three',
                        classname='collapsible collapsed'),
        MultiFieldPanel([
            FieldPanel('subsection_title_four'),
            FieldPanel('subsection_content_four'),
            ImageChooserPanel('subsection_map_four')
        ],
                        heading='subsections four',
                        classname='collapsible collapsed'),
        MultiFieldPanel([
            FieldPanel('subsection_title_five'),
            FieldPanel('subsection_content_five'),
            ImageChooserPanel('subsection_map_five')
        ],
                        heading='subsections five',
                        classname='collapsible collapsed'),
        MultiFieldPanel([
            FieldPanel('subsection_title_six'),
            FieldPanel('subsection_content_six'),
            ImageChooserPanel('subsection_map_six')
        ],
                        heading='subsections six',
                        classname='collapsible collapsed'),
        MultiFieldPanel([
            FieldPanel('subsection_title_seven'),
            FieldPanel('subsection_content_seven'),
            ImageChooserPanel('subsection_map_seven')
        ],
                        heading='Subsection seven',
                        classname='collapsible collapsed'),
        SearchEngineOptimisationPanel()
    ]
    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
        FieldPanel('featured')
    ]

    edit_handler = make_translated_interface(content_panels=content_panels,
                                             settings_panels=settings_panels,
                                             other_panels=[
                                                 ObjectList(image_panels,
                                                            heading='Images'),
                                             ])
Beispiel #30
0
class HighPotentialOpportunityDetailPage(BasePage):
    service_name_value = cms.INVEST
    view_path = 'high-potential-opportunities/'

    breadcrumbs_label = models.CharField(max_length=50)
    heading = models.CharField(max_length=255)
    hero_image = models.ForeignKey('wagtailimages.Image',
                                   null=True,
                                   blank=True,
                                   on_delete=models.SET_NULL,
                                   related_name='+')
    contact_proposition = MarkdownField(
        blank=False,
        verbose_name='Body text',
    )
    contact_button = models.CharField(max_length=500)
    proposition_one = MarkdownField(blank=False)
    proposition_one_image = models.ForeignKey('wagtailimages.Image',
                                              null=True,
                                              blank=True,
                                              on_delete=models.SET_NULL,
                                              related_name='+')
    proposition_one_video = models.ForeignKey('wagtailmedia.Media',
                                              null=True,
                                              blank=True,
                                              on_delete=models.SET_NULL,
                                              related_name='+')
    opportunity_list_title = models.CharField(max_length=300)
    opportunity_list_item_one = MarkdownField()
    opportunity_list_item_two = MarkdownField()
    opportunity_list_item_three = MarkdownField(blank=True)
    opportunity_list_image = models.ForeignKey('wagtailimages.Image',
                                               null=True,
                                               blank=True,
                                               on_delete=models.SET_NULL,
                                               related_name='+')
    proposition_two = MarkdownField(blank=False)
    proposition_two_list_item_one = MarkdownField()
    proposition_two_list_item_two = MarkdownField()
    proposition_two_list_item_three = MarkdownField()
    proposition_two_image = models.ForeignKey('wagtailimages.Image',
                                              null=True,
                                              blank=True,
                                              on_delete=models.SET_NULL,
                                              related_name='+')
    proposition_two_video = models.ForeignKey('wagtailmedia.Media',
                                              null=True,
                                              blank=True,
                                              on_delete=models.SET_NULL,
                                              related_name='+')
    competitive_advantages_title = models.CharField(
        max_length=300,
        verbose_name='Body text',
    )
    competitive_advantages_list_item_one = MarkdownField()
    competitive_advantages_list_item_one_icon = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+')
    competitive_advantages_list_item_two = MarkdownField()
    competitive_advantages_list_item_two_icon = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+')
    competitive_advantages_list_item_three = MarkdownField()
    competitive_advantages_list_item_three_icon = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+')
    testimonial = MarkdownField(blank=True)
    testimonial_background = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
        verbose_name='Background image',
    )
    companies_list_text = MarkdownField()
    companies_list_item_image_one = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+')
    companies_list_item_image_two = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+')
    companies_list_item_image_three = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+')
    companies_list_item_image_four = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+')
    companies_list_item_image_five = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+')
    companies_list_item_image_six = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+')
    companies_list_item_image_seven = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+')
    companies_list_item_image_eight = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+')
    case_study_list_title = models.CharField(max_length=300)
    case_study_one_text = MarkdownField(blank=True)
    case_study_one_image = models.ForeignKey('wagtailimages.Image',
                                             null=True,
                                             blank=True,
                                             on_delete=models.SET_NULL,
                                             related_name='+')
    case_study_two_text = MarkdownField(blank=True)
    case_study_two_image = models.ForeignKey('wagtailimages.Image',
                                             null=True,
                                             blank=True,
                                             on_delete=models.SET_NULL,
                                             related_name='+')
    case_study_three_text = MarkdownField(blank=True)
    case_study_three_image = models.ForeignKey('wagtailimages.Image',
                                               null=True,
                                               blank=True,
                                               on_delete=models.SET_NULL,
                                               related_name='+')
    case_study_four_text = MarkdownField(blank=True)
    case_study_four_image = models.ForeignKey('wagtailimages.Image',
                                              null=True,
                                              blank=True,
                                              on_delete=models.SET_NULL,
                                              related_name='+')
    other_opportunities_title = models.CharField(max_length=300,
                                                 verbose_name='Title')
    pdf_document = models.ForeignKey('wagtaildocs.Document',
                                     null=True,
                                     on_delete=models.SET_NULL,
                                     related_name='+')
    summary_image = models.ForeignKey(
        'wagtailimages.Image',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
        help_text=(
            'Image used on the opportunity listing page for this opportunity'),
        verbose_name='Image',
    )

    content_panels = [
        MultiFieldPanel(heading='Hero',
                        children=[
                            FieldPanel('breadcrumbs_label'),
                            FieldPanel('heading'),
                            ImageChooserPanel('hero_image'),
                        ]),
        MultiFieldPanel(heading='Contact us',
                        children=[
                            FieldRowPanel(children=[
                                FieldPanel('contact_proposition'),
                                FieldPanel('contact_button'),
                            ])
                        ]),
        MultiFieldPanel(heading='Proposition one',
                        children=[
                            FieldRowPanel(children=[
                                FieldPanel('proposition_one'),
                                MultiFieldPanel(children=[
                                    ImageChooserPanel('proposition_one_image'),
                                    FieldPanel('proposition_one_video',
                                               widget=AdminMediaChooser),
                                ])
                            ])
                        ]),
        MultiFieldPanel(heading='Opportunity list',
                        children=[
                            FieldPanel('opportunity_list_title'),
                            FieldRowPanel(children=[
                                MultiFieldPanel(children=[
                                    FieldPanel('opportunity_list_item_one'),
                                    FieldPanel('opportunity_list_item_two'),
                                    FieldPanel('opportunity_list_item_three'),
                                ]),
                                ImageChooserPanel('opportunity_list_image'),
                            ])
                        ]),
        MultiFieldPanel(
            heading='Opportunity list',
            children=[
                FieldRowPanel(children=[
                    MultiFieldPanel(children=[
                        FieldPanel('proposition_two'),
                        FieldPanel('proposition_two_list_item_one'),
                        FieldPanel('proposition_two_list_item_two'),
                        FieldPanel('proposition_two_list_item_three'),
                    ]),
                    MultiFieldPanel(children=[
                        ImageChooserPanel('proposition_two_image'),
                        FieldPanel('proposition_two_video',
                                   widget=AdminMediaChooser),
                    ])
                ])
            ]),
        MultiFieldPanel(
            heading='Key facts',
            children=[
                FieldPanel('competitive_advantages_title'),
                FieldRowPanel(children=[
                    FieldPanel('competitive_advantages_list_item_one'),
                    FieldPanel('competitive_advantages_list_item_two'),
                    FieldPanel('competitive_advantages_list_item_three'),
                ]),
                FieldRowPanel(children=[
                    ImageChooserPanel(
                        'competitive_advantages_list_item_one_icon'),
                    ImageChooserPanel(
                        'competitive_advantages_list_item_two_icon'),
                    ImageChooserPanel(
                        'competitive_advantages_list_item_three_icon'),
                ])
            ]),
        MultiFieldPanel(heading='Testimonial',
                        children=[
                            FieldPanel('testimonial'),
                            ImageChooserPanel('testimonial_background'),
                        ]),
        MultiFieldPanel(
            heading='Company list',
            children=[
                FieldPanel('companies_list_text'),
                FieldRowPanel(children=[
                    ImageChooserPanel('companies_list_item_image_one'),
                    ImageChooserPanel('companies_list_item_image_two'),
                    ImageChooserPanel('companies_list_item_image_three'),
                    ImageChooserPanel('companies_list_item_image_four'),
                ]),
                FieldRowPanel(children=[
                    ImageChooserPanel('companies_list_item_image_five'),
                    ImageChooserPanel('companies_list_item_image_six'),
                    ImageChooserPanel('companies_list_item_image_seven'),
                    ImageChooserPanel('companies_list_item_image_eight'),
                ])
            ]),
        MultiFieldPanel(heading='Case studies',
                        children=[
                            FieldPanel('case_study_list_title'),
                            FieldRowPanel(children=[
                                FieldPanel('case_study_one_text'),
                                ImageChooserPanel('case_study_one_image'),
                            ]),
                            FieldRowPanel(children=[
                                FieldPanel('case_study_two_text'),
                                ImageChooserPanel('case_study_two_image'),
                            ]),
                            FieldRowPanel(children=[
                                FieldPanel('case_study_three_text'),
                                ImageChooserPanel('case_study_three_image'),
                            ]),
                            FieldRowPanel(children=[
                                FieldPanel('case_study_four_text'),
                                ImageChooserPanel('case_study_four_image'),
                            ])
                        ]),
        MultiFieldPanel(heading='Other opportunities',
                        children=[
                            FieldPanel('other_opportunities_title'),
                        ]),
        MultiFieldPanel(
            heading='Summary',
            children=[ImageChooserPanel('summary_image')],
        ),
        SearchEngineOptimisationPanel(),
    ]
    settings_panels = [
        FieldPanel('title_en_gb'),
        FieldPanel('slug'),
        DocumentChooserPanel('pdf_document'),
    ]