Browse Source

Upgrade to Wagtail 3 (#507)

Vince Salvino 2 years ago
parent
commit
c00fa19593
61 changed files with 234 additions and 443 deletions
  1. 1 1
      coderedcms/api/mailchimp.py
  2. 1 1
      coderedcms/blocks/__init__.py
  3. 3 3
      coderedcms/blocks/base_blocks.py
  4. 1 1
      coderedcms/blocks/content_blocks.py
  5. 1 1
      coderedcms/blocks/html_blocks.py
  6. 1 1
      coderedcms/blocks/layout_blocks.py
  7. 1 1
      coderedcms/blocks/stream_form_blocks.py
  8. 1 1
      coderedcms/fields.py
  9. 1 1
      coderedcms/importexport.py
  10. 4 4
      coderedcms/migrations/0001_initial.py
  11. 2 2
      coderedcms/migrations/0002_auto_20180829_1538.py
  12. 2 2
      coderedcms/migrations/0003_auto_20180912_1632.py
  13. 2 2
      coderedcms/migrations/0004_auto_20181119_1507.py
  14. 2 2
      coderedcms/migrations/0005_auto_20181214_2214.py
  15. 2 2
      coderedcms/migrations/0008_auto_20190122_1242.py
  16. 2 2
      coderedcms/migrations/0010_auto_20190320_1231.py
  17. 2 2
      coderedcms/migrations/0013_pagepreview_templates.py
  18. 2 2
      coderedcms/migrations/0014_classifiers.py
  19. 2 2
      coderedcms/migrations/0016_auto_20191025_1620.py
  20. 2 2
      coderedcms/migrations/0018_auto_20200805_1702.py
  21. 2 2
      coderedcms/migrations/0019_spelling_corrections.py
  22. 3 3
      coderedcms/migrations/0020_auto_20210527_1030.py
  23. 2 2
      coderedcms/migrations/0026_auto_20220513_1627.py
  24. 50 0
      coderedcms/migrations/0031_wagtail3.py
  25. 2 2
      coderedcms/models/integration_models.py
  26. 37 19
      coderedcms/models/page_models.py
  27. 18 11
      coderedcms/models/snippet_models.py
  28. 2 67
      coderedcms/models/tests/test_navbars_and_footers.py
  29. 1 1
      coderedcms/models/tests/test_page_models.py
  30. 2 2
      coderedcms/models/tests/test_wagtailsettings_models.py
  31. 6 8
      coderedcms/models/wagtailsettings_models.py
  32. 2 2
      coderedcms/project_template/basic/project_name/settings/base.py
  33. 4 4
      coderedcms/project_template/basic/website/migrations/0001_initial.py
  34. 1 1
      coderedcms/project_template/basic/website/migrations/0002_initial_data.py
  35. 2 2
      coderedcms/project_template/sass/project_name/settings/base.py
  36. 4 4
      coderedcms/project_template/sass/website/migrations/0001_initial.py
  37. 1 1
      coderedcms/project_template/sass/website/migrations/0002_initial_data.py
  38. 13 146
      coderedcms/static/coderedcms/css/codered-admin.css
  39. 4 86
      coderedcms/static/coderedcms/css/codered-editor.css
  40. 1 1
      coderedcms/templates/coderedcms/widgets/checkbox_classifiers.html
  41. 11 11
      coderedcms/templates/wagtailadmin/block_forms/base_block_settings_struct.html
  42. 1 1
      coderedcms/templatetags/coderedcms_tags.py
  43. 2 2
      coderedcms/tests/settings.py
  44. 1 1
      coderedcms/tests/test_urls.py
  45. 1 1
      coderedcms/tests/testapp/migrations/0002_initial.py
  46. 2 2
      coderedcms/tests/testapp/migrations/0003_eventindexpage_eventoccurrence_eventpage_locationindexpage_locationpage.py
  47. 2 2
      coderedcms/tests/testapp/migrations/0004_streamformconfirmemail_streamformpage.py
  48. 2 2
      coderedcms/tests/testapp/migrations/0005_auto_20210908_1741.py
  49. 1 1
      coderedcms/urls.py
  50. 1 1
      coderedcms/views.py
  51. 1 1
      coderedcms/wagtail_flexible_forms/blocks.py
  52. 1 1
      coderedcms/wagtail_flexible_forms/edit_handlers.py
  53. 1 1
      coderedcms/wagtail_flexible_forms/models.py
  54. 2 2
      coderedcms/wagtail_flexible_forms/wagtail_hooks.py
  55. 2 2
      coderedcms/wagtail_hooks.py
  56. 1 1
      docs/advanced/advanced02.rst
  57. 1 1
      docs/how_to/translation.rst
  58. 3 3
      setup.py
  59. 1 1
      tutorial/mysite/mysite/settings/base.py
  60. 4 6
      tutorial/mysite/website/migrations/0001_initial.py
  61. 1 1
      tutorial/mysite/website/models.py

+ 1 - 1
coderedcms/api/mailchimp.py

@@ -1,4 +1,4 @@
-from wagtail.core.models import Site
+from wagtail.models import Site
 from coderedcms.models.wagtailsettings_models import MailchimpApiSettings
 
 import requests

+ 1 - 1
coderedcms/blocks/__init__.py

@@ -6,7 +6,7 @@ single `blocks` module.
 
 from django.utils.translation import gettext_lazy as _
 
-from wagtail.core import blocks
+from wagtail import blocks
 
 from .stream_form_blocks import (
     CoderedStreamFormCharFieldBlock,

+ 3 - 3
coderedcms/blocks/base_blocks.py

@@ -7,9 +7,9 @@ from django.template.loader import render_to_string
 from django.utils.functional import cached_property
 from django.utils.safestring import mark_safe
 from django.utils.translation import gettext_lazy as _
-from wagtail.core import blocks
-from wagtail.core.models import Collection
-from wagtail.core.utils import resolve_model_string
+from wagtail import blocks
+from wagtail.models import Collection
+from wagtail.coreutils import resolve_model_string
 from wagtail.documents.blocks import DocumentChooserBlock
 
 from coderedcms.settings import crx_settings

+ 1 - 1
coderedcms/blocks/content_blocks.py

@@ -3,7 +3,7 @@ Content blocks are for building complex, nested HTML structures that usually
 contain sub-blocks, and may require javascript to function properly.
 """
 from django.utils.translation import gettext_lazy as _
-from wagtail.core import blocks
+from wagtail import blocks
 from wagtail.documents.blocks import DocumentChooserBlock
 from wagtail.images.blocks import ImageChooserBlock
 from wagtail.snippets.blocks import SnippetChooserBlock

+ 1 - 1
coderedcms/blocks/html_blocks.py

@@ -9,7 +9,7 @@ creating recursion.
 import logging
 from django.utils.translation import gettext_lazy as _
 from wagtail.contrib.table_block.blocks import TableBlock as WagtailTableBlock
-from wagtail.core import blocks
+from wagtail import blocks
 from wagtail.documents.blocks import DocumentChooserBlock
 from wagtail.embeds.blocks import EmbedBlock
 from wagtail.images.blocks import ImageChooserBlock

+ 1 - 1
coderedcms/blocks/layout_blocks.py

@@ -4,7 +4,7 @@ e.g. rows, columns, hero units, etc.
 """
 
 from django.utils.translation import gettext_lazy as _
-from wagtail.core import blocks
+from wagtail import blocks
 from wagtail.images.blocks import ImageChooserBlock
 
 from coderedcms.settings import crx_settings

+ 1 - 1
coderedcms/blocks/stream_form_blocks.py

@@ -1,5 +1,5 @@
 from django.utils.translation import gettext_lazy as _
-from wagtail.core import blocks
+from wagtail import blocks
 
 from coderedcms.wagtail_flexible_forms import blocks as form_blocks
 from coderedcms.blocks.base_blocks import BaseBlock, CoderedAdvSettings

+ 1 - 1
coderedcms/fields.py

@@ -1,6 +1,6 @@
 from django.db import models
 from django.forms.widgets import Textarea
-from wagtail.core.fields import StreamField
+from wagtail.fields import StreamField
 
 from coderedcms.widgets import ColorPickerWidget
 

+ 1 - 1
coderedcms/importexport.py

@@ -17,7 +17,7 @@ from django.db import models, transaction
 from django.utils.translation import gettext as _
 from modelcluster.models import get_all_child_relations
 from wagtail.admin.widgets import AdminPageChooser
-from wagtail.core.models import Page
+from wagtail.models import Page
 
 from coderedcms.forms import get_page_model_choices
 

+ 4 - 4
coderedcms/migrations/0001_initial.py

@@ -7,8 +7,8 @@ import django.db.models.deletion
 import django.forms.widgets
 import modelcluster.fields
 import wagtail.contrib.table_block.blocks
-import wagtail.core.blocks
-import wagtail.core.fields
+import wagtail.blocks
+import wagtail.fields
 import wagtail.documents.blocks
 import wagtail.images.blocks
 import wagtail.snippets.blocks
@@ -94,8 +94,8 @@ class Migration(migrations.Migration):
                 ('struct_org_address_country', models.CharField(blank=True, help_text='For example, USA. Two-letter ISO 3166-1 alpha-2 country code is also acceptible https://en.wikipedia.org/wiki/ISO_3166-1', max_length=255, verbose_name='Country')),
                 ('struct_org_geo_lat', models.DecimalField(blank=True, decimal_places=8, max_digits=10, null=True, verbose_name='Geographic latitude')),
                 ('struct_org_geo_lng', models.DecimalField(blank=True, decimal_places=8, max_digits=10, null=True, verbose_name='Geographic longitude')),
-                ('struct_org_hours', wagtail.core.fields.StreamField([('hours', wagtail.core.blocks.StructBlock([('days', wagtail.core.blocks.MultipleChoiceBlock(choices=(('Monday', 'Monday'), ('Tuesday', 'Tuesday'), ('Wednesday', 'Wednesday'), ('Thursday', 'Thursday'), ('Friday', 'Friday'), ('Saturday', 'Saturday'), ('Sunday', 'Sunday')), help_text='For late night hours past 23:59, define each day in a separate block.', required=True, verbose_name='Days', widget=django.forms.widgets.CheckboxSelectMultiple)), ('start_time', wagtail.core.blocks.TimeBlock(verbose_name='Opening time')), ('end_time', wagtail.core.blocks.TimeBlock(verbose_name='Closing time'))]))], blank=True, verbose_name='Hours of operation')),
-                ('struct_org_actions', wagtail.core.fields.StreamField([('actions', wagtail.core.blocks.StructBlock([('action_type', wagtail.core.blocks.ChoiceBlock(choices=[('OrderAction', 'OrderAction'), ('ReserveAction', 'ReserveAction')], verbose_name='Action Type')), ('target', wagtail.core.blocks.URLBlock(verbose_name='Target URL')), ('language', wagtail.core.blocks.CharBlock(default='en-US', help_text='If the action is offered in multiple languages, create separate actions for each language.', verbose_name='Language')), ('result_type', wagtail.core.blocks.ChoiceBlock(choices=[('Reservation', 'Reservation'), ('BusReservation', 'BusReservation'), ('EventReservation', 'EventReservation'), ('FlightReservation', 'FlightReservation'), ('FoodEstablishmentReservation', 'FoodEstablishmentReservation'), ('LodgingReservation', 'LodgingReservation'), ('RentalCarReservation', 'RentalCarReservation'), ('ReservationPackage', 'ReservationPackage'), ('TaxiReservation', 'TaxiReservation'), ('TrainReservation', 'TrainReservation')], help_text='Leave blank for OrderAction', required=False, verbose_name='Result Type')), ('result_name', wagtail.core.blocks.CharBlock(help_text='Example: "Reserve a table", "Book an appointment", etc.', required=False, verbose_name='Result Name')), ('extra_json', wagtail.core.blocks.RawHTMLBlock(classname='monospace', help_text='Additional JSON-LD inserted into the Action dictionary. Must be properties of https://schema.org/Action.', required=False, verbose_name='Additional action markup'))]))], blank=True, verbose_name='Actions')),
+                ('struct_org_hours', wagtail.fields.StreamField([('hours', wagtail.blocks.StructBlock([('days', wagtail.blocks.MultipleChoiceBlock(choices=(('Monday', 'Monday'), ('Tuesday', 'Tuesday'), ('Wednesday', 'Wednesday'), ('Thursday', 'Thursday'), ('Friday', 'Friday'), ('Saturday', 'Saturday'), ('Sunday', 'Sunday')), help_text='For late night hours past 23:59, define each day in a separate block.', required=True, verbose_name='Days', widget=django.forms.widgets.CheckboxSelectMultiple)), ('start_time', wagtail.blocks.TimeBlock(verbose_name='Opening time')), ('end_time', wagtail.blocks.TimeBlock(verbose_name='Closing time'))]))], blank=True, verbose_name='Hours of operation')),
+                ('struct_org_actions', wagtail.fields.StreamField([('actions', wagtail.blocks.StructBlock([('action_type', wagtail.blocks.ChoiceBlock(choices=[('OrderAction', 'OrderAction'), ('ReserveAction', 'ReserveAction')], verbose_name='Action Type')), ('target', wagtail.blocks.URLBlock(verbose_name='Target URL')), ('language', wagtail.blocks.CharBlock(default='en-US', help_text='If the action is offered in multiple languages, create separate actions for each language.', verbose_name='Language')), ('result_type', wagtail.blocks.ChoiceBlock(choices=[('Reservation', 'Reservation'), ('BusReservation', 'BusReservation'), ('EventReservation', 'EventReservation'), ('FlightReservation', 'FlightReservation'), ('FoodEstablishmentReservation', 'FoodEstablishmentReservation'), ('LodgingReservation', 'LodgingReservation'), ('RentalCarReservation', 'RentalCarReservation'), ('ReservationPackage', 'ReservationPackage'), ('TaxiReservation', 'TaxiReservation'), ('TrainReservation', 'TrainReservation')], help_text='Leave blank for OrderAction', required=False, verbose_name='Result Type')), ('result_name', wagtail.blocks.CharBlock(help_text='Example: "Reserve a table", "Book an appointment", etc.', required=False, verbose_name='Result Name')), ('extra_json', wagtail.blocks.RawHTMLBlock(classname='monospace', help_text='Additional JSON-LD inserted into the Action dictionary. Must be properties of https://schema.org/Action.', required=False, verbose_name='Additional action markup'))]))], blank=True, verbose_name='Actions')),
                 ('struct_org_extra_json', models.TextField(blank=True, help_text='Additional JSON-LD inserted into the Organization dictionary. Must be properties of https://schema.org/Organization or the selected organization type.', verbose_name='Additional Organization markup')),
                 ('cover_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=get_image_model_string(), verbose_name='Cover image')),
                 ('og_image', models.ForeignKey(blank=True, help_text='The image shown when linking to this page on social media. If blank, defaults to article cover image, or logo in Settings > Layout > Logo', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=get_image_model_string(), verbose_name='Open Graph preview image')),

+ 2 - 2
coderedcms/migrations/0002_auto_20180829_1538.py

@@ -4,8 +4,8 @@ import coderedcms.blocks.base_blocks
 import coderedcms.fields
 from django.db import migrations, models
 import wagtail.contrib.table_block.blocks
-import wagtail.core.blocks
-import wagtail.core.fields
+import wagtail.blocks
+import wagtail.fields
 import wagtail.documents.blocks
 import wagtail.images.blocks
 import wagtail.snippets.blocks

+ 2 - 2
coderedcms/migrations/0003_auto_20180912_1632.py

@@ -4,8 +4,8 @@ import coderedcms.blocks.base_blocks
 import coderedcms.fields
 from django.db import migrations, models
 import wagtail.contrib.table_block.blocks
-import wagtail.core.blocks
-import wagtail.core.fields
+import wagtail.blocks
+import wagtail.fields
 import wagtail.documents.blocks
 import wagtail.images.blocks
 import wagtail.snippets.blocks

+ 2 - 2
coderedcms/migrations/0004_auto_20181119_1507.py

@@ -4,8 +4,8 @@ import coderedcms.blocks.base_blocks
 from django.db import migrations, models
 import django.db.models.deletion
 import wagtail.contrib.table_block.blocks
-import wagtail.core.blocks
-import wagtail.core.fields
+import wagtail.blocks
+import wagtail.fields
 import wagtail.documents.blocks
 import wagtail.images.blocks
 import wagtail.snippets.blocks

+ 2 - 2
coderedcms/migrations/0005_auto_20181214_2214.py

@@ -7,8 +7,8 @@ import django.db.models.deletion
 import modelcluster.contrib.taggit
 import modelcluster.fields
 import wagtail.contrib.table_block.blocks
-import wagtail.core.blocks
-import wagtail.core.fields
+import wagtail.blocks
+import wagtail.fields
 import wagtail.documents.blocks
 import wagtail.embeds.blocks
 import wagtail.images.blocks

+ 2 - 2
coderedcms/migrations/0008_auto_20190122_1242.py

@@ -4,8 +4,8 @@ import coderedcms.blocks.base_blocks
 import coderedcms.fields
 from django.db import migrations
 import wagtail.contrib.table_block.blocks
-import wagtail.core.blocks
-import wagtail.core.fields
+import wagtail.blocks
+import wagtail.fields
 import wagtail.documents.blocks
 import wagtail.embeds.blocks
 import wagtail.images.blocks

+ 2 - 2
coderedcms/migrations/0010_auto_20190320_1231.py

@@ -4,8 +4,8 @@ import coderedcms.blocks.base_blocks
 import coderedcms.fields
 from django.db import migrations
 import wagtail.contrib.table_block.blocks
-import wagtail.core.blocks
-import wagtail.core.fields
+import wagtail.blocks
+import wagtail.fields
 import wagtail.documents.blocks
 import wagtail.embeds.blocks
 import wagtail.images.blocks

+ 2 - 2
coderedcms/migrations/0013_pagepreview_templates.py

@@ -5,8 +5,8 @@ import coderedcms.blocks.html_blocks
 import coderedcms.fields
 from django.db import migrations
 import wagtail.contrib.table_block.blocks
-import wagtail.core.blocks
-import wagtail.core.fields
+import wagtail.blocks
+import wagtail.fields
 import wagtail.documents.blocks
 import wagtail.embeds.blocks
 import wagtail.images.blocks

+ 2 - 2
coderedcms/migrations/0014_classifiers.py

@@ -8,8 +8,8 @@ import django.db.models.deletion
 import modelcluster.contrib.taggit
 import modelcluster.fields
 import wagtail.contrib.table_block.blocks
-import wagtail.core.blocks
-import wagtail.core.fields
+import wagtail.blocks
+import wagtail.fields
 import wagtail.documents.blocks
 import wagtail.embeds.blocks
 import wagtail.images.blocks

+ 2 - 2
coderedcms/migrations/0016_auto_20191025_1620.py

@@ -5,8 +5,8 @@ import coderedcms.blocks.html_blocks
 import coderedcms.fields
 from django.db import migrations
 import wagtail.contrib.table_block.blocks
-import wagtail.core.blocks
-import wagtail.core.fields
+import wagtail.blocks
+import wagtail.fields
 import wagtail.documents.blocks
 import wagtail.embeds.blocks
 import wagtail.images.blocks

+ 2 - 2
coderedcms/migrations/0018_auto_20200805_1702.py

@@ -5,8 +5,8 @@ import coderedcms.blocks.html_blocks
 import coderedcms.fields
 from django.db import migrations
 import wagtail.contrib.table_block.blocks
-import wagtail.core.blocks
-import wagtail.core.fields
+import wagtail.blocks
+import wagtail.fields
 import wagtail.documents.blocks
 import wagtail.embeds.blocks
 import wagtail.images.blocks

+ 2 - 2
coderedcms/migrations/0019_spelling_corrections.py

@@ -5,8 +5,8 @@ import coderedcms.blocks.html_blocks
 import coderedcms.fields
 from django.db import migrations, models
 import wagtail.contrib.table_block.blocks
-import wagtail.core.blocks
-import wagtail.core.fields
+import wagtail.blocks
+import wagtail.fields
 import wagtail.documents.blocks
 import wagtail.embeds.blocks
 import wagtail.images.blocks

+ 3 - 3
coderedcms/migrations/0020_auto_20210527_1030.py

@@ -1,8 +1,8 @@
 # Generated by Django 3.1.7 on 2021-05-27 14:30
 
 from django.db import migrations
-import wagtail.core.blocks
-import wagtail.core.fields
+import wagtail.blocks
+import wagtail.fields
 
 
 class Migration(migrations.Migration):
@@ -15,6 +15,6 @@ class Migration(migrations.Migration):
         migrations.AlterField(
             model_name='coderedpage',
             name='struct_org_hours',
-            field=wagtail.core.fields.StreamField([('hours', wagtail.core.blocks.StructBlock([('days', wagtail.core.blocks.MultipleChoiceBlock(choices=[('Monday', 'Monday'), ('Tuesday', 'Tuesday'), ('Wednesday', 'Wednesday'), ('Thursday', 'Thursday'), ('Friday', 'Friday'), ('Saturday', 'Saturday'), ('Sunday', 'Sunday')], help_text='For late night hours past 23:59, define each day in a separate block.', verbose_name='Days')), ('start_time', wagtail.core.blocks.TimeBlock(verbose_name='Opening time')), ('end_time', wagtail.core.blocks.TimeBlock(verbose_name='Closing time'))]))], blank=True, verbose_name='Hours of operation'),
+            field=wagtail.fields.StreamField([('hours', wagtail.blocks.StructBlock([('days', wagtail.blocks.MultipleChoiceBlock(choices=[('Monday', 'Monday'), ('Tuesday', 'Tuesday'), ('Wednesday', 'Wednesday'), ('Thursday', 'Thursday'), ('Friday', 'Friday'), ('Saturday', 'Saturday'), ('Sunday', 'Sunday')], help_text='For late night hours past 23:59, define each day in a separate block.', verbose_name='Days')), ('start_time', wagtail.blocks.TimeBlock(verbose_name='Opening time')), ('end_time', wagtail.blocks.TimeBlock(verbose_name='Closing time'))]))], blank=True, verbose_name='Hours of operation'),
         ),
     ]

+ 2 - 2
coderedcms/migrations/0026_auto_20220513_1627.py

@@ -5,8 +5,8 @@ import coderedcms.blocks.html_blocks
 import coderedcms.fields
 from django.db import migrations
 import wagtail.contrib.table_block.blocks
-import wagtail.core.blocks
-import wagtail.core.fields
+import wagtail.blocks
+import wagtail.fields
 import wagtail.documents.blocks
 import wagtail.embeds.blocks
 import wagtail.images.blocks

+ 50 - 0
coderedcms/migrations/0031_wagtail3.py

@@ -0,0 +1,50 @@
+# Generated by Django 4.0.6 on 2022-07-29 19:27
+
+import coderedcms.fields
+import django.core.serializers.json
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('coderedcms', '0030_alter_coderedtag_tag'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='carouselslide',
+            name='content',
+            field=coderedcms.fields.CoderedStreamField(blank=True, use_json_field=True),
+        ),
+        migrations.AlterField(
+            model_name='coderedpage',
+            name='content_walls',
+            field=coderedcms.fields.CoderedStreamField(blank=True, use_json_field=True, verbose_name='Content Walls'),
+        ),
+        migrations.AlterField(
+            model_name='coderedsessionformsubmission',
+            name='form_data',
+            field=models.JSONField(encoder=django.core.serializers.json.DjangoJSONEncoder),
+        ),
+        migrations.AlterField(
+            model_name='contentwall',
+            name='content',
+            field=coderedcms.fields.CoderedStreamField(blank=True, use_json_field=True, verbose_name='Content'),
+        ),
+        migrations.AlterField(
+            model_name='footer',
+            name='content',
+            field=coderedcms.fields.CoderedStreamField(blank=True, use_json_field=True, verbose_name='Content'),
+        ),
+        migrations.AlterField(
+            model_name='navbar',
+            name='menu_items',
+            field=coderedcms.fields.CoderedStreamField(blank=True, use_json_field=True, verbose_name='Navigation links'),
+        ),
+        migrations.AlterField(
+            model_name='reusablecontent',
+            name='content',
+            field=coderedcms.fields.CoderedStreamField(blank=True, use_json_field=True, verbose_name='content'),
+        ),
+    ]

+ 2 - 2
coderedcms/models/integration_models.py

@@ -4,8 +4,8 @@ from django.template import Context, Template
 from django.template.loader import render_to_string
 from django.utils.translation import gettext_lazy as _
 
-from wagtail.admin.edit_handlers import FieldPanel
-from wagtail.core import hooks
+from wagtail.admin.panels import FieldPanel
+from wagtail import hooks
 
 from coderedcms.api.mailchimp import MailchimpApi
 

+ 37 - 19
coderedcms/models/page_models.py

@@ -39,24 +39,21 @@ from modelcluster.fields import ParentalKey, ParentalManyToManyField
 from modelcluster.tags import ClusterTaggableManager
 from pathlib import Path
 from taggit.models import TaggedItemBase
-from wagtail.admin.edit_handlers import (
+from wagtail.admin.panels import (
     FieldPanel,
     FieldRowPanel,
     InlinePanel,
     MultiFieldPanel,
     ObjectList,
-    PageChooserPanel,
-    StreamFieldPanel,
     TabbedInterface
 )
-from wagtail.core import hooks
-from wagtail.core.fields import StreamField
-from wagtail.core.models import Orderable, PageBase, Page, Site
-from wagtail.core.utils import resolve_model_string
-from wagtail.contrib.forms.edit_handlers import FormSubmissionsPanel
+from wagtail import hooks
+from wagtail.fields import StreamField
+from wagtail.models import Orderable, PageBase, Page, Site
+from wagtail.coreutils import resolve_model_string
+from wagtail.contrib.forms.panels import FormSubmissionsPanel
 from wagtail.contrib.forms.forms import WagtailAdminFormPageForm
 from wagtail.images import get_image_model_string
-from wagtail.images.edit_handlers import ImageChooserPanel
 from wagtail.contrib.forms.models import FormSubmission
 from wagtail.search import index
 from wagtail.utils.decorators import cached_classmethod
@@ -254,6 +251,7 @@ class CoderedPage(WagtailCacheMixin, SeoMixin, Page, metaclass=CoderedPageMeta):
             ('content_wall', ContentWallBlock())
         ],
         blank=True,
+        use_json_field=True,
         verbose_name=_('Content Walls')
     )
 
