diff --git a/czech_inspirational/models.py b/czech_inspirational/models.py index dc887f35609d782ee24acb6a9c733137670774c3..40f82ed2c4ef989330b55250d064c9473f261ce7 100644 --- a/czech_inspirational/models.py +++ b/czech_inspirational/models.py @@ -11,8 +11,6 @@ from wagtail.admin.edit_handlers import ( ) from wagtail.core.fields import RichTextField from wagtail.core.models import Page -from wagtail.documents.edit_handlers import DocumentChooserPanel -from wagtail.images.edit_handlers import ImageChooserPanel from wagtailmetadata.models import MetadataPageMixin from shared.models import ( @@ -48,7 +46,7 @@ class CzechInspirationalHomePage( [ FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.IMPORTANT_TITLE)), ], gettext_lazy("Common page configuration"), @@ -133,7 +131,7 @@ class CzechInspirationalChaptersPage( FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build( admin_help.NO_SEO_TITLE, admin_help.NO_SEARCH_IMAGE @@ -191,7 +189,7 @@ class CzechInspirationalChapterPage( content_panels = Page.content_panels + [ FieldPanel("number"), FieldPanel("author"), - ImageChooserPanel("image"), + FieldPanel("image"), FieldPanel("text"), FieldPanel("extra_text"), ] @@ -202,7 +200,7 @@ class CzechInspirationalChapterPage( FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build( admin_help.NO_SEO_TITLE, admin_help.NO_SEARCH_IMAGE @@ -253,7 +251,7 @@ class CzechInspirationalDownloadPage( ### PANELS content_panels = Page.content_panels + [ - DocumentChooserPanel("book_file"), + FieldPanel("book_file"), ] promote_panels = [ @@ -262,7 +260,7 @@ class CzechInspirationalDownloadPage( FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build( admin_help.NO_SEO_TITLE, admin_help.NO_SEARCH_IMAGE diff --git a/district/models.py b/district/models.py index 795f6efe55fdbe91f0c83e10569b6197d49e60fc..e99f2048a61adb578c25982e70605ab47a845ba4 100644 --- a/district/models.py +++ b/district/models.py @@ -19,14 +19,12 @@ from wagtail.admin.edit_handlers import ( MultiFieldPanel, ObjectList, PageChooserPanel, - StreamFieldPanel, TabbedInterface, ) from wagtail.admin.forms import WagtailAdminPageForm from wagtail.contrib.routable_page.models import RoutablePageMixin, route from wagtail.core.fields import RichTextField, StreamField from wagtail.core.models import Orderable, Page -from wagtail.images.edit_handlers import ImageChooserPanel from wagtailmetadata.models import MetadataPageMixin from calendar_utils.models import CalendarMixin @@ -196,8 +194,8 @@ class DistrictHomePage( ### PANELS content_panels = Page.content_panels + [ - StreamFieldPanel("subheader"), - StreamFieldPanel("content"), + FieldPanel("subheader"), + FieldPanel("content"), FieldPanel("articles_title"), FieldPanel("election_countdown_datetime"), FieldPanel("show_calendar_on_hp"), @@ -206,7 +204,7 @@ class DistrictHomePage( promote_panels = make_promote_panels(admin_help.build(admin_help.IMPORTANT_TITLE)) settings_panels = [ - ImageChooserPanel("custom_logo"), + FieldPanel("custom_logo"), FieldPanel("matomo_id"), FieldPanel("title_suffix"), MultiFieldPanel( @@ -234,7 +232,7 @@ class DistrictHomePage( ), MultiFieldPanel( [ - StreamFieldPanel("footer_person_list"), + FieldPanel("footer_person_list"), ], gettext_lazy("Lidé v zápatí stránky"), ), @@ -246,7 +244,7 @@ class DistrictHomePage( ], gettext_lazy("Nastavení lišty s kalendářem a mapou"), ), - ImageChooserPanel("fallback_image"), + FieldPanel("fallback_image"), ] ### EDIT HANDLERS @@ -538,7 +536,7 @@ class DistrictContactPage( ### PANELS content_panels = Page.content_panels + [ - StreamFieldPanel("contact_people"), + FieldPanel("contact_people"), FieldPanel("text"), ] @@ -658,8 +656,8 @@ class DistrictPersonPage( ), MultiFieldPanel( [ - ImageChooserPanel("profile_photo"), - ImageChooserPanel("background_photo"), + FieldPanel("profile_photo"), + FieldPanel("background_photo"), ], "Fotky", ), @@ -673,7 +671,7 @@ class DistrictPersonPage( FieldPanel("age"), FieldPanel("is_pirate"), FieldPanel("other_party"), - ImageChooserPanel("other_party_logo"), + FieldPanel("other_party_logo"), ], "Kontaktní informace", ), @@ -685,7 +683,7 @@ class DistrictPersonPage( FieldPanel("youtube_url"), FieldPanel("flickr_url"), FieldPanel("custom_web_url"), - StreamFieldPanel("other_urls"), + FieldPanel("other_urls"), ], "Sociální sítě", ), @@ -758,7 +756,7 @@ class DistrictPeoplePage( ### PANELS - content_panels = Page.content_panels + [StreamFieldPanel("content")] + content_panels = Page.content_panels + [FieldPanel("content")] promote_panels = make_promote_panels() @@ -791,7 +789,7 @@ class DistrictElectionBasePage( ### PANELS - content_panels = Page.content_panels + [StreamFieldPanel("content")] + content_panels = Page.content_panels + [FieldPanel("content")] promote_panels = make_promote_panels() @@ -871,7 +869,7 @@ class DistrictElectionProgramPage( content_panels = DistrictElectionBasePage.content_panels + [ PageChooserPanel("guarantor"), - ImageChooserPanel("image"), + FieldPanel("image"), FieldPanel("perex"), ] @@ -968,13 +966,13 @@ class DistrictElectionCampaignPage(DistrictElectionBasePage): ### PANELS content_panels = Page.content_panels + [ - StreamFieldPanel("candidates"), + FieldPanel("candidates"), MultiFieldPanel( [ FieldPanel("number"), FieldPanel("candidate_list_title"), FieldPanel("program_point_list_title"), - StreamFieldPanel("content"), + FieldPanel("content"), ], "Personalizace", ), @@ -982,13 +980,13 @@ class DistrictElectionCampaignPage(DistrictElectionBasePage): [ FieldPanel("hero_headline"), FieldPanel("hero_motto"), - ImageChooserPanel("hero_image"), - ImageChooserPanel("hero_candidates_image"), - StreamFieldPanel("hero_cta_buttons"), + FieldPanel("hero_image"), + FieldPanel("hero_candidates_image"), + FieldPanel("hero_cta_buttons"), ], "Hero banner", ), - StreamFieldPanel("order"), + FieldPanel("order"), ] ### RELATIONS @@ -1074,21 +1072,21 @@ class DistrictInteractiveProgramPage( ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page ): ### FIELDS - + perex = models.TextField("Perex", blank=True) content = StreamField( [("interactive_program_block", blocks.InteractiveProgramBlock())], verbose_name="Části programu", blank=False, ) - + ### PANELS - + content_panels = Page.content_panels + [ FieldPanel("perex"), - StreamFieldPanel("content"), + FieldPanel("content"), ] - + promote_panels = make_promote_panels() settings_panels = [] @@ -1134,7 +1132,7 @@ class DistrictProgramPage( content_panels = Page.content_panels + [ FieldPanel("perex"), - StreamFieldPanel("content"), + FieldPanel("content"), ] promote_panels = make_promote_panels() @@ -1202,11 +1200,11 @@ class DistrictCenterPage( content_panels = Page.content_panels + [ FieldPanel("perex"), - ImageChooserPanel("background_photo"), + FieldPanel("background_photo"), FieldPanel("text"), - StreamFieldPanel("content"), + FieldPanel("content"), FieldPanel("calendar_url"), - StreamFieldPanel("sidebar_content"), + FieldPanel("sidebar_content"), ] promote_panels = make_promote_panels() @@ -1284,8 +1282,8 @@ class DistrictCrossroadPage( ### PANELS content_panels = Page.content_panels + [ - StreamFieldPanel("cards_content"), - StreamFieldPanel("content"), + FieldPanel("cards_content"), + FieldPanel("content"), ] promote_panels = make_promote_panels() @@ -1307,7 +1305,7 @@ class DistrictCrossroadPage( "district.DistrictPeoplePage", "district.DistrictPersonPage", "district.DistrictProgramPage", - "district.DistrictInteractiveProgramPage" + "district.DistrictInteractiveProgramPage", ] ### OTHERS @@ -1334,7 +1332,7 @@ class DistrictCustomPage( ### PANELS content_panels = Page.content_panels + [ - StreamFieldPanel("content"), + FieldPanel("content"), ] promote_panels = make_promote_panels() @@ -1426,13 +1424,13 @@ class DistrictGeoFeatureCollectionPage( MultiFieldPanel( [ FieldPanel("perex"), - StreamFieldPanel("hero_cta_buttons"), - StreamFieldPanel("content"), - StreamFieldPanel("content_after"), - StreamFieldPanel("content_footer"), + FieldPanel("hero_cta_buttons"), + FieldPanel("content"), + FieldPanel("content_after"), + FieldPanel("content_footer"), FieldPanel("promoted_block_title"), - ImageChooserPanel("logo_image"), - ImageChooserPanel("image"), + FieldPanel("logo_image"), + FieldPanel("image"), ], "Obsah hlavní stránky kolekce", ), @@ -1638,9 +1636,9 @@ class DistrictGeoFeatureDetailPage( [ FieldPanel("title"), FieldPanel("perex"), - StreamFieldPanel("content"), - StreamFieldPanel("parts_section_title"), - ImageChooserPanel("image"), + FieldPanel("content"), + FieldPanel("parts_section_title"), + FieldPanel("image"), FieldPanel("category"), FieldPanel("promoted"), ], diff --git a/districts/models.py b/districts/models.py index 994811f6357d203788e72db95342f5b093ae2841..a5913b836238c0c57fd456051a3a9d58aa89dc5f 100644 --- a/districts/models.py +++ b/districts/models.py @@ -7,7 +7,6 @@ from wagtail.admin.edit_handlers import ( MultiFieldPanel, ) from wagtail.core.models import Page -from wagtail.images.edit_handlers import ImageChooserPanel from wagtailmetadata.models import MetadataPageMixin from shared.models import ExtendedMetadataHomePageMixin @@ -28,7 +27,7 @@ class DistrictsHomePage(ExtendedMetadataHomePageMixin, MetadataPageMixin, Page): [ FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.IMPORTANT_TITLE)), ], gettext_lazy("Common page configuration"), diff --git a/donate/models.py b/donate/models.py index e9c27bbd9d8c8236c82ff7b27fcd29e8908d005c..83574449c0f7fdccc9e30c23b8677d4f71e2e576 100644 --- a/donate/models.py +++ b/donate/models.py @@ -13,12 +13,10 @@ from wagtail.admin.edit_handlers import ( InlinePanel, MultiFieldPanel, PublishingPanel, - StreamFieldPanel, ) from wagtail.core.fields import RichTextField, StreamField from wagtail.core.models import Orderable, Page from wagtail.images.blocks import ImageChooserBlock -from wagtail.images.edit_handlers import ImageChooserPanel from wagtailmetadata.models import MetadataPageMixin from shared.models import ( @@ -154,7 +152,7 @@ class DonateHomePage( FieldPanel("lead_title"), FieldPanel("lead_body"), FieldPanel("lead_video"), - ImageChooserPanel("lead_preview"), + FieldPanel("lead_preview"), ], "hlavní sekce", ), @@ -162,7 +160,7 @@ class DonateHomePage( [ FieldPanel("support_title"), FieldPanel("support_body"), - ImageChooserPanel("support_image"), + FieldPanel("support_image"), ], "podpoř stranu", ), @@ -467,12 +465,12 @@ class DonateProjectPage( content_panels = Page.content_panels + [ MultiFieldPanel( - [FieldPanel("is_new"), FieldPanel("perex"), ImageChooserPanel("photo")], + [FieldPanel("is_new"), FieldPanel("perex"), FieldPanel("photo")], "info do přehledu projektů", ), FieldPanel("date"), FieldPanel("body", classname="full"), - StreamFieldPanel("gallery"), + FieldPanel("gallery"), ] promote_panels = make_promote_panels( diff --git a/elections2021/models.py b/elections2021/models.py index 856143276d3b0581036c8604d023734c31ab974a..a0ba744b934d9b32806940279293161d5077c571 100644 --- a/elections2021/models.py +++ b/elections2021/models.py @@ -22,7 +22,6 @@ from wagtail.admin.edit_handlers import ( ObjectList, PageChooserPanel, PublishingPanel, - StreamFieldPanel, TabbedInterface, ) from wagtail.contrib.routable_page.models import RoutablePageMixin, route @@ -32,7 +31,6 @@ from wagtail.core.fields import RichTextField, StreamField from wagtail.core.models import Page from wagtail.documents.blocks import DocumentChooserBlock from wagtail.images.blocks import ImageChooserBlock -from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.search import index from wagtailmetadata.models import MetadataPageMixin @@ -266,12 +264,12 @@ class Elections2021HomePage(MetadataPageMixin, RoutablePageMixin, Page): ### PANELS content_panels = Page.content_panels + [ - StreamFieldPanel("carousel"), + FieldPanel("carousel"), FieldPanel("elections_date"), ] header_panels = [ - StreamFieldPanel("header_links"), + FieldPanel("header_links"), PageChooserPanel( "program_strategic_page", [ @@ -291,8 +289,8 @@ class Elections2021HomePage(MetadataPageMixin, RoutablePageMixin, Page): ] footer_panels = [ - StreamFieldPanel("footer_menu"), - StreamFieldPanel("footer_links"), + FieldPanel("footer_menu"), + FieldPanel("footer_links"), PageChooserPanel( "gdpr_and_cookies_page", "elections2021.Elections2021TextPage" ), @@ -303,7 +301,7 @@ class Elections2021HomePage(MetadataPageMixin, RoutablePageMixin, Page): [ FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.IMPORTANT_TITLE)), ], gettext_lazy("Common page configuration"), @@ -613,7 +611,7 @@ class Elections2021ArticlesPage(SubpageMixin, MetadataPageMixin, Page): ### PANELS - content_panels = Page.content_panels + [ImageChooserPanel("photo")] + content_panels = Page.content_panels + [FieldPanel("photo")] promote_panels = [ MultiFieldPanel( @@ -621,7 +619,7 @@ class Elections2021ArticlesPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build(admin_help.NO_SEO_TITLE, NO_SEARCH_IMAGE_USE_PHOTO) ), @@ -673,7 +671,7 @@ class Elections2021CandidatesListPage( ### PANELS - content_panels = Page.content_panels + [ImageChooserPanel("photo")] + content_panels = Page.content_panels + [FieldPanel("photo")] promote_panels = [ MultiFieldPanel( @@ -681,7 +679,7 @@ class Elections2021CandidatesListPage( FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build(admin_help.NO_SEO_TITLE, NO_SEARCH_IMAGE_USE_PHOTO) ), @@ -753,7 +751,7 @@ class Elections2021CandidatesMapPage(SubpageMixin, MetadataPageMixin, Page): ### PANELS - content_panels = Page.content_panels + [ImageChooserPanel("photo")] + content_panels = Page.content_panels + [FieldPanel("photo")] promote_panels = [ MultiFieldPanel( @@ -761,7 +759,7 @@ class Elections2021CandidatesMapPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build(admin_help.NO_SEO_TITLE, NO_SEARCH_IMAGE_USE_PHOTO) ), @@ -832,7 +830,7 @@ class Elections2021CandidatePage(SubpageMixin, MetadataPageMixin, Page): ], "osobní údaje", ), - ImageChooserPanel("photo"), + FieldPanel("photo"), FieldPanel("resume"), MultiFieldPanel( [ @@ -1153,7 +1151,7 @@ class Elections2021ProgramPage( content_panels = Page.content_panels + [ FieldPanel("head_title"), - ImageChooserPanel("photo"), + FieldPanel("photo"), ] promote_panels = [ @@ -1162,7 +1160,7 @@ class Elections2021ProgramPage( FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build(admin_help.NO_SEO_TITLE, NO_SEARCH_IMAGE_USE_PHOTO) ), @@ -1189,7 +1187,7 @@ class Elections2021ProgramPage( FieldPanel("archetype_childless_text"), FieldPanel("archetype_childless_author_1"), FieldPanel("archetype_childless_author_2"), - ImageChooserPanel("archetype_childless_photo"), + FieldPanel("archetype_childless_photo"), ], "archetyp bezdětní", ), @@ -1198,7 +1196,7 @@ class Elections2021ProgramPage( FieldPanel("archetype_parents_text"), FieldPanel("archetype_parents_author_1"), FieldPanel("archetype_parents_author_2"), - ImageChooserPanel("archetype_parents_photo"), + FieldPanel("archetype_parents_photo"), ], "archetyp rodiče", ), @@ -1207,7 +1205,7 @@ class Elections2021ProgramPage( FieldPanel("archetype_mature_text"), FieldPanel("archetype_mature_author_1"), FieldPanel("archetype_mature_author_2"), - ImageChooserPanel("archetype_mature_photo"), + FieldPanel("archetype_mature_photo"), ], "archetyp zralí", ), @@ -1216,7 +1214,7 @@ class Elections2021ProgramPage( FieldPanel("archetype_seniors_text"), FieldPanel("archetype_seniors_author_1"), FieldPanel("archetype_seniors_author_2"), - ImageChooserPanel("archetype_seniors_photo"), + FieldPanel("archetype_seniors_photo"), ], "archetyp senioři", ), @@ -1225,7 +1223,7 @@ class Elections2021ProgramPage( FieldPanel("archetype_working_seniors_text"), FieldPanel("archetype_working_seniors_author_1"), FieldPanel("archetype_working_seniors_author_2"), - ImageChooserPanel("archetype_working_seniors_photo"), + FieldPanel("archetype_working_seniors_photo"), ], "archetyp pracující senioři", ), @@ -1234,27 +1232,27 @@ class Elections2021ProgramPage( FieldPanel("archetype_students_text"), FieldPanel("archetype_students_author_1"), FieldPanel("archetype_students_author_2"), - ImageChooserPanel("archetype_students_photo"), + FieldPanel("archetype_students_photo"), ], "archetyp studenti", ), ] ministry_panels = [ - ImageChooserPanel("ministry_transport_photo"), - ImageChooserPanel("ministry_finances_photo"), - ImageChooserPanel("ministry_culture_photo"), - # ImageChooserPanel("ministry_defense_photo"), - ImageChooserPanel("ministry_social_photo"), - ImageChooserPanel("ministry_countryside_photo"), - ImageChooserPanel("ministry_business_photo"), - ImageChooserPanel("ministry_justice_photo"), - ImageChooserPanel("ministry_schools_photo"), - ImageChooserPanel("ministry_interior_photo"), - ImageChooserPanel("ministry_foreign_photo"), - ImageChooserPanel("ministry_health_photo"), - ImageChooserPanel("ministry_agriculture_photo"), - ImageChooserPanel("ministry_environment_photo"), + FieldPanel("ministry_transport_photo"), + FieldPanel("ministry_finances_photo"), + FieldPanel("ministry_culture_photo"), + # FieldPanel("ministry_defense_photo"), + FieldPanel("ministry_social_photo"), + FieldPanel("ministry_countryside_photo"), + FieldPanel("ministry_business_photo"), + FieldPanel("ministry_justice_photo"), + FieldPanel("ministry_schools_photo"), + FieldPanel("ministry_interior_photo"), + FieldPanel("ministry_foreign_photo"), + FieldPanel("ministry_health_photo"), + FieldPanel("ministry_agriculture_photo"), + FieldPanel("ministry_environment_photo"), ] edit_handler = TabbedInterface( @@ -1755,7 +1753,7 @@ class Elections2021ProgramPointPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.NO_SEO_TITLE)), ], gettext_lazy("Common page configuration"), @@ -1763,14 +1761,14 @@ class Elections2021ProgramPointPage(SubpageMixin, MetadataPageMixin, Page): CommentPanel(), ] - faq_panels = [StreamFieldPanel("faq")] + faq_panels = [FieldPanel("faq")] - related_panels = [StreamFieldPanel("related_points")] + related_panels = [FieldPanel("related_points")] benefits_panels = [ FieldPanel("benefit_for_all"), - StreamFieldPanel("benefits_main"), - StreamFieldPanel("benefits"), + FieldPanel("benefits_main"), + FieldPanel("benefits"), ] weights_panels = [ @@ -1977,7 +1975,7 @@ class Elections2021QuestionsPage(SubpageMixin, MetadataPageMixin, Page): content_panels = Page.content_panels + [ FieldPanel("intro"), - ImageChooserPanel("photo"), + FieldPanel("photo"), ] promote_panels = [ @@ -1986,7 +1984,7 @@ class Elections2021QuestionsPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build(admin_help.NO_SEO_TITLE, NO_SEARCH_IMAGE_USE_PHOTO) ), @@ -1996,9 +1994,9 @@ class Elections2021QuestionsPage(SubpageMixin, MetadataPageMixin, Page): CommentPanel(), ] - myths_panels = [StreamFieldPanel("myths")] + myths_panels = [FieldPanel("myths")] - elections_panels = [StreamFieldPanel("elections")] + elections_panels = [FieldPanel("elections")] edit_handler = TabbedInterface( [ @@ -2046,7 +2044,7 @@ class Elections2021ProgramAppPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.NO_SEO_TITLE)), ], gettext_lazy("Common page configuration"), @@ -2136,7 +2134,7 @@ class Elections2021TextPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.NO_SEO_TITLE)), ], gettext_lazy("Common page configuration"), @@ -2168,7 +2166,7 @@ class Elections2021StrategicListPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.NO_SEO_TITLE)), ], gettext_lazy("Common page configuration"), @@ -2230,7 +2228,7 @@ class Elections2021StrategicPage(SubpageMixin, MetadataPageMixin, Page): content_panels = Page.content_panels + [ FieldPanel("perex"), - StreamFieldPanel("content"), + FieldPanel("content"), FieldPanel("card_style"), ] @@ -2240,7 +2238,7 @@ class Elections2021StrategicPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.NO_SEO_TITLE)), ], gettext_lazy("Common page configuration"), @@ -2279,7 +2277,7 @@ class Elections2021MythsPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.NO_SEO_TITLE)), ], gettext_lazy("Common page configuration"), @@ -2338,7 +2336,7 @@ class Elections2021MythPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("perex"), FieldPanel("myth"), FieldPanel("reality"), - StreamFieldPanel("related_points"), + FieldPanel("related_points"), ] promote_panels = [ @@ -2432,8 +2430,8 @@ class Elections2021DownloadsPage(SubpageMixin, MetadataPageMixin, Page): ### PANELS content_panels = Page.content_panels + [ - StreamFieldPanel("downloads"), - StreamFieldPanel("text_downloads"), + FieldPanel("downloads"), + FieldPanel("text_downloads"), ] promote_panels = [ @@ -2442,7 +2440,7 @@ class Elections2021DownloadsPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.NO_SEO_TITLE)), ], gettext_lazy("Common page configuration"), @@ -2504,8 +2502,8 @@ class Elections2021GovernmentTeamPage(SubpageMixin, MetadataPageMixin, Page): ### PANELS content_panels = Page.content_panels + [ - ImageChooserPanel("photo"), - StreamFieldPanel("sections"), + FieldPanel("photo"), + FieldPanel("sections"), ] promote_panels = [ @@ -2514,7 +2512,7 @@ class Elections2021GovernmentTeamPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build(admin_help.NO_SEO_TITLE, NO_SEARCH_IMAGE_USE_PHOTO) ), @@ -2554,7 +2552,7 @@ class Elections2021CalendarPage(SubpageMixin, MetadataPageMixin, CalendarMixin, ### PANELS content_panels = Page.content_panels + [ - ImageChooserPanel("photo"), + FieldPanel("photo"), FieldPanel("calendar_url"), ] @@ -2564,7 +2562,7 @@ class Elections2021CalendarPage(SubpageMixin, MetadataPageMixin, CalendarMixin, FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build(admin_help.NO_SEO_TITLE, NO_SEARCH_IMAGE_USE_PHOTO) ), @@ -2673,7 +2671,7 @@ class Elections2021BannerListPage( content_panels = Page.content_panels + [ FieldPanel("subtitle"), - StreamFieldPanel("banners"), + FieldPanel("banners"), ] promote_panels = [ @@ -2682,7 +2680,7 @@ class Elections2021BannerListPage( FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build(admin_help.NO_SEO_TITLE, NO_SEARCH_IMAGE_USE_PHOTO) ), @@ -2882,7 +2880,7 @@ class Elections2021MapPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build(admin_help.NO_SEO_TITLE, NO_SEARCH_IMAGE_USE_PHOTO) ), @@ -2955,7 +2953,7 @@ class Elections2021ProgramInNutshellPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("leading"), FieldPanel("subtitle"), FieldPanel("body"), - StreamFieldPanel("content"), + FieldPanel("content"), ] promote_panels = [ @@ -2964,7 +2962,7 @@ class Elections2021ProgramInNutshellPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.NO_SEO_TITLE)), ], gettext_lazy("Common page configuration"), @@ -3110,7 +3108,7 @@ class Elections2021GoingToVotePage(SubpageMixin, MetadataPageMixin, Page): [ FieldPanel("section1_title"), FieldPanel("section1_text"), - ImageChooserPanel("section1_image"), + FieldPanel("section1_image"), ], "sekce 1", ), @@ -3118,7 +3116,7 @@ class Elections2021GoingToVotePage(SubpageMixin, MetadataPageMixin, Page): [ FieldPanel("section2_title"), FieldPanel("section2_text"), - ImageChooserPanel("section2_image"), + FieldPanel("section2_image"), ], "sekce 2", ), @@ -3126,7 +3124,7 @@ class Elections2021GoingToVotePage(SubpageMixin, MetadataPageMixin, Page): [ FieldPanel("section3_title"), FieldPanel("section3_text"), - ImageChooserPanel("section3_image"), + FieldPanel("section3_image"), ], "sekce 3", ), @@ -3134,7 +3132,7 @@ class Elections2021GoingToVotePage(SubpageMixin, MetadataPageMixin, Page): [ FieldPanel("section4_title"), FieldPanel("section4_text"), - ImageChooserPanel("section4_image"), + FieldPanel("section4_image"), ], "sekce 4", ), @@ -3142,7 +3140,7 @@ class Elections2021GoingToVotePage(SubpageMixin, MetadataPageMixin, Page): [ FieldPanel("section6_title"), FieldPanel("section6_text"), - ImageChooserPanel("section6_image"), + FieldPanel("section6_image"), ], "sekce 6", ), @@ -3150,7 +3148,7 @@ class Elections2021GoingToVotePage(SubpageMixin, MetadataPageMixin, Page): [ FieldPanel("section7_title"), FieldPanel("section7_text"), - ImageChooserPanel("section7_image"), + FieldPanel("section7_image"), ], "sekce 7", ), @@ -3158,7 +3156,7 @@ class Elections2021GoingToVotePage(SubpageMixin, MetadataPageMixin, Page): [ FieldPanel("section8_title"), FieldPanel("section8_text"), - ImageChooserPanel("section8_image"), + FieldPanel("section8_image"), ], "sekce 8", ), @@ -3166,7 +3164,7 @@ class Elections2021GoingToVotePage(SubpageMixin, MetadataPageMixin, Page): [ FieldPanel("section9_title"), FieldPanel("section9_text"), - ImageChooserPanel("section9_image"), + FieldPanel("section9_image"), ], "sekce 9", ), @@ -3178,7 +3176,7 @@ class Elections2021GoingToVotePage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.NO_SEO_TITLE)), ], gettext_lazy("Common page configuration"), diff --git a/green_deal/models.py b/green_deal/models.py index 7af63847809f8aa05432d3147620811327c3b564..0548f37718635f6f82c58f9a54a631d99cc775c6 100644 --- a/green_deal/models.py +++ b/green_deal/models.py @@ -6,13 +6,11 @@ from wagtail.admin.edit_handlers import ( FieldPanel, HelpPanel, MultiFieldPanel, - StreamFieldPanel, ) from wagtail.core import blocks from wagtail.core.fields import StreamField from wagtail.core.models import Page from wagtail.images.blocks import ImageChooserBlock -from wagtail.images.edit_handlers import ImageChooserPanel from wagtailmetadata.models import MetadataPageMixin from shared.models import ExtendedMetadataHomePageMixin, ExtendedMetadataPageMixin @@ -108,7 +106,7 @@ class GreenDealHomePage(ExtendedMetadataHomePageMixin, MetadataPageMixin, Page): ### PANELS content_panels = Page.content_panels + [ - StreamFieldPanel("content"), + FieldPanel("content"), ] promote_panels = [ @@ -116,7 +114,7 @@ class GreenDealHomePage(ExtendedMetadataHomePageMixin, MetadataPageMixin, Page): [ FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.IMPORTANT_TITLE)), ], gettext_lazy("Common page configuration"), @@ -126,7 +124,7 @@ class GreenDealHomePage(ExtendedMetadataHomePageMixin, MetadataPageMixin, Page): settings_panels = [ FieldPanel("matomo_id"), FieldPanel("title_suffix"), - StreamFieldPanel("top_menu"), + FieldPanel("top_menu"), CommentPanel(), ] @@ -162,7 +160,7 @@ class GreenDealSubPage(Page, ExtendedMetadataPageMixin, MetadataPageMixin): ### PANELS content_panels = Page.content_panels + [ - StreamFieldPanel("content"), + FieldPanel("content"), ] promote_panels = [ @@ -170,7 +168,7 @@ class GreenDealSubPage(Page, ExtendedMetadataPageMixin, MetadataPageMixin): [ FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.IMPORTANT_TITLE)), ], gettext_lazy("Common page configuration"), diff --git a/regulace_konopi/models.py b/regulace_konopi/models.py index 50174db490ae15ebd38e88e014c0a50e72462c53..051443b898f4d3a6703622b516eb845824ff2b0e 100644 --- a/regulace_konopi/models.py +++ b/regulace_konopi/models.py @@ -5,13 +5,11 @@ from wagtail.admin.edit_handlers import ( FieldPanel, HelpPanel, MultiFieldPanel, - StreamFieldPanel, ) from wagtail.core import blocks from wagtail.core.fields import StreamField from wagtail.core.models import Page from wagtail.images.blocks import ImageChooserBlock -from wagtail.images.edit_handlers import ImageChooserPanel from wagtailmetadata.models import MetadataPageMixin from shared.models import ExtendedMetadataHomePageMixin, ExtendedMetadataPageMixin @@ -121,7 +119,7 @@ class RegkonHomePage(ExtendedMetadataHomePageMixin, MetadataPageMixin, Page): ### PANELS content_panels = Page.content_panels + [ - StreamFieldPanel("content"), + FieldPanel("content"), ] promote_panels = [ @@ -129,7 +127,7 @@ class RegkonHomePage(ExtendedMetadataHomePageMixin, MetadataPageMixin, Page): [ FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.IMPORTANT_TITLE)), ], gettext_lazy("Common page configuration"), @@ -139,7 +137,7 @@ class RegkonHomePage(ExtendedMetadataHomePageMixin, MetadataPageMixin, Page): settings_panels = [ FieldPanel("matomo_id"), FieldPanel("title_suffix"), - StreamFieldPanel("top_menu"), + FieldPanel("top_menu"), CommentPanel(), ] @@ -223,7 +221,7 @@ class RegkonSubPage(Page, ExtendedMetadataPageMixin, MetadataPageMixin): FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build( admin_help.NO_SEO_TITLE, admin_help.NO_SEARCH_IMAGE @@ -235,7 +233,7 @@ class RegkonSubPage(Page, ExtendedMetadataPageMixin, MetadataPageMixin): ] content_panels = Page.content_panels + [ - StreamFieldPanel("content"), + FieldPanel("content"), ] settings_panels = [CommentPanel()] diff --git a/senat_campaign/models.py b/senat_campaign/models.py index 2d37b84c7531e6156116ff0689f04a614c05b6ae..bc9f243b74b455cc264898792766938990e450e3 100644 --- a/senat_campaign/models.py +++ b/senat_campaign/models.py @@ -7,14 +7,12 @@ from wagtail.admin.edit_handlers import ( HelpPanel, MultiFieldPanel, PublishingPanel, - StreamFieldPanel, ) from wagtail.core import blocks from wagtail.core.fields import RichTextField, StreamField from wagtail.core.models import Page from wagtail.documents.blocks import DocumentChooserBlock from wagtail.images.blocks import ImageChooserBlock -from wagtail.images.edit_handlers import ImageChooserPanel from wagtailmetadata.models import MetadataPageMixin from calendar_utils.models import CalendarMixin @@ -137,7 +135,7 @@ class SenatCampaignHomePage( ), MultiFieldPanel( [ - ImageChooserPanel("top_photo"), + FieldPanel("top_photo"), FieldPanel("claim"), ], heading="úvodní foto", @@ -146,11 +144,11 @@ class SenatCampaignHomePage( [ FieldPanel("about_left", classname="full"), FieldPanel("about_right", classname="full"), - StreamFieldPanel("about_gallery"), + FieldPanel("about_gallery"), ], heading="kdo jsem", ), - StreamFieldPanel("financials"), + FieldPanel("financials"), ] promote_panels = [ @@ -158,7 +156,7 @@ class SenatCampaignHomePage( [ FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build( admin_help.IMPORTANT_TITLE, @@ -184,7 +182,7 @@ class SenatCampaignHomePage( FieldPanel("donations_url"), FieldPanel("matomo_id"), FieldPanel("title_suffix"), - StreamFieldPanel("contacts"), + FieldPanel("contacts"), CommentPanel(), ] @@ -294,7 +292,7 @@ class SenatCampaignNewsIndexPage( FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build(HELP_COMBINED_TITLE, admin_help.NO_SEARCH_IMAGE) ), @@ -361,7 +359,7 @@ class SenatCampaignNewsPage( FieldPanel("date"), FieldPanel("perex"), FieldPanel("body", classname="full"), - ImageChooserPanel("photo"), + FieldPanel("photo"), ] promote_panels = [ @@ -452,8 +450,8 @@ class SenatCampaignProgramPage( ### PANELS content_panels = Page.content_panels + [ - StreamFieldPanel("committee_preference"), - StreamFieldPanel("content"), + FieldPanel("committee_preference"), + FieldPanel("content"), ] promote_panels = [ @@ -462,7 +460,7 @@ class SenatCampaignProgramPage( FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build(HELP_COMBINED_TITLE, admin_help.NO_SEARCH_IMAGE) ), @@ -506,7 +504,7 @@ class SenatCampaignCookiesPage( FieldPanel("slug"), FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel( admin_help.build(HELP_COMBINED_TITLE, admin_help.NO_SEARCH_IMAGE) ), diff --git a/senate/models.py b/senate/models.py index f7ad86f4d29c3b7ab9af6b6500a8302bfb43d922..7b23e2e35271f3a6638e829b344d37e80cb686ec 100644 --- a/senate/models.py +++ b/senate/models.py @@ -5,13 +5,12 @@ from wagtail.admin.edit_handlers import ( FieldPanel, HelpPanel, MultiFieldPanel, - StreamFieldPanel, ) from wagtail.core import blocks from wagtail.core.fields import StreamField from wagtail.core.models import Page from wagtail.images.blocks import ImageChooserBlock -from wagtail.images.edit_handlers import ImageChooserPanel +from wagtail.images.edit_handlers import FieldPanel from wagtailmetadata.models import MetadataPageMixin from tuning import admin_help @@ -50,9 +49,9 @@ class SenateHomePage(MetadataPageMixin, Page): ### PANELS content_panels = Page.content_panels + [ - StreamFieldPanel("senators"), - StreamFieldPanel("candidates"), - StreamFieldPanel("candidates_second_round"), + FieldPanel("senators"), + FieldPanel("candidates"), + FieldPanel("candidates_second_round"), ] promote_panels = [ @@ -60,7 +59,7 @@ class SenateHomePage(MetadataPageMixin, Page): [ FieldPanel("seo_title"), FieldPanel("search_description"), - ImageChooserPanel("search_image"), + FieldPanel("search_image"), HelpPanel(admin_help.build(admin_help.IMPORTANT_TITLE)), ], gettext_lazy("Common page configuration"), diff --git a/shared/models.py b/shared/models.py index 9e50faed7cff3deff886b6c0a41cd5beed696c7a..db1ff4ab21f91869ff4cc08f444a88712a6993db 100644 --- a/shared/models.py +++ b/shared/models.py @@ -2,15 +2,9 @@ import logging from django.db import models from django.utils import timezone -from wagtail.admin.edit_handlers import ( - FieldPanel, - MultiFieldPanel, - PublishingPanel, - StreamFieldPanel, -) +from wagtail.admin.edit_handlers import FieldPanel, MultiFieldPanel, PublishingPanel from wagtail.core.fields import StreamField from wagtail.core.models import Page -from wagtail.images.edit_handlers import ImageChooserPanel from shared.blocks import DEFAULT_CONTENT_BLOCKS, MenuItemBlock, MenuParentBlock @@ -64,9 +58,9 @@ class ArticleMixin(models.Model): content_panels = Page.content_panels + [ FieldPanel("date"), FieldPanel("perex"), - StreamFieldPanel("content"), + FieldPanel("content"), FieldPanel("author"), - ImageChooserPanel("image"), + FieldPanel("image"), ] settings_panels = [PublishingPanel()] @@ -107,7 +101,7 @@ class MenuMixin(Page): menu_panels = [ MultiFieldPanel( [ - StreamFieldPanel("menu"), + FieldPanel("menu"), ], heading="Menu Options", ), diff --git a/shared/utils.py b/shared/utils.py index a720a600694b033ddd8fbd142d909ec434132ccc..698ed7ed8e68c5860bab00cc52975fcf5e7e4a3e 100644 --- a/shared/utils.py +++ b/shared/utils.py @@ -12,7 +12,7 @@ from wagtail.admin.edit_handlers import ( MultiFieldPanel, ) from wagtail.core.models import Page -from wagtail.images.edit_handlers import ImageChooserPanel +from wagtail.images.edit_handlers import FieldPanel from tuning import admin_help @@ -40,7 +40,7 @@ def make_promote_panels( if search_description: panels.append(FieldPanel("search_description")) if search_image: - panels.append(ImageChooserPanel("search_image")) + panels.append(FieldPanel("search_image")) panels.append(HelpPanel(help_content)) panels.append(CommentPanel()) diff --git a/uniweb/models.py b/uniweb/models.py index ec9d9543aa7a73e70e26782ee7103ae6fff80623..180cf660dd3be1533edd97019c9971023b1580b9 100644 --- a/uniweb/models.py +++ b/uniweb/models.py @@ -7,13 +7,10 @@ from modelcluster.contrib.taggit import ClusterTaggableManager from modelcluster.fields import ParentalKey from taggit.models import TaggedItemBase from wagtail.admin.edit_handlers import ( - CommentPanel, FieldPanel, InlinePanel, MultiFieldPanel, ObjectList, - PublishingPanel, - StreamFieldPanel, TabbedInterface, ) from wagtail.contrib.forms.edit_handlers import FormSubmissionsPanel @@ -329,7 +326,7 @@ class UniwebHomePage( ### PANELS - content_panels = Page.content_panels + [StreamFieldPanel("content")] + content_panels = Page.content_panels + [FieldPanel("content")] promote_panels = make_promote_panels(admin_help.build(admin_help.IMPORTANT_TITLE)) @@ -353,7 +350,7 @@ class UniwebHomePage( ), ] - menu_panels = [StreamFieldPanel("top_menu")] + menu_panels = [FieldPanel("top_menu")] edit_handler = TabbedInterface( [ @@ -402,7 +399,7 @@ class UniwebFlexiblePage( promote_panels = make_promote_panels() content_panels = Page.content_panels + [ - StreamFieldPanel("content"), + FieldPanel("content"), ] settings_panels = [] @@ -525,10 +522,10 @@ class UniwebFormPage( ### PANELS content_panels = AbstractForm.content_panels + [ - StreamFieldPanel("content_before"), + FieldPanel("content_before"), InlinePanel("form_fields", label="formulář"), - StreamFieldPanel("content_after"), - StreamFieldPanel("content_landing"), + FieldPanel("content_after"), + FieldPanel("content_landing"), ] promote_panels = make_promote_panels()