diff --git a/hypha/apply/determinations/models.py b/hypha/apply/determinations/models.py index 60311ca5f5552e3dfd0f0c3c2864544a1d8c6345..6525724b7369121a89fbce028dd4c65b31e41eeb 100644 --- a/hypha/apply/determinations/models.py +++ b/hypha/apply/determinations/models.py @@ -8,7 +8,6 @@ from wagtail.admin.panels import ( FieldPanel, MultiFieldPanel, ObjectList, - StreamFieldPanel, TabbedInterface, ) from wagtail.contrib.settings.models import BaseSetting, register_setting @@ -85,7 +84,7 @@ class DeterminationForm(DeterminationFormFieldsMixin, models.Model): panels = [ FieldPanel('name'), - StreamFieldPanel('form_fields'), + FieldPanel('form_fields'), ] def __str__(self): diff --git a/hypha/apply/funds/models/forms.py b/hypha/apply/funds/models/forms.py index c0889cfbd89650aaf558e4a85242891e132e6746..369c557a3714edd705f1b45cf3751d57af83d3c4 100644 --- a/hypha/apply/funds/models/forms.py +++ b/hypha/apply/funds/models/forms.py @@ -1,6 +1,6 @@ from django.db import models from modelcluster.fields import ParentalKey -from wagtail.admin.panels import FieldPanel, StreamFieldPanel +from wagtail.admin.panels import FieldPanel from wagtail.fields import StreamField from wagtail.models import Orderable @@ -14,7 +14,7 @@ class ApplicationForm(models.Model): panels = [ FieldPanel('name'), - StreamFieldPanel('form_fields'), + FieldPanel('form_fields'), ] def __str__(self): diff --git a/hypha/apply/funds/models/reviewer_role.py b/hypha/apply/funds/models/reviewer_role.py index 413af02f86ad77e576819be5693eb84dcc6d694c..d90e6ea5e86fd2176139a050a9f60994765465f9 100644 --- a/hypha/apply/funds/models/reviewer_role.py +++ b/hypha/apply/funds/models/reviewer_role.py @@ -2,7 +2,6 @@ from django.db import models from django.utils.translation import gettext_lazy as _ from wagtail.admin.panels import FieldPanel from wagtail.contrib.settings.models import BaseSetting, register_setting -from wagtail.images.edit_handlers import ImageChooserPanel from hypha.apply.utils.image import generate_image_url @@ -24,7 +23,7 @@ class ReviewerRole(models.Model): panels = [ FieldPanel('name'), - ImageChooserPanel('icon'), + FieldPanel('icon'), FieldPanel('order'), ] diff --git a/hypha/apply/projects/models/project.py b/hypha/apply/projects/models/project.py index dd9ea6434614d546384da019a359acf4c935f4a0..c1441746d66bba4ce6f2ae8ceb0c6eed896df1fa 100644 --- a/hypha/apply/projects/models/project.py +++ b/hypha/apply/projects/models/project.py @@ -16,7 +16,7 @@ from django.dispatch.dispatcher import receiver from django.urls import reverse from django.utils import timezone from django.utils.translation import gettext_lazy as _ -from wagtail.admin.panels import FieldPanel, StreamFieldPanel +from wagtail.admin.panels import FieldPanel from wagtail.contrib.settings.models import BaseSetting, register_setting from wagtail.fields import StreamField @@ -379,7 +379,7 @@ class ProjectApprovalForm(BaseStreamForm, models.Model): panels = [ FieldPanel('name'), - StreamFieldPanel('form_fields'), + FieldPanel('form_fields'), ] def __str__(self): diff --git a/hypha/apply/review/models.py b/hypha/apply/review/models.py index 7cedb235da570c7807ff8d4b0ed4fc352dc324a6..332bc68fdda7567a32cfac8ad115df6b45e9ad65 100644 --- a/hypha/apply/review/models.py +++ b/hypha/apply/review/models.py @@ -3,7 +3,7 @@ from django.db import models from django.urls import reverse from django.utils.functional import cached_property from django.utils.translation import gettext_lazy as _ -from wagtail.admin.panels import FieldPanel, StreamFieldPanel +from wagtail.admin.panels import FieldPanel from wagtail.fields import StreamField from hypha.apply.funds.models.mixins import AccessFormData @@ -82,7 +82,7 @@ class ReviewForm(ReviewFormFieldsMixin, models.Model): panels = [ FieldPanel('name'), - StreamFieldPanel('form_fields'), + FieldPanel('form_fields'), ] def __str__(self): diff --git a/hypha/public/funds/models.py b/hypha/public/funds/models.py index 0864d98d35ff355b2ced783f6c23de2943ffffed..d8be4c3a46f8b462b27d6ddb588f892a228f3319 100644 --- a/hypha/public/funds/models.py +++ b/hypha/public/funds/models.py @@ -13,10 +13,8 @@ from wagtail.admin.panels import ( InlinePanel, MultiFieldPanel, PageChooserPanel, - StreamFieldPanel, ) from wagtail.fields import StreamField -from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.search import index from hypha.apply.funds.models import ApplicationSubmission @@ -53,7 +51,7 @@ class BaseApplicationPage(BasePage): content_panels = BasePage.content_panels + [ FieldPanel('introduction', widget=PagedownWidget()), - StreamFieldPanel('body'), + FieldPanel('body'), InlinePanel('related_pages', label=_('Related pages')), ] @@ -158,7 +156,7 @@ class LabPage(BasePage): ] content_panels = BasePage.content_panels + [ - ImageChooserPanel('icon'), + FieldPanel('icon'), FieldPanel('introduction'), MultiFieldPanel([ PageChooserPanel('lab_type', 'funds.LabType'), @@ -167,7 +165,7 @@ class LabPage(BasePage): FieldPanel('link_text'), ]), ], heading=_('Link for lab application')), - StreamFieldPanel('body'), + FieldPanel('body'), InlinePanel('related_pages', label=_('Related pages')), ] diff --git a/hypha/public/home/models.py b/hypha/public/home/models.py index 8b5706588e862cf686f1ff8a9a2fc946f3772c35..af4bcf34c0c2e9a1f6405d49fecf33bdc0413a07 100644 --- a/hypha/public/home/models.py +++ b/hypha/public/home/models.py @@ -8,7 +8,6 @@ from wagtail.admin.panels import ( InlinePanel, MultiFieldPanel, PageChooserPanel, - StreamFieldPanel, ) from wagtail.fields import StreamField from wagtail.search import index @@ -112,7 +111,7 @@ class HomePage(BasePage): ], heading=_('News')), MultiFieldPanel([ FieldPanel('our_work_title'), - StreamFieldPanel('our_work'), + FieldPanel('our_work'), PageChooserPanel('our_work_link'), FieldPanel('our_work_link_text'), ], heading=_('Our Work')), diff --git a/hypha/public/navigation/models.py b/hypha/public/navigation/models.py index 79fa4a4d268cd8370cd94c85af486f0230ae3c0e..b5570ec6e1b02260c9a783fa88d059d514485e12 100644 --- a/hypha/public/navigation/models.py +++ b/hypha/public/navigation/models.py @@ -1,7 +1,7 @@ from django.utils.translation import gettext_lazy as _ from modelcluster.models import ClusterableModel from wagtail import blocks -from wagtail.admin.panels import StreamFieldPanel +from wagtail.admin.panels import FieldPanel from wagtail.contrib.settings.models import BaseSetting, register_setting from wagtail.fields import StreamField @@ -24,5 +24,5 @@ class NavigationSettings(BaseSetting, ClusterableModel): ) panels = [ - StreamFieldPanel('primary_navigation'), + FieldPanel('primary_navigation'), ] diff --git a/hypha/public/news/models.py b/hypha/public/news/models.py index a80ef038c2a4972dd49be947d615cc9450e13e79..a5d55804546ff46c0b415d3a5e73d131478cb3fd 100644 --- a/hypha/public/news/models.py +++ b/hypha/public/news/models.py @@ -5,12 +5,7 @@ from django.db.models.functions import Coalesce from django.utils.translation import gettext_lazy as _ from modelcluster.fields import ParentalKey from pagedown.widgets import PagedownWidget -from wagtail.admin.panels import ( - FieldPanel, - InlinePanel, - PageChooserPanel, - StreamFieldPanel, -) +from wagtail.admin.panels import FieldPanel, InlinePanel, PageChooserPanel from wagtail.contrib.settings.models import BaseSetting, register_setting from wagtail.fields import StreamField from wagtail.models import Orderable @@ -112,7 +107,7 @@ class NewsPage(BasePage): FieldPanel('publication_date'), InlinePanel('authors', label=_('Authors')), FieldPanel('introduction'), - StreamFieldPanel('body'), + FieldPanel('body'), InlinePanel('news_types', label=_('News types')), InlinePanel('related_projects', label=_('Mentioned project')), InlinePanel('related_pages', label=_('Related pages')), diff --git a/hypha/public/partner/models.py b/hypha/public/partner/models.py index 4c7d128fbfd75b5614c9c5efd78441a7d50b4110..2f002914f29dbdf336b740db4135363894addc9f 100644 --- a/hypha/public/partner/models.py +++ b/hypha/public/partner/models.py @@ -12,7 +12,6 @@ from wagtail.admin.forms import WagtailAdminModelForm from wagtail.admin.panels import FieldPanel from wagtail.contrib.settings.models import BaseSetting, register_setting from wagtail.fields import RichTextField -from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.models import Page from wagtail.search import index @@ -70,7 +69,7 @@ class PartnerPage(BasePage): FieldPanel('public'), FieldPanel('description'), FieldPanel('web_url'), - ImageChooserPanel('logo'), + FieldPanel('logo'), ] def __str__(self): diff --git a/hypha/public/people/models.py b/hypha/public/people/models.py index 9f7183b1af1ebcfb12c9b069b429645545cce1e2..5e01d02a1f358344d7b17c14803838875b92db99 100644 --- a/hypha/public/people/models.py +++ b/hypha/public/people/models.py @@ -11,10 +11,8 @@ from wagtail.admin.panels import ( InlinePanel, MultiFieldPanel, PageChooserPanel, - StreamFieldPanel, ) from wagtail.fields import StreamField -from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.models import Orderable, PageManager from wagtail.query import PageQuerySet from wagtail.search import index @@ -180,7 +178,7 @@ class PersonPage(FundingMixin, BasePage): FieldPanel('last_name'), ], heading=_('Name')), FieldPanel('active'), - ImageChooserPanel('photo'), + FieldPanel('photo'), FieldPanel('job_title'), InlinePanel('social_media_profile', label=_('Social accounts')), FieldPanel('website'), @@ -190,7 +188,7 @@ class PersonPage(FundingMixin, BasePage): ], heading=_('Contact information')), InlinePanel('person_types', label=_('Person types')), FieldPanel('introduction'), - StreamFieldPanel('biography'), + FieldPanel('biography'), InlinePanel('funds_reviewed', label=_('Funds Reviewed')), ] + FundingMixin.content_panels diff --git a/hypha/public/projects/models.py b/hypha/public/projects/models.py index 0d5fc0aa25faef4c50321b9998df26f2e7328a6e..2b0934be5c5b37fe133ad236e61fc970e4c55a46 100644 --- a/hypha/public/projects/models.py +++ b/hypha/public/projects/models.py @@ -13,10 +13,8 @@ from wagtail.admin.panels import ( InlinePanel, MultiFieldPanel, PageChooserPanel, - StreamFieldPanel, ) from wagtail.fields import StreamField -from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.search import index from hypha.apply.categories.models import Option @@ -122,10 +120,10 @@ class ProjectPage(FundingMixin, BasePage): ] content_panels = BasePage.content_panels + [ - ImageChooserPanel('icon'), + FieldPanel('icon'), FieldPanel('status'), FieldPanel('introduction'), - StreamFieldPanel('body'), + FieldPanel('body'), InlinePanel('contact_details', label=_('Contact Details')), ] + FundingMixin.content_panels + [ InlinePanel('related_pages', label=_('Related Projects')), diff --git a/hypha/public/standardpages/models.py b/hypha/public/standardpages/models.py index 1f23410c4f12dac0415e19cbd36a405decd3ed37..b6ba9cc22754fe76ab16be1fc40cb30b1003d18d 100644 --- a/hypha/public/standardpages/models.py +++ b/hypha/public/standardpages/models.py @@ -4,7 +4,7 @@ from django.db import models from django.utils.translation import gettext_lazy as _ from modelcluster.fields import ParentalKey from pagedown.widgets import PagedownWidget -from wagtail.admin.panels import FieldPanel, InlinePanel, StreamFieldPanel +from wagtail.admin.panels import FieldPanel, InlinePanel from wagtail.fields import StreamField from wagtail.search import index @@ -27,7 +27,7 @@ class InformationPage(BasePage): content_panels = BasePage.content_panels + [ FieldPanel('introduction'), - StreamFieldPanel('body'), + FieldPanel('body'), InlinePanel('related_pages', label=_('Related pages')), ] diff --git a/hypha/public/utils/models.py b/hypha/public/utils/models.py index 48ceca0766ab1ca2fa7d072d16a6b636b7ca8029..4314877982cc24f2f38515f104f165e0cd94f7c0 100644 --- a/hypha/public/utils/models.py +++ b/hypha/public/utils/models.py @@ -10,11 +10,9 @@ from wagtail.admin.panels import ( InlinePanel, MultiFieldPanel, PageChooserPanel, - StreamFieldPanel, ) from wagtail.contrib.settings.models import BaseSetting, register_setting from wagtail.fields import RichTextField, StreamField -from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.models import Orderable, Page from wagtail.snippets.models import register_snippet from wagtailcache.cache import WagtailCacheMixin, cache_page @@ -108,7 +106,7 @@ class SocialFields(models.Model): promote_panels = [ MultiFieldPanel([ - ImageChooserPanel('social_image'), + FieldPanel('social_image'), FieldPanel('social_text'), ], 'Social networks'), ] @@ -132,7 +130,7 @@ class ListingFields(models.Model): promote_panels = [ MultiFieldPanel([ - ImageChooserPanel('listing_image'), + FieldPanel('listing_image'), FieldPanel('listing_title'), FieldPanel('listing_summary'), ], 'Listing information'), @@ -167,8 +165,8 @@ class CallToActionSnippet(models.Model): panels = [ FieldPanel('title'), FieldPanel('summary'), - ImageChooserPanel('image'), - StreamFieldPanel('link'), + FieldPanel('image'), + FieldPanel('link'), ] def get_link_text(self): @@ -270,8 +268,8 @@ class SystemMessagesSettings(BaseSetting): panels = [ MultiFieldPanel([ - ImageChooserPanel('site_logo_default'), - ImageChooserPanel('site_logo_mobile'), + FieldPanel('site_logo_default'), + FieldPanel('site_logo_mobile'), FieldPanel('site_logo_link'), ], 'Site logo'), FieldPanel('footer_content'), @@ -298,7 +296,7 @@ class BasePage(WagtailCacheMixin, SocialFields, ListingFields, Page): abstract = True content_panels = Page.content_panels + [ - ImageChooserPanel('header_image') + FieldPanel('header_image') ] promote_panels = (