@@ -275,7 +273,7 @@ class CoderedPage(WagtailCacheMixin, SeoMixin, Page, metaclass=CoderedPageMeta):
     ###############
 
     content_panels = Page.content_panels + [
-        ImageChooserPanel('cover_image'),
+        FieldPanel('cover_image'),
     ]
 
     body_content_panels = []
@@ -309,7 +307,7 @@ class CoderedPage(WagtailCacheMixin, SeoMixin, Page, metaclass=CoderedPageMeta):
     promote_panels = SeoMixin.seo_meta_panels + SeoMixin.seo_struct_panels
 
     settings_panels = Page.settings_panels + [
-        StreamFieldPanel('content_walls'),
+        FieldPanel('content_walls'),
     ]
 
     integration_panels = []
@@ -355,7 +353,8 @@ class CoderedPage(WagtailCacheMixin, SeoMixin, Page, metaclass=CoderedPageMeta):
                 classname='integrations'
             ))
 
-        return TabbedInterface(panels).bind_to(model=cls)
+        edit_handler = TabbedInterface(panels)
+        return edit_handler.bind_to_model(cls)
 
     @property
     def seo_logo(self) -> "Optional[AbstractImage]":
@@ -520,7 +519,12 @@ class CoderedWebPage(CoderedPage):
 
     # Child pages should override based on what blocks they want in the body.
     # Default is LAYOUT_STREAMBLOCKS which is the fullest editor experience.
-    body = StreamField(LAYOUT_STREAMBLOCKS, null=True, blank=True)
+    body = StreamField(
+        LAYOUT_STREAMBLOCKS,
+        null=True,
+        blank=True,
+        use_json_field=True,
+    )
 
     # Search fields
     search_fields = (
@@ -530,7 +534,7 @@ class CoderedWebPage(CoderedPage):
 
     # Panels
     body_content_panels = [
-        StreamFieldPanel('body'),
+        FieldPanel('body'),
     ]
 
     @property
@@ -558,7 +562,12 @@ class CoderedArticlePage(CoderedWebPage):
     template = 'coderedcms/pages/article_page.html'
 
     # Override body to provide simpler content
-    body = StreamField(CONTENT_STREAMBLOCKS, null=True, blank=True)
+    body = StreamField(
+        CONTENT_STREAMBLOCKS,
+        null=True,
+        blank=True,
+        use_json_field=True,
+    )
 
     caption = models.CharField(
         max_length=255,
@@ -1141,7 +1150,7 @@ class CoderedFormMixin(models.Model):
     body_content_panels = [
         MultiFieldPanel(
             [
-                PageChooserPanel('thank_you_page'),
+                FieldPanel('thank_you_page'),
                 FieldPanel('button_text'),
                 FieldPanel('button_style'),
                 FieldPanel('button_size'),
@@ -1676,11 +1685,15 @@ class CoderedStreamFormPage(CoderedFormMixin, CoderedStreamFormMixin, CoderedWeb
     template = 'coderedcms/pages/stream_form_page.html'
     landing_page_template = 'coderedcms/pages/form_page_landing.html'
 
-    form_fields = StreamField(STREAMFORM_BLOCKS)
+    form_fields = StreamField(
+        STREAMFORM_BLOCKS,
+        use_json_field=True,
+    )
+
     encoder = StreamFormJSONEncoder
 
     body_content_panels = [
-        StreamFieldPanel('form_fields')
+        FieldPanel('form_fields')
     ] + \
         CoderedFormMixin.body_content_panels + [
             InlinePanel('confirmation_emails', label=_('Confirmation Emails'))
@@ -1726,7 +1739,12 @@ class CoderedLocationPage(CoderedWebPage):
     template = 'coderedcms/pages/location_page.html'
 
     # Override body to provide simpler content
-    body = StreamField(CONTENT_STREAMBLOCKS, null=True, blank=True)
+    body = StreamField(
+        CONTENT_STREAMBLOCKS,
+        null=True,
+        blank=True,
+        use_json_field=True,
+    )
 
     address = models.TextField(
         blank=True,

+ 18 - 11
coderedcms/models/snippet_models.py

@@ -7,13 +7,12 @@ from django.utils.text import slugify
 from django.utils.translation import gettext_lazy as _
 from modelcluster.fields import ParentalKey
 from modelcluster.models import ClusterableModel
-from wagtail.admin.edit_handlers import (
+from wagtail.admin.panels import (
     FieldPanel,
     InlinePanel,
     MultiFieldPanel,
-    StreamFieldPanel)
-from wagtail.core.models import Orderable
-from wagtail.images.edit_handlers import ImageChooserPanel
+)
+from wagtail.models import Orderable
 from wagtail.snippets.models import register_snippet
 from wagtail.images import get_image_model_string
 
@@ -126,15 +125,19 @@ class CarouselSlide(Orderable, models.Model):
         verbose_name=_('Custom ID'),
     )
 
-    content = CoderedStreamField(HTML_STREAMBLOCKS, blank=True)
+    content = CoderedStreamField(
+        HTML_STREAMBLOCKS,
+        blank=True,
+        use_json_field=True,
+    )
 
     panels = (
         [
-            ImageChooserPanel('image'),
+            FieldPanel('image'),
             FieldPanel('background_color'),
             FieldPanel('custom_css_class'),
             FieldPanel('custom_id'),
-            StreamFieldPanel('content'),
+            FieldPanel('content'),
         ]
     )
 
@@ -253,6 +256,7 @@ class Navbar(models.Model):
         NAVIGATION_STREAMBLOCKS,
         verbose_name=_('Navigation links'),
         blank=True,
+        use_json_field=True,
     )
 
     panels = [
@@ -264,7 +268,7 @@ class Navbar(models.Model):
             ],
             heading=_('Attributes')
         ),
-        StreamFieldPanel('menu_items')
+        FieldPanel('menu_items')
     ]
 
     def __str__(self):
@@ -297,6 +301,7 @@ class Footer(models.Model):
         LAYOUT_STREAMBLOCKS,
         verbose_name=_('Content'),
         blank=True,
+        use_json_field=True,
     )
 
     panels = [
@@ -308,7 +313,7 @@ class Footer(models.Model):
             ],
             heading=_('Attributes')
         ),
-        StreamFieldPanel('content')
+        FieldPanel('content')
     ]
 
     def __str__(self):
@@ -332,11 +337,12 @@ class ReusableContent(models.Model):
         LAYOUT_STREAMBLOCKS,
         verbose_name=_('content'),
         blank=True,
+        use_json_field=True,
     )
 
     panels = [
         FieldPanel('name'),
-        StreamFieldPanel('content')
+        FieldPanel('content')
     ]
 
     def __str__(self):
@@ -359,6 +365,7 @@ class ContentWall(models.Model):
         LAYOUT_STREAMBLOCKS,
         verbose_name=_('Content'),
         blank=True,
+        use_json_field=True,
     )
     is_dismissible = models.BooleanField(
         default=True,
@@ -379,7 +386,7 @@ class ContentWall(models.Model):
             ],
             heading=_('Content Wall')
         ),
-        StreamFieldPanel('content'),
+        FieldPanel('content'),
     ]
 
     def __str__(self):

+ 2 - 67
coderedcms/models/tests/test_navbars_and_footers.py

@@ -1,15 +1,6 @@
-# what imports do I need?
-# possibly use https://pypi.org/project/django-test-migrations/ instead?
-
-
 from django.test import Client
-
-# from django_test_migrations.contrib.unittest_case import MigratorTestCase
-# from django.db.migrations.executor import MigrationExecutor
-# from django.db import connection
-
-from wagtail.tests.utils import WagtailPageTests
-from wagtail.core.models import Site
+from wagtail.test.utils import WagtailPageTests
+from wagtail.models import Site
 
 from coderedcms.tests.testapp.models import WebPage
 from coderedcms.models.snippet_models import Footer, Navbar
@@ -137,59 +128,3 @@ class NavbarFooterTestCase(WagtailPageTests):
             status_code=200,
             html=True,
         )
-
-
-# # Set up
-# class TestMigrations(TestCase):
-#     @property
-#     def app(self):
-#         return apps.get_containing_app_config(type(self).__module__).name
-
-#     migrate_from = None
-#     migrate_to = None
-
-#     def setUp(self):
-#         assert self.migrate_from and self.migrate_to, \
-#         "TestCase '{}' must define migrate_from and
-#         migrate_to properties".format(type(self).__name__)
-#         self.migrate_from = [(self.app, self.migrate_from)]
-#         self.migrate_to = [(self.app, self.migrate_to)]
-#         executor = MigrationExecutor(connection)
-#         old_apps = executor.loader.project_state(self.migrate_from).apps
-
-#         # Reverse to the original migration
-#         executor.migrate(self.migrate_from)
-
-#         self.setUpBeforeMigration(old_apps)
-
-#         # Run the migration to test
-#         executor = MigrationExecutor(connection)
-#         executor.loader.build_graph()  # reload.
-#         executor.migrate(self.migrate_to)
-
-#         self.apps = executor.loader.project_state(self.migrate_to).apps
-
-
-# # Need to create Site that has navbar and footer the current way?
-# class NavsandFootersTestCase(TestMigrations):
-
-#     # migrate_from = '0024_analyticssettings'
-#     # migrate_to = '0025_multinavs.py'
-
-#     def setUpBeforeMigration(self, apps):
-#         # self.site = Site.objects.filter(is_default_site=True)[0]
-#         Navbar = apps.get_model('coderedcms', 'Navbar')
-#         Navbar.id = Navbar.objects.create(
-#             name="Main Nav",
-#             menu_items = StreamField([('external_link', 'item1'), ('external_link', 'item2') ])
-#             # menu_items = build content here
-#         )
-#         Footer = apps.get_model('coderedcms', 'Footer')
-#         Footer.id = Footer.objects.create(
-#             name="Main Footer",
-#             content=StreamField([('text', 'this is a footer')])
-#             # content = build content here
-#         )
-
-#    def t_navs_footers_migrated(self):
-#           NavbarOrderable = apps.get_model('coderedcms', 'NavbarOrderable')

+ 1 - 1
coderedcms/models/tests/test_page_models.py

@@ -1,5 +1,5 @@
 from django.test import Client
-from wagtail.tests.utils import WagtailPageTests
+from wagtail.test.utils import WagtailPageTests
 
 from coderedcms.models.page_models import (
     CoderedArticleIndexPage,

+ 2 - 2
coderedcms/models/tests/test_wagtailsettings_models.py

@@ -1,6 +1,6 @@
 from django.test import Client
-from wagtail.tests.utils import WagtailPageTests
-from wagtail.core.models import Site
+from wagtail.test.utils import WagtailPageTests
+from wagtail.models import Site
 
 from coderedcms.tests.testapp.models import WebPage
 from coderedcms.models.wagtailsettings_models import AnalyticsSettings

+ 6 - 8
coderedcms/models/wagtailsettings_models.py

@@ -8,10 +8,8 @@ from django.db import models
 from django.utils.translation import gettext_lazy as _
 from modelcluster.fields import ParentalKey
 from modelcluster.models import ClusterableModel
-from wagtail.admin.edit_handlers import FieldPanel, InlinePanel, HelpPanel, MultiFieldPanel
-from wagtail.core.models import Orderable
-from wagtail.images.edit_handlers import ImageChooserPanel
-from wagtail.snippets.edit_handlers import SnippetChooserPanel
+from wagtail.admin.panels import FieldPanel, InlinePanel, HelpPanel, MultiFieldPanel
+from wagtail.models import Orderable
 from wagtail.contrib.settings.models import BaseSetting, register_setting
 from wagtail.images import get_image_model_string
 from coderedcms.fields import MonospaceField
@@ -105,8 +103,8 @@ class LayoutSettings(ClusterableModel, BaseSetting):
     panels = [
         MultiFieldPanel(
             [
-                ImageChooserPanel('logo'),
-                ImageChooserPanel('favicon'),
+                FieldPanel('logo'),
+                FieldPanel('favicon'),
             ],
             heading=_('Branding')
         ),
@@ -183,7 +181,7 @@ class NavbarOrderable(Orderable, models.Model):
     )
 
     panels = [
-        SnippetChooserPanel("navbar")
+        FieldPanel("navbar")
     ]
 
 
@@ -201,7 +199,7 @@ class FooterOrderable(Orderable, models.Model):
     )
 
     panels = [
-        SnippetChooserPanel("footer")
+        FieldPanel("footer")
     ]
 
 

+ 2 - 2
coderedcms/project_template/basic/project_name/settings/base.py

@@ -46,7 +46,7 @@ INSTALLED_APPS = [
     'wagtail.documents',
     'wagtail.images',
     'wagtail.search',
-    'wagtail.core',
+    'wagtail',
     'wagtail.contrib.settings',
     'wagtail.contrib.modeladmin',
     'wagtail.contrib.table_block',
@@ -191,7 +191,7 @@ WAGTAILSEARCH_BACKENDS = {
 
 # Base URL to use when referring to full URLs within the Wagtail admin backend -
 # e.g. in notification emails. Don't include '/admin' or a trailing slash
-BASE_URL = 'http://{{ domain }}'
+WAGTAILADMIN_BASE_URL = 'http://{{ domain }}'
 
 
 # Bootstrap

File diff suppressed because it is too large
+ 4 - 4
coderedcms/project_template/basic/website/migrations/0001_initial.py


+ 1 - 1
coderedcms/project_template/basic/website/migrations/0002_initial_data.py

@@ -5,7 +5,7 @@ from __future__ import unicode_literals
 from django import VERSION as DJANGO_VERSION
 from django.db import migrations
 
-from wagtail.core.models import Locale
+from wagtail.models import Locale
 
 
 def initial_data(apps, schema_editor):

+ 2 - 2
coderedcms/project_template/sass/project_name/settings/base.py

@@ -45,7 +45,7 @@ INSTALLED_APPS = [
     'wagtail.documents',
     'wagtail.images',
     'wagtail.search',
-    'wagtail.core',
+    'wagtail',
     'wagtail.contrib.settings',
     'wagtail.contrib.modeladmin',
     'wagtail.contrib.table_block',
@@ -186,7 +186,7 @@ WAGTAILSEARCH_BACKENDS = {
 
 # Base URL to use when referring to full URLs within the Wagtail admin backend -
 # e.g. in notification emails. Don't include '/admin' or a trailing slash
-BASE_URL = 'http://{{ domain }}'
+WAGTAILADMIN_BASE_URL = 'http://{{ domain }}'
 
 
 # Bootstrap

File diff suppressed because it is too large
+ 4 - 4
coderedcms/project_template/sass/website/migrations/0001_initial.py


+ 1 - 1
coderedcms/project_template/sass/website/migrations/0002_initial_data.py

@@ -5,7 +5,7 @@ from __future__ import unicode_literals
 from django import VERSION as DJANGO_VERSION
 from django.db import migrations
 
-from wagtail.core.models import Locale
+from wagtail.models import Locale
 
 
 def initial_data(apps, schema_editor):

+ 13 - 146
coderedcms/static/coderedcms/css/codered-admin.css

@@ -4,149 +4,23 @@ Copyright 2018-2022 CodeRed LLC
 License: https://github.com/coderedcorp/coderedcms/blob/dev/LICENSE
 */
 
+
 /* Font sizes and inputs */
 
-code, pre, textarea.monospace,
+code,
+pre,
+textarea.monospace,
 .monospace textarea {
-    font-family: SFMono-Regular,Menlo,Monaco,Consolas,monospace;
-}
-
-.content-wrapper {
-    background-color:unset;
-    border:unset;
-}
-
-.halloeditor, .tagit, input:not([type="submit"]), select, textarea {
-    padding-top:0.5em;
-    padding-bottom:0.5em;
-    font-weight:normal;
-}
-
-input[type='checkbox'], input[type='radio'] {
-    margin-right: 0.5em;
-    padding-top: 0;
-}
-.date_field .input::after,
-.date_field .input::before,
-.date_time_field .input::after,
-.date_time_field .input::before,
-.iconfield .input::after,
-.iconfield .input::before,
-.time_field .input::after,
-.time_field .input::before,
-.url_field .input::after,
-.url_field .input::before {
-    font-size:1.7em;
-    top:0.35em;
-}
-.choice_field .input select,
-.model_choice_field .input select,
-.typed_choice_field .input select {
-    margin-right:-3em;
-    padding-right: 3em;
-}
-.choice_field .input select ~ span:after,
-.model_choice_field .input select ~ span:after,
-.typed_choice_field .input select ~ span:after {
-    font-size:2.2em !important;
-    right:unset;
-}
-
-.field-content {
-    width:100%;
-}
-
-.field-row {
-    margin-bottom: 0;
+  font-family: var(--w-font-mono);
+  font-weight: normal;
 }
 
-
-/* Display labels and fields horizontally, except .label-above or nested .stream-field */
-
-@media screen and (min-width:50em) {
-    body:not(.login) .c-sf-block .fields > li,
-    body:not(.login) ul.fields > li:not(.label-above) .field {
-        display: flex;
-        flex-direction: row;
-        flex-wrap: wrap;
-        align-items: flex-start;
-        justify-content: flex-start;
-    }
-    body:not(.login) ul.fields > li:not(.label-above) ul.fields > li > label,
-    body:not(.login) ul.fields > li:not(.label-above) .field > label,
-    body:not(.login) .field-content ul > li:not(.label-above) > label {
-        color:inherit;
-        font-weight:normal;
-        display:block;
-        float:none;
-        margin: 0;
-        width: auto;
-    }
-    /* Labels for page editor forms */
-    body:not(.login) ul.fields > li:not(.label-above) .field > label {
-        width:20%;
-        max-width:15em;
-    }
-    /* (undo previous rule for nested streamfields) */
-    body:not(.login) ul.fields > li.stream-field > .field > label {
-        width: 100%;
-        max-width: unset;
-    }
-
-    /* Fields for page editor forms */
-    li.codered-collapsible label+.field,
-    body:not(.login) ul.fields > li:not(.label-above) label+.field-content,
-    body:not(.login) ul.fields > li:not(.label-above) label+.field {
-        display:block;
-        flex-grow: 1;
-        float:none;
-        margin: 0 auto;
-        width: 80%;
-    }
-    /* (undo previous rule in nested streamfields) */
-    body:not(.login) ul.fields > li.stream-field > .field > label+.field-content,
-    body:not(.login) ul.fields > li.stream-field > .field > label+.field {
-        width: 100%;
-    }
-
-    /* Labels for streamfield forms (except labels for nested streamfields) */
-    body:not(.login) ul.fields > li:not(.label-above) ul.fields > li > label,
-    body:not(.login) ul.fields > li:not(.label-above) ul.fields > li > .label,
-    body:not(.login) .struct-block ul.fields > li:not(.label-above) .field > label,
-    body:not(.login) .multiple     ul.fields > li:not(.label-above) .field > label {
-        width:20%;
-        max-width:15em;
-    }
-    /* Fields for streamfield forms (except nested streamfields) */
-    body:not(.login) ul.fields > li:not(.label-above) ul.fields > li > .field,
-    body:not(.login) ul.fields > li:not(.label-above) ul.fields > li > .field
-    body:not(.login) .struct-block ul.fields > li:not(.label-above) .field > .field,
-    body:not(.login) .multiple     ul.fields > li:not(.label-above) .field > .field {
-        width: 80%;
-    }
-    .object.full .field-content {
-        flex-grow: 1;
-        margin: 0 auto;
-    }
-    .input {
-        width:100%;
-    }
+.input input[type='color']{
+    height: 40px;
+    padding: 5px;
 }
 
 
-/* General layout */
-
-.content {
-    padding-bottom:100px;
-}
-
-.responsive-img {
-    width: 100%;
-    height: auto;
-    margin-left: auto;
-    margin-right: auto;
-}
-
 /* Show the site's custom logo in the wagtail admin */
 
 .codered-logo-custom {
@@ -157,10 +31,11 @@ input[type='checkbox'], input[type='radio'] {
     display: block;
 }
 .codered-logo-container {
-    box-sizing: border-box;
+  box-sizing: border-box;
+  margin: 0 15px;
 }
 .codered-logo-container.navbar-light {
-    background-color: #f1f1f1;
+    background-color: #fff;
     border-radius: 6px;
     padding: 0.25em;
 }
@@ -173,16 +48,8 @@ input[type='checkbox'], input[type='radio'] {
 
 .codered-banner {
     position: absolute;
+    z-index: 1;
 }
 .codered-banner ~ .content-wrapper {
     padding-top: calc(1.5em + 8px);
 }
-
-/* Custom */
-
-.button-advanced-settings {
-    display:block;
-    font-size:0.8em;
-    margin-top: -20px;
-    align-self: flex-start;
-}

+ 4 - 86
coderedcms/static/coderedcms/css/codered-editor.css

@@ -4,99 +4,17 @@ Copyright 2018-2022 CodeRed LLC
 License: https://github.com/coderedcorp/coderedcms/blob/dev/LICENSE
 */
 
-/* Inputs and form fields */
-
-.c-sf-button {
-    max-width: 200px;
-}
-
-.input input,
-.input select {
-    max-width: 300px;
-}
-.input textarea,
-.full .input input {
-    width: 100%;
-    max-width: 100%;
-}
-.input input[type='color']{
-    height: 40px;
-    padding: 5px;
-}
-
-
-/* Override and enhance the streamfield editor to support our deeply nested streamfields. */
-
-.c-sf-block {
-    display: block;
-}
-
-.c-sf-block:hover,
-.c-sf-block:focus {
-    box-shadow: 0 0 20px rgba(0,0,0,0.2) !important;
-}
-
-.c-sf-add-panel,
-.c-sf-container {
-    padding: 0 !important;
-    width:100%;
-    flex-basis: 100%;
-}
-
-.field.char_field.widget-draftail_rich_text_area .field-content,
-.field.char_field.widget-textarea .field-content {
-    width:100%;
-    max-width:100%;
-}
-
-.sequence-controls {
-    border: none;
-    background-color: transparent;
-    top: unset;
-}
-.sequence-controls h3 label {
-    font-weight: bold;
-}
-
-.tab-content {
-    width: 100%;
-}
-
-.object.stream-field {
-    background-color: inherit;;
-}
-
-.object .multiple {
-    width:100%;
-    max-width:100%;
-}
-
-.object fieldset {
-    width:100%;
-    max-width:100%;
-}
-.object > fieldset {
-    padding-top:6em;
-}
-.object > fieldset fieldset {
-    padding-top:0;
-}
-
-.fields > li, .field-col {
-    padding-bottom:0.5em;
-}
-
-
-
-/* Custom */
 
 .codered-collapsible {
     padding:0;
+    margin-top: -40px;
 }
-
 .codered-collapsible .codered-collapsible-target {
     padding: 10px 0 0;
 }
+.codered-collapsible > button {
+    max-width: 140px;
+}
 
 .codered-checkbox-group {
     margin-bottom: 1em;

+ 1 - 1
coderedcms/templates/coderedcms/widgets/checkbox_classifiers.html

@@ -5,7 +5,7 @@
         {% if group %}
         <div class="field-col col4">
         <ul class="codered-checkbox-group">
-            <li><strong>{{ group }}</strong>
+            <li><label>{{ group }}</label>
         {% endif %}
         <ul{% if id %} id="{{ id }}_{{ index }}"{% endif %}>
         {% for option in options %}

+ 11 - 11
coderedcms/templates/wagtailadmin/block_forms/base_block_settings_struct.html

@@ -1,17 +1,17 @@
 {% load wagtailadmin_tags  %}
 
 <div class="{{ classname }} codered-collapsible collapsed c-sf-container">
-    <button type="button" class="button button-small button-advanced-settings">
-        <i class="icon icon-fa-cog" aria-hidden="true"></i> Advanced Settings
-    </button>
-    <div class="codered-collapsible-target" style="display:none;">
+  <button type="button" class="button button-small">
+    <i class="icon icon-fa-cog" aria-hidden="true"></i> Advanced Settings
+  </button>
+  <div class="codered-collapsible-target" style="display:none;">
     {% for child in children.values %}
-        <div class="field {% if child.block.required %}required{% endif %}" data-contentpath="{{ child.block.name }}">
-            {% if child.block.label %}
-                <label class="field__label" {% if child.id_for_label %}for="{{ child.id_for_label }}"{% endif %}>{{ child.block.label }}</label>
-            {% endif %}
-            {{ child.render_form }}
-        </div>
-    {% endfor %}
+    <div class="field {% if child.block.required %}required{% endif %}" data-contentpath="{{ child.block.name }}">
+      {% if child.block.label %}
+      <label class="field__label" {% if child.id_for_label %}for="{{ child.id_for_label }}"{% endif %}>{{ child.block.label }}</label>
+      {% endif %}
+      {{ child.render_form }}
     </div>
+    {% endfor %}
+  </div>
 </div>

+ 1 - 1
coderedcms/templatetags/coderedcms_tags.py

@@ -6,7 +6,7 @@ from django import template
 from django.db.models.query import QuerySet
 from django.forms import ClearableFileInput
 from django.utils.html import mark_safe
-from wagtail.core.models import Collection
+from wagtail.models import Collection
 from wagtail.images.models import Image
 
 from coderedcms import utils, __version__

+ 2 - 2
coderedcms/tests/settings.py

@@ -47,7 +47,7 @@ INSTALLED_APPS = [
     'wagtail.documents',
     'wagtail.images',
     'wagtail.search',
-    'wagtail.core',
+    'wagtail',
     'wagtail.contrib.settings',
     'wagtail.contrib.modeladmin',
     'wagtail.contrib.table_block',
@@ -189,7 +189,7 @@ WAGTAILSEARCH_BACKENDS = {
 
 # Base URL to use when referring to full URLs within the Wagtail admin backend -
 # e.g. in notification emails. Don't include '/admin' or a trailing slash
-BASE_URL = ''
+WAGTAILADMIN_BASE_URL = ''
 
 
 # Bootstrap

+ 1 - 1
coderedcms/tests/test_urls.py

@@ -9,7 +9,7 @@ from django.test import Client
 from django.test.utils import override_settings
 from django.utils import timezone
 
-from wagtail.core.models import Site, Page
+from wagtail.models import Site, Page
 from wagtail.images.tests.utils import Image, get_test_image_file
 
 from coderedcms.models import LayoutSettings

+ 1 - 1
coderedcms/tests/testapp/migrations/0002_initial.py

@@ -5,7 +5,7 @@ from __future__ import unicode_literals
 from django import VERSION as DJANGO_VERSION
 from django.db import migrations
 
-from wagtail.core.models import Locale
+from wagtail.models import Locale
 
 
 def initial_data(apps, schema_editor):

File diff suppressed because it is too large
+ 2 - 2
coderedcms/tests/testapp/migrations/0003_eventindexpage_eventoccurrence_eventpage_locationindexpage_locationpage.py


File diff suppressed because it is too large
+ 2 - 2
coderedcms/tests/testapp/migrations/0004_streamformconfirmemail_streamformpage.py


File diff suppressed because it is too large
+ 2 - 2
coderedcms/tests/testapp/migrations/0005_auto_20210908_1741.py


+ 1 - 1
coderedcms/urls.py

@@ -1,6 +1,6 @@
 from django.urls import include, path, re_path
 from wagtail.contrib.sitemaps.views import sitemap
-from wagtail.core import urls as wagtailcore_urls
+from wagtail import urls as wagtailcore_urls
 from coderedcms.settings import crx_settings
 from coderedcms.views import (
     event_generate_ical_for_calendar,

+ 1 - 1
coderedcms/views.py

@@ -11,7 +11,7 @@ from django.utils.translation import ngettext, gettext_lazy as _
 from django.views.decorators.http import require_POST
 from icalendar import Calendar
 from wagtail.admin import messages
-from wagtail.core.models import Page, get_page_models
+from wagtail.models import Page, get_page_models
 from coderedcms import utils
 from coderedcms.forms import SearchForm
 from coderedcms.models import (

+ 1 - 1
coderedcms/wagtail_flexible_forms/blocks.py

@@ -4,7 +4,7 @@ from django.utils.dateparse import parse_datetime
 from django.utils.text import slugify
 from django.utils.translation import gettext_lazy as _
 from anyascii import anyascii
-from wagtail.core.blocks import (
+from wagtail.blocks import (
     StructBlock, TextBlock, CharBlock, BooleanBlock, ListBlock, StreamBlock,
     DateBlock, TimeBlock, DateTimeBlock, ChoiceBlock, RichTextBlock,
 )

+ 1 - 1
coderedcms/wagtail_flexible_forms/edit_handlers.py

@@ -2,7 +2,7 @@ from django.template.loader import render_to_string
 from django.utils.safestring import mark_safe
 from django.utils.translation import gettext as _
 
-from wagtail.admin.edit_handlers import EditHandler
+from wagtail.admin.panels import EditHandler
 
 
 class FormSubmissionsPanel(EditHandler):

+ 1 - 1
coderedcms/wagtail_flexible_forms/models.py

@@ -27,7 +27,7 @@ from django.template.response import TemplateResponse
 from django.utils.safestring import SafeData, mark_safe
 from django.utils.timezone import now
 from django.utils.translation import gettext_lazy as _
-from wagtail.core.models import Page
+from wagtail.models import Page
 from wagtail.contrib.forms.models import (
     AbstractForm, AbstractEmailForm, AbstractFormSubmission)
 

+ 2 - 2
coderedcms/wagtail_flexible_forms/wagtail_hooks.py

@@ -9,8 +9,8 @@ from wagtail.contrib.modeladmin.helpers import (
 from wagtail.contrib.modeladmin.options import ModelAdmin
 from wagtail.contrib.modeladmin.views import IndexView, InstanceSpecificView
 from wagtail.admin import messages
-from wagtail.core import hooks
-from wagtail.core.models import Page
+from wagtail import hooks
+from wagtail.models import Page
 from wagtail.contrib.forms.utils import get_forms_for_user
 
 from .models import SessionFormSubmission

+ 2 - 2
coderedcms/wagtail_hooks.py

@@ -7,8 +7,8 @@ from django.urls import reverse
 from django.utils.html import format_html
 from django.utils.translation import gettext_lazy as _
 from wagtail.admin.menu import MenuItem
-from wagtail.core import hooks
-from wagtail.core.models import UserPagePermissionsProxy, get_page_models
+from wagtail import hooks
+from wagtail.models import UserPagePermissionsProxy, get_page_models
 from wagtailcache.cache import clear_cache
 
 from coderedcms import __version__

+ 1 - 1
docs/advanced/advanced02.rst

@@ -245,7 +245,7 @@ for that information. We do, however, need a few fields.
         # Add custom fields to the body
         body_content_panels = CoderedWebPage.body_content_panels + [
             FieldPanel("description"),
-            ImageChooserPanel("photo"),
+            FieldPanel("photo"),
             FieldPanel("days_available"),
         ]
 

+ 1 - 1
docs/how_to/translation.rst

@@ -53,7 +53,7 @@ model in ``website/models.py``:
     class WebPage(CoderedWebPage):
         body_content_panels = []
         content_panels = CodredWebPage.content_panels + [
-            StreamFieldPanel('body'),
+            FieldPanel('body'),
         ]
 
 

+ 3 - 3
setup.py

@@ -49,9 +49,9 @@ setup(
         'Django>=3.2,<4.1',             # should be the same as wagtail
         'geocoder==1.38.*',
         'icalendar==4.1.*',
-        'wagtail==2.16.*',
-        'wagtail-cache==1.*',
-        'wagtail-seo==1.*',
+        'wagtail==3.*',
+        'wagtail-cache==2.*',
+        'wagtail-seo==2.*',
     ],
     entry_points={
         "console_scripts": [

+ 1 - 1
tutorial/mysite/mysite/settings/base.py

@@ -190,7 +190,7 @@ WAGTAILSEARCH_BACKENDS = {
 
 # Base URL to use when referring to full URLs within the Wagtail admin backend -
 # e.g. in notification emails. Don't include '/admin' or a trailing slash
-BASE_URL = 'http://localhost'
+WAGTAILADMIN_BASE_URL = 'http://localhost'
 
 
 # Bootstrap

File diff suppressed because it is too large
+ 4 - 6
tutorial/mysite/website/migrations/0001_initial.py


+ 1 - 1
tutorial/mysite/website/models.py

@@ -145,6 +145,6 @@ class CupcakesPage(CoderedWebPage):
     # Add custom fields to the body
     body_content_panels = CoderedWebPage.body_content_panels + [
         FieldPanel("description"),
-        ImageChooserPanel("photo"),
+        FieldPanel("photo"),
         FieldPanel("days_available"),
     ]

Some files were not shown because too many files changed in this diff