diff --git a/about/__pycache__/models.cpython-310.pyc b/about/__pycache__/models.cpython-310.pyc index 6dcc3881..5df5ad67 100644 Binary files a/about/__pycache__/models.cpython-310.pyc and b/about/__pycache__/models.cpython-310.pyc differ diff --git a/about/migrations/0004_remove_aboutpage_section_two_img_and_more.py b/about/migrations/0004_remove_aboutpage_section_two_img_and_more.py new file mode 100644 index 00000000..eaa74784 --- /dev/null +++ b/about/migrations/0004_remove_aboutpage_section_two_img_and_more.py @@ -0,0 +1,44 @@ +# Generated by Django 5.0.8 on 2024-09-16 12:57 + +import django.db.models.deletion +import modelcluster.fields +import wagtail.fields +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('about', '0003_rename_af1img_aboutpage_section_one_img_and_more'), + ('wagtailimages', '0026_delete_uploadedimage'), + ] + + operations = [ + migrations.RemoveField( + model_name='aboutpage', + name='section_two_img', + ), + migrations.RemoveField( + model_name='aboutpage', + name='section_two_text', + ), + migrations.RemoveField( + model_name='aboutpage', + name='section_two_title', + ), + migrations.CreateModel( + name='AboutPageSections', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sort_order', models.IntegerField(blank=True, editable=False, null=True)), + ('section_title', wagtail.fields.RichTextField(blank=True)), + ('section_text', wagtail.fields.RichTextField(blank=True)), + ('page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='sections_about', to='about.aboutpage')), + ('section_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image')), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + ), + ] diff --git a/about/migrations/0005_rename_section_one_img_aboutpage_intro_image_and_more.py b/about/migrations/0005_rename_section_one_img_aboutpage_intro_image_and_more.py new file mode 100644 index 00000000..6b1d91ca --- /dev/null +++ b/about/migrations/0005_rename_section_one_img_aboutpage_intro_image_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 5.0.8 on 2024-09-16 12:58 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('about', '0004_remove_aboutpage_section_two_img_and_more'), + ] + + operations = [ + migrations.RenameField( + model_name='aboutpage', + old_name='section_one_img', + new_name='intro_image', + ), + migrations.RenameField( + model_name='aboutpage', + old_name='section_one_text', + new_name='intro_text', + ), + migrations.RenameField( + model_name='aboutpage', + old_name='section_one_title', + new_name='intro_title', + ), + ] diff --git a/about/migrations/0006_aboutpage_section_one_image_and_more.py b/about/migrations/0006_aboutpage_section_one_image_and_more.py new file mode 100644 index 00000000..bca51e0b --- /dev/null +++ b/about/migrations/0006_aboutpage_section_one_image_and_more.py @@ -0,0 +1,32 @@ +# Generated by Django 5.0.8 on 2024-09-16 13:54 + +import wagtail.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('about', '0005_rename_section_one_img_aboutpage_intro_image_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='aboutpage', + name='section_one_image', + field=wagtail.fields.RichTextField(blank=True), + ), + migrations.AddField( + model_name='aboutpage', + name='section_one_text', + field=wagtail.fields.RichTextField(blank=True), + ), + migrations.AddField( + model_name='aboutpage', + name='section_one_title', + field=wagtail.fields.RichTextField(blank=True), + ), + migrations.DeleteModel( + name='AboutPageSections', + ), + ] diff --git a/about/migrations/__pycache__/0004_remove_aboutpage_section_two_img_and_more.cpython-310.pyc b/about/migrations/__pycache__/0004_remove_aboutpage_section_two_img_and_more.cpython-310.pyc new file mode 100644 index 00000000..f31a0620 Binary files /dev/null and b/about/migrations/__pycache__/0004_remove_aboutpage_section_two_img_and_more.cpython-310.pyc differ diff --git a/about/migrations/__pycache__/0005_rename_section_one_img_aboutpage_intro_image_and_more.cpython-310.pyc b/about/migrations/__pycache__/0005_rename_section_one_img_aboutpage_intro_image_and_more.cpython-310.pyc new file mode 100644 index 00000000..b3778a33 Binary files /dev/null and b/about/migrations/__pycache__/0005_rename_section_one_img_aboutpage_intro_image_and_more.cpython-310.pyc differ diff --git a/about/migrations/__pycache__/0006_aboutpage_section_one_image_and_more.cpython-310.pyc b/about/migrations/__pycache__/0006_aboutpage_section_one_image_and_more.cpython-310.pyc new file mode 100644 index 00000000..1c96bc57 Binary files /dev/null and b/about/migrations/__pycache__/0006_aboutpage_section_one_image_and_more.cpython-310.pyc differ diff --git a/about/models.py b/about/models.py index 38f64098..67f9f2dd 100644 --- a/about/models.py +++ b/about/models.py @@ -10,25 +10,25 @@ from saburly.custom_editor import FULL_EDITOR class AboutPage(Page): + intro_title = RichTextField(blank=True, features=FULL_EDITOR) + intro_text = RichTextField(blank=True, features=FULL_EDITOR) + intro_image = RichTextField(blank=True, features=FULL_EDITOR) + section_one_title = RichTextField(blank=True, features=FULL_EDITOR) section_one_text = RichTextField(blank=True, features=FULL_EDITOR) - section_one_img = RichTextField(blank=True, features=FULL_EDITOR) - - section_two_title = RichTextField(blank=True, features=FULL_EDITOR) - section_two_text = RichTextField(blank=True, features=FULL_EDITOR) - section_two_img = RichTextField(blank=True, features=FULL_EDITOR) + section_one_image = RichTextField(blank=True, features=FULL_EDITOR) content_panels = Page.content_panels + [ MultiFieldPanel([ - FieldPanel('section_one_title', classname="full"), - FieldPanel('section_one_text', classname="full"), - FieldPanel('section_one_img', classname="full"), - ], heading="Section One"), + FieldPanel('intro_title', classname="full"), + FieldPanel('intro_text', classname="full"), + FieldPanel('intro_image', classname="full"), + ], heading="Intro"), MultiFieldPanel([ - FieldPanel('section_two_title', classname="full"), - FieldPanel('section_two_text', classname="full"), - FieldPanel('section_two_img', classname="full"), - ], heading="Section Two"), + FieldPanel('section_one_title', classname="full"), + FieldPanel('section_one_text', classname="full"), + FieldPanel('section_one_image', classname="full"), + ], heading="Section One"), ] diff --git a/db.sqlite3 b/db.sqlite3 index fb9be894..0957e52c 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/home/__pycache__/models.cpython-310.pyc b/home/__pycache__/models.cpython-310.pyc index b7c75be0..7b07c62f 100644 Binary files a/home/__pycache__/models.cpython-310.pyc and b/home/__pycache__/models.cpython-310.pyc differ diff --git a/home/migrations/0006_rename_section_one_img_homepage_intro_image_and_more.py b/home/migrations/0006_rename_section_one_img_homepage_intro_image_and_more.py new file mode 100644 index 00000000..70d0f4e7 --- /dev/null +++ b/home/migrations/0006_rename_section_one_img_homepage_intro_image_and_more.py @@ -0,0 +1,47 @@ +# Generated by Django 5.0.8 on 2024-09-16 12:36 + +import django.db.models.deletion +import modelcluster.fields +import wagtail.fields +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('home', '0005_rename_hf4img_homepage_section_five_img_and_more'), + ('wagtailimages', '0026_delete_uploadedimage'), + ] + + operations = [ + migrations.RenameField( + model_name='homepage', + old_name='section_one_img', + new_name='intro_image', + ), + migrations.RenameField( + model_name='homepage', + old_name='section_one_text', + new_name='intro_text', + ), + migrations.RenameField( + model_name='homepage', + old_name='section_one_title', + new_name='intro_title', + ), + migrations.CreateModel( + name='HomePageSections', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sort_order', models.IntegerField(blank=True, editable=False, null=True)), + ('section_title', wagtail.fields.RichTextField(blank=True)), + ('section_text', wagtail.fields.RichTextField(blank=True)), + ('page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='homepage_sections', to='home.homepage')), + ('section_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image')), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + ), + ] diff --git a/home/migrations/0007_remove_homepage_section_five_img_and_more.py b/home/migrations/0007_remove_homepage_section_five_img_and_more.py new file mode 100644 index 00000000..97581017 --- /dev/null +++ b/home/migrations/0007_remove_homepage_section_five_img_and_more.py @@ -0,0 +1,61 @@ +# Generated by Django 5.0.8 on 2024-09-16 12:39 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('home', '0006_rename_section_one_img_homepage_intro_image_and_more'), + ] + + operations = [ + migrations.RemoveField( + model_name='homepage', + name='section_five_img', + ), + migrations.RemoveField( + model_name='homepage', + name='section_five_text', + ), + migrations.RemoveField( + model_name='homepage', + name='section_five_title', + ), + migrations.RemoveField( + model_name='homepage', + name='section_four_img', + ), + migrations.RemoveField( + model_name='homepage', + name='section_four_text', + ), + migrations.RemoveField( + model_name='homepage', + name='section_four_title', + ), + migrations.RemoveField( + model_name='homepage', + name='section_three_img', + ), + migrations.RemoveField( + model_name='homepage', + name='section_three_text', + ), + migrations.RemoveField( + model_name='homepage', + name='section_three_title', + ), + migrations.RemoveField( + model_name='homepage', + name='section_two_img', + ), + migrations.RemoveField( + model_name='homepage', + name='section_two_text', + ), + migrations.RemoveField( + model_name='homepage', + name='section_two_title', + ), + ] diff --git a/home/migrations/0008_alter_homepagesections_id.py b/home/migrations/0008_alter_homepagesections_id.py new file mode 100644 index 00000000..9c9269a9 --- /dev/null +++ b/home/migrations/0008_alter_homepagesections_id.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.8 on 2024-09-16 13:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('home', '0007_remove_homepage_section_five_img_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='homepagesections', + name='id', + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'), + ), + ] diff --git a/home/migrations/__pycache__/0006_rename_section_one_img_homepage_intro_image_and_more.cpython-310.pyc b/home/migrations/__pycache__/0006_rename_section_one_img_homepage_intro_image_and_more.cpython-310.pyc new file mode 100644 index 00000000..e399f09c Binary files /dev/null and b/home/migrations/__pycache__/0006_rename_section_one_img_homepage_intro_image_and_more.cpython-310.pyc differ diff --git a/home/migrations/__pycache__/0007_remove_homepage_section_five_img_and_more.cpython-310.pyc b/home/migrations/__pycache__/0007_remove_homepage_section_five_img_and_more.cpython-310.pyc new file mode 100644 index 00000000..a4c5d89e Binary files /dev/null and b/home/migrations/__pycache__/0007_remove_homepage_section_five_img_and_more.cpython-310.pyc differ diff --git a/home/migrations/__pycache__/0008_alter_homepagesections_id.cpython-310.pyc b/home/migrations/__pycache__/0008_alter_homepagesections_id.cpython-310.pyc new file mode 100644 index 00000000..267bc14d Binary files /dev/null and b/home/migrations/__pycache__/0008_alter_homepagesections_id.cpython-310.pyc differ diff --git a/home/models.py b/home/models.py index 573288f3..25675ab1 100644 --- a/home/models.py +++ b/home/models.py @@ -2,62 +2,45 @@ from __future__ import unicode_literals from django.db import models -from wagtail.models import Page +from wagtail.models import Page, Orderable from wagtail.fields import RichTextField -from wagtail.admin.panels import FieldPanel, MultiFieldPanel +from wagtail.admin.panels import FieldPanel, MultiFieldPanel, InlinePanel +from modelcluster.models import ParentalKey from saburly.custom_editor import FULL_EDITOR class HomePage(Page): + intro_title = RichTextField(blank=True, features=FULL_EDITOR) + intro_text = RichTextField(blank=True, features=FULL_EDITOR) + intro_image = RichTextField(blank=True, features=FULL_EDITOR) - section_one_title = RichTextField(blank=True, features=FULL_EDITOR) - section_one_text = RichTextField(blank=True, features=FULL_EDITOR) - section_one_img = RichTextField(blank=True, features=FULL_EDITOR) - - section_two_title = RichTextField(blank=True, features=FULL_EDITOR) - section_two_text = RichTextField(blank=True, features=FULL_EDITOR) - section_two_img = RichTextField(blank=True, features=FULL_EDITOR) - - section_three_title = RichTextField(blank=True, features=FULL_EDITOR) - section_three_text = RichTextField(blank=True, features=FULL_EDITOR) - section_three_img = RichTextField(blank=True, features=FULL_EDITOR) - - section_four_title = RichTextField(blank=True, features=FULL_EDITOR) - section_four_text = RichTextField(blank=True, features=FULL_EDITOR) - section_four_img = RichTextField(blank=True, features=FULL_EDITOR) - - section_five_title = RichTextField(blank=True, features=FULL_EDITOR) - section_five_text = RichTextField(blank=True, features=FULL_EDITOR) - section_five_img = RichTextField(blank=True, features=FULL_EDITOR) content_panels = Page.content_panels + [ MultiFieldPanel([ - FieldPanel('section_one_title', classname="full"), - FieldPanel('section_one_text', classname="full"), - FieldPanel('section_one_img', classname="full"), - ], heading="Section One"), + FieldPanel('intro_title', classname="full"), + FieldPanel('intro_text', classname="full"), + FieldPanel('intro_image', classname="full"), + ], heading="Intro Section"), + InlinePanel('homepage_sections', heading="Sections Home", label="Sections Home"), - MultiFieldPanel([ - FieldPanel('section_two_title', classname="full"), - FieldPanel('section_two_text', classname="full"), - FieldPanel('section_two_img', classname="full"), - ], heading="Section Two"), - - MultiFieldPanel([ - FieldPanel('section_three_title', classname="full"), - FieldPanel('section_three_text', classname="full"), - FieldPanel('section_three_img', classname="full"), - ], heading="Section Three"), - - MultiFieldPanel([ - FieldPanel('section_four_title', classname="full"), - FieldPanel('section_four_text', classname="full"), - FieldPanel('section_four_img', classname="full"), - ], heading="Section Four"), - - MultiFieldPanel([ - FieldPanel('section_five_title', classname="full"), - FieldPanel('section_five_text', classname="full"), - FieldPanel('section_five_img', classname="full"), - ], heading="Section Five"), + ] + + +class HomePageSections(Orderable): + page = ParentalKey(HomePage, on_delete=models.CASCADE, related_name='homepage_sections') + + section_title = RichTextField(blank=True, features=FULL_EDITOR) + section_text = RichTextField(blank=True, features=FULL_EDITOR) + section_image = models.ForeignKey( + 'wagtailimages.Image', + null=True, + blank=True, + on_delete=models.SET_NULL, + related_name='+' + ) + + panels = [ + FieldPanel('section_title'), + FieldPanel('section_text'), + FieldPanel('section_image'), ] diff --git a/saburly/settings/__pycache__/base.cpython-310.pyc b/saburly/settings/__pycache__/base.cpython-310.pyc index 5cd8a909..c12fb3a1 100644 Binary files a/saburly/settings/__pycache__/base.cpython-310.pyc and b/saburly/settings/__pycache__/base.cpython-310.pyc differ diff --git a/saburly/settings/base.py b/saburly/settings/base.py index c029f49c..9cd029e0 100644 --- a/saburly/settings/base.py +++ b/saburly/settings/base.py @@ -97,6 +97,8 @@ DATABASES = { } } +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + # Password validation # https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators diff --git a/services/__pycache__/models.cpython-310.pyc b/services/__pycache__/models.cpython-310.pyc index d079c71e..fd75cf8d 100644 Binary files a/services/__pycache__/models.cpython-310.pyc and b/services/__pycache__/models.cpython-310.pyc differ diff --git a/services/migrations/0006_servicespagesections.py b/services/migrations/0006_servicespagesections.py new file mode 100644 index 00000000..0851bf53 --- /dev/null +++ b/services/migrations/0006_servicespagesections.py @@ -0,0 +1,31 @@ +# Generated by Django 5.0.8 on 2024-09-15 18:45 + +import django.db.models.deletion +import modelcluster.fields +import wagtail.fields +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('services', '0005_rename_carouse_image_servicespagecarousel_carousel_image_and_more'), + ] + + operations = [ + migrations.CreateModel( + name='ServicesPageSections', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sort_order', models.IntegerField(blank=True, editable=False, null=True)), + ('section_title', wagtail.fields.RichTextField(blank=True)), + ('section_text', wagtail.fields.RichTextField(blank=True)), + ('section_image', wagtail.fields.RichTextField(blank=True)), + ('page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='sections_services', to='services.servicespage')), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + ), + ] diff --git a/services/migrations/0007_alter_servicespagesections_section_image.py b/services/migrations/0007_alter_servicespagesections_section_image.py new file mode 100644 index 00000000..8fb046a2 --- /dev/null +++ b/services/migrations/0007_alter_servicespagesections_section_image.py @@ -0,0 +1,20 @@ +# Generated by Django 5.0.8 on 2024-09-16 12:06 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('services', '0006_servicespagesections'), + ('wagtailimages', '0026_delete_uploadedimage'), + ] + + operations = [ + migrations.AlterField( + model_name='servicespagesections', + name='section_image', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'), + ), + ] diff --git a/services/migrations/0008_rename_section_one_text_servicespage_intro_text_and_more.py b/services/migrations/0008_rename_section_one_text_servicespage_intro_text_and_more.py new file mode 100644 index 00000000..bb6efde3 --- /dev/null +++ b/services/migrations/0008_rename_section_one_text_servicespage_intro_text_and_more.py @@ -0,0 +1,34 @@ +# Generated by Django 5.0.8 on 2024-09-16 12:14 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('services', '0007_alter_servicespagesections_section_image'), + ('wagtailimages', '0026_delete_uploadedimage'), + ] + + operations = [ + migrations.RenameField( + model_name='servicespage', + old_name='section_one_text', + new_name='intro_text', + ), + migrations.RenameField( + model_name='servicespage', + old_name='section_one_title', + new_name='intro_title', + ), + migrations.RemoveField( + model_name='servicespage', + name='section_one_img', + ), + migrations.AddField( + model_name='servicespage', + name='intro_image', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'), + ), + ] diff --git a/services/migrations/0009_remove_servicespage_section_five_img_and_more.py b/services/migrations/0009_remove_servicespage_section_five_img_and_more.py new file mode 100644 index 00000000..fc2c8283 --- /dev/null +++ b/services/migrations/0009_remove_servicespage_section_five_img_and_more.py @@ -0,0 +1,80 @@ +# Generated by Django 5.0.8 on 2024-09-16 12:23 + +import django.db.models.deletion +import modelcluster.fields +import wagtail.fields +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('services', '0008_rename_section_one_text_servicespage_intro_text_and_more'), + ('wagtailimages', '0026_delete_uploadedimage'), + ] + + operations = [ + migrations.RemoveField( + model_name='servicespage', + name='section_five_img', + ), + migrations.RemoveField( + model_name='servicespage', + name='section_five_text', + ), + migrations.RemoveField( + model_name='servicespage', + name='section_five_title', + ), + migrations.RemoveField( + model_name='servicespage', + name='section_four_img', + ), + migrations.RemoveField( + model_name='servicespage', + name='section_four_text', + ), + migrations.RemoveField( + model_name='servicespage', + name='section_four_title', + ), + migrations.RemoveField( + model_name='servicespage', + name='section_three_img', + ), + migrations.RemoveField( + model_name='servicespage', + name='section_three_text', + ), + migrations.RemoveField( + model_name='servicespage', + name='section_three_title', + ), + migrations.RemoveField( + model_name='servicespage', + name='section_two_img', + ), + migrations.RemoveField( + model_name='servicespage', + name='section_two_text', + ), + migrations.RemoveField( + model_name='servicespage', + name='section_two_title', + ), + migrations.CreateModel( + name='ServicesPageSubSection', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sort_order', models.IntegerField(blank=True, editable=False, null=True)), + ('sub_section_title', wagtail.fields.RichTextField(blank=True)), + ('sub_section_text', wagtail.fields.RichTextField(blank=True)), + ('page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='subsections_services', to='services.servicespage')), + ('sub_section_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image')), + ], + options={ + 'ordering': ['sort_order'], + 'abstract': False, + }, + ), + ] diff --git a/services/migrations/0010_remove_servicespagesubsection_sub_section_title.py b/services/migrations/0010_remove_servicespagesubsection_sub_section_title.py new file mode 100644 index 00000000..4cce73a3 --- /dev/null +++ b/services/migrations/0010_remove_servicespagesubsection_sub_section_title.py @@ -0,0 +1,17 @@ +# Generated by Django 5.0.8 on 2024-09-16 12:52 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('services', '0009_remove_servicespage_section_five_img_and_more'), + ] + + operations = [ + migrations.RemoveField( + model_name='servicespagesubsection', + name='sub_section_title', + ), + ] diff --git a/services/migrations/0011_remove_servicespage_sub_section_five_and_more.py b/services/migrations/0011_remove_servicespage_sub_section_five_and_more.py new file mode 100644 index 00000000..5fe27fab --- /dev/null +++ b/services/migrations/0011_remove_servicespage_sub_section_five_and_more.py @@ -0,0 +1,61 @@ +# Generated by Django 5.0.8 on 2024-09-16 12:57 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('services', '0010_remove_servicespagesubsection_sub_section_title'), + ] + + operations = [ + migrations.RemoveField( + model_name='servicespage', + name='sub_section_five', + ), + migrations.RemoveField( + model_name='servicespage', + name='sub_section_five_img', + ), + migrations.RemoveField( + model_name='servicespage', + name='sub_section_four', + ), + migrations.RemoveField( + model_name='servicespage', + name='sub_section_four_img', + ), + migrations.RemoveField( + model_name='servicespage', + name='sub_section_one', + ), + migrations.RemoveField( + model_name='servicespage', + name='sub_section_one_img', + ), + migrations.RemoveField( + model_name='servicespage', + name='sub_section_six', + ), + migrations.RemoveField( + model_name='servicespage', + name='sub_section_six_img', + ), + migrations.RemoveField( + model_name='servicespage', + name='sub_section_three', + ), + migrations.RemoveField( + model_name='servicespage', + name='sub_section_three_img', + ), + migrations.RemoveField( + model_name='servicespage', + name='sub_section_two', + ), + migrations.RemoveField( + model_name='servicespage', + name='sub_section_two_img', + ), + ] diff --git a/services/migrations/__pycache__/0006_servicespagesections.cpython-310.pyc b/services/migrations/__pycache__/0006_servicespagesections.cpython-310.pyc new file mode 100644 index 00000000..286db9ba Binary files /dev/null and b/services/migrations/__pycache__/0006_servicespagesections.cpython-310.pyc differ diff --git a/services/migrations/__pycache__/0007_alter_servicespagesections_section_image.cpython-310.pyc b/services/migrations/__pycache__/0007_alter_servicespagesections_section_image.cpython-310.pyc new file mode 100644 index 00000000..4d150d7f Binary files /dev/null and b/services/migrations/__pycache__/0007_alter_servicespagesections_section_image.cpython-310.pyc differ diff --git a/services/migrations/__pycache__/0008_rename_section_one_text_servicespage_intro_text_and_more.cpython-310.pyc b/services/migrations/__pycache__/0008_rename_section_one_text_servicespage_intro_text_and_more.cpython-310.pyc new file mode 100644 index 00000000..d8daca0e Binary files /dev/null and b/services/migrations/__pycache__/0008_rename_section_one_text_servicespage_intro_text_and_more.cpython-310.pyc differ diff --git a/services/migrations/__pycache__/0009_remove_servicespage_section_five_img_and_more.cpython-310.pyc b/services/migrations/__pycache__/0009_remove_servicespage_section_five_img_and_more.cpython-310.pyc new file mode 100644 index 00000000..c5eef1d0 Binary files /dev/null and b/services/migrations/__pycache__/0009_remove_servicespage_section_five_img_and_more.cpython-310.pyc differ diff --git a/services/migrations/__pycache__/0010_remove_servicespagesubsection_sub_section_title.cpython-310.pyc b/services/migrations/__pycache__/0010_remove_servicespagesubsection_sub_section_title.cpython-310.pyc new file mode 100644 index 00000000..139ae887 Binary files /dev/null and b/services/migrations/__pycache__/0010_remove_servicespagesubsection_sub_section_title.cpython-310.pyc differ diff --git a/services/migrations/__pycache__/0011_remove_servicespage_sub_section_five_and_more.cpython-310.pyc b/services/migrations/__pycache__/0011_remove_servicespage_sub_section_five_and_more.cpython-310.pyc new file mode 100644 index 00000000..7069e279 Binary files /dev/null and b/services/migrations/__pycache__/0011_remove_servicespage_sub_section_five_and_more.cpython-310.pyc differ diff --git a/services/models.py b/services/models.py index b0d5068f..6943f178 100644 --- a/services/models.py +++ b/services/models.py @@ -10,98 +10,24 @@ from saburly.custom_editor import FULL_EDITOR class ServicesPage(Page): - section_one_title = RichTextField(blank=True, features=FULL_EDITOR) - section_one_text = RichTextField(blank=True, features=FULL_EDITOR) - section_one_img = RichTextField(blank=True, features=FULL_EDITOR) - - - section_two_title = RichTextField(blank=True, features=FULL_EDITOR) - section_two_text = RichTextField(blank=True, features=FULL_EDITOR) - section_two_img = RichTextField(blank=True, features=FULL_EDITOR) - - section_three_title = RichTextField(blank=True, features=FULL_EDITOR) - section_three_text = RichTextField(blank=True, features=FULL_EDITOR) - section_three_img = RichTextField(blank=True, features=FULL_EDITOR) - - - section_four_title = RichTextField(blank=True, features=FULL_EDITOR) - section_four_text = RichTextField(blank=True, features=FULL_EDITOR) - section_four_img = RichTextField(blank=True, features=FULL_EDITOR) - - - section_five_title = RichTextField(blank=True, features=FULL_EDITOR) - section_five_text = RichTextField(blank=True, features=FULL_EDITOR) - section_five_img = RichTextField(blank=True, features=FULL_EDITOR) - - - sub_section_one = RichTextField(blank=True, features=FULL_EDITOR) - sub_section_one_img = RichTextField(blank=True, features=FULL_EDITOR) - - sub_section_two = RichTextField(blank=True, features=FULL_EDITOR) - sub_section_two_img = RichTextField(blank=True, features=FULL_EDITOR) - - sub_section_three = RichTextField(blank=True, features=FULL_EDITOR) - sub_section_three_img = RichTextField(blank=True, features=FULL_EDITOR) - - sub_section_four = RichTextField(blank=True, features=FULL_EDITOR) - sub_section_four_img = RichTextField(blank=True, features=FULL_EDITOR) - - sub_section_five = RichTextField(blank=True, features=FULL_EDITOR) - sub_section_five_img = RichTextField(blank=True, features=FULL_EDITOR) - - sub_section_six = RichTextField(blank=True, features=FULL_EDITOR) - sub_section_six_img = RichTextField(blank=True, features=FULL_EDITOR) - - - + intro_title = RichTextField(blank=True, features=FULL_EDITOR) + intro_text = RichTextField(blank=True, features=FULL_EDITOR) + intro_image = models.ForeignKey( + 'wagtailimages.Image', + null=True, + blank=True, + on_delete=models.SET_NULL, + related_name='+' + ) content_panels = Page.content_panels + [ MultiFieldPanel([ - FieldPanel('section_one_title'), - FieldPanel('section_one_text'), - FieldPanel('section_one_img'), - ], heading="Section 1"), - - MultiFieldPanel([ - FieldPanel('section_two_title'), - FieldPanel('section_two_text'), - FieldPanel('section_two_img'), - ], heading="Section 2"), - - MultiFieldPanel([ - FieldPanel('section_three_title'), - FieldPanel('section_three_text'), - FieldPanel('section_three_img'), - ], heading="Section 3"), - - MultiFieldPanel([ - FieldPanel('section_four_title'), - FieldPanel('section_four_text'), - FieldPanel('section_four_img'), - ], heading="Section 4"), - - MultiFieldPanel([ - FieldPanel('section_five_title'), - FieldPanel('section_five_text'), - FieldPanel('section_five_img'), - ], heading="Section 5"), - - MultiFieldPanel([ - FieldPanel('sub_section_one'), - FieldPanel('sub_section_one_img'), - FieldPanel('sub_section_two'), - FieldPanel('sub_section_two_img'), - FieldPanel('sub_section_three'), - FieldPanel('sub_section_three_img'), - FieldPanel('sub_section_four'), - FieldPanel('sub_section_four_img'), - FieldPanel('sub_section_five'), - FieldPanel('sub_section_five_img'), - FieldPanel('sub_section_six'), - FieldPanel('sub_section_six_img'), - ], heading="Section 5 Subfields"), - + FieldPanel('intro_title'), + FieldPanel('intro_text'), + FieldPanel('intro_image'), + ], heading="Intro Section"), InlinePanel('carousel_services', heading="Carousel Services", label="Carousel Services"), - + InlinePanel('sections_services', heading="Sections Services", label="Sections Services"), + InlinePanel('subsections_services', heading="Sub-Sections Services", label="Sub-Sections Services"), ] class ServicesPageCarousel(Orderable): @@ -119,4 +45,40 @@ class ServicesPageCarousel(Orderable): panels = [ FieldPanel('carousel_name'), FieldPanel('carousel_image'), + ] + +class ServicesPageSections(Orderable): + page = ParentalKey(ServicesPage, on_delete=models.CASCADE, related_name='sections_services') + + section_title = RichTextField(blank=True, features=FULL_EDITOR) + section_text = RichTextField(blank=True, features=FULL_EDITOR) + section_image = models.ForeignKey( + 'wagtailimages.Image', + null=True, + blank=True, + on_delete=models.SET_NULL, + related_name='+' + ) + + panels = [ + FieldPanel('section_title'), + FieldPanel('section_text'), + FieldPanel('section_image'), + ] + +class ServicesPageSubSection(Orderable): + page = ParentalKey(ServicesPage, on_delete=models.CASCADE, related_name='subsections_services') + + sub_section_text = RichTextField(blank=True, features=FULL_EDITOR) + sub_section_image = models.ForeignKey( + 'wagtailimages.Image', + null=True, + blank=True, + on_delete=models.SET_NULL, + related_name='+' + ) + + panels = [ + FieldPanel('sub_section_text'), + FieldPanel('sub_section_image'), ] \ No newline at end of file diff --git a/templates/about/about_page.html b/templates/about/about_page.html index 00cd491f..fa8bd1ce 100644 --- a/templates/about/about_page.html +++ b/templates/about/about_page.html @@ -7,19 +7,19 @@ {% block content %}
-
+
- {{ page.section_one_title|richtext }} + {{ page.intro_title|richtext }}
- {{ page.section_one_text|richtext }} + {{ page.intro_text|richtext }}
- {{ page.section_one_img|richtext }} + {{ page.intro_image|richtext }}
@@ -33,15 +33,15 @@
- {{ page.section_two_title|richtext }} + {{ page.section_one_title|richtext }}
- {{ page.section_two_text|richtext }} + {{ page.section_one_text|richtext }}
- {{ page.section_two_img|richtext }} + {{ page.section_one_image|richtext }}
diff --git a/templates/base.html b/templates/base.html index 3cdfe678..fb4b460c 100644 --- a/templates/base.html +++ b/templates/base.html @@ -25,6 +25,5 @@ {% include 'footer.html' %} - \ No newline at end of file diff --git a/templates/home/home_page.html b/templates/home/home_page.html index 3f287a66..41f19425 100644 --- a/templates/home/home_page.html +++ b/templates/home/home_page.html @@ -10,88 +10,70 @@

- {{ page.section_one_title|richtext }} + {{ page.intro_title|richtext }}

- {{ page.section_one_text|richtext }} + {{ page.intro_text|richtext }}
- {{ page.section_one_img|richtext }} + {{ page.intro_image|richtext }}
- -
-
-
-
- {{ page.section_two_img|richtext }} -
-
-
-

- {{ page.section_two_title|richtext }} -

-
- {{ page.section_two_text|richtext }} -
-
-
-
- -
-
-
-

- {{ page.section_three_title|richtext }} -

-
- {{ page.section_three_text|richtext }} -
-
-
-
- {{ page.section_three_img|richtext }} -
-
-
-
- -
-
-
-
- {{ page.section_four_img|richtext }} -
-
-
-

- {{ page.section_four_title|richtext }} -

-
- {{ page.section_four_text|richtext }} -
-
-
-
- +{% for item in page.homepage_sections.all %} + {% if item.section_image %} + {% if forloop.counter|divisibleby:2 %} +
+
+
+

+ {{ item.section_title|richtext }} +

+
+ {{ item.section_text|richtext }} +
+
+
+ {{ item.section_title }} +
+
+
+ {% else %} +
+
+
+
+
+
+ {{ item.section_title|richtext}} +
+
+ {{ item.section_text|richtext}} +
+
+
+ Intro Image +
+
+
+
+ {% endif %} + {% else %}
-
-

- {{ page.section_five_title|richtext }} -

+
+
+ {{ item.section_title|richtext }} +
- {{ page.section_five_text|richtext }} -
-
- {{ page.section_five_img|richtext }} + {{ item.section_text|richtext }}
- -{% endblock %} + {% endif %} +{% endfor %} +{% endblock content %} \ No newline at end of file diff --git a/templates/services/services_page.html b/templates/services/services_page.html index 0de8bab6..0ee3bc8a 100644 --- a/templates/services/services_page.html +++ b/templates/services/services_page.html @@ -12,170 +12,116 @@
- {{ page.section_one_title|richtext }} + {{ page.intro_title|richtext }}
- {{ page.section_one_text|richtext }} + {{ page.intro_text|richtext }}
-
- {{ page.section_one_img|richtext }} +
+ Intro Image
-
-
-
-
-
-
- {{ page.section_two_title|richtext }} -
-
- {{ page.section_two_text|richtext }} -
-
-
-
- {{ page.section_two_img|richtext }} -
-
-
-
-
- -
-
-
-
-
-
- {{ page.section_three_title|richtext }} -
-
- {{ page.section_three_text|richtext }} -
-
-
-
- {{ page.section_three_img|richtext }} -
-
-
-
-
- -
-
-
-
-
-
- {{ page.section_four_title|richtext }} -
-
- {{ page.section_four_text|richtext }} -
-
-
- {{ page.section_four_img|richtext }} -
-
-
-
-
-
-
+ {% if forloop.counter == 3 %} +
+
+ +
+
+ {% endif %} + + {% endif %} +{% endfor %} -
-
-
-
-
-
- {{ page.section_five_title|richtext }} -
-
- {{ page.section_five_text|richtext }} -
-
-
-
- {{ page.section_five_img|richtext }} -
-
-
-
-
-
-
- +
+
+ {% for item in page.subsections_services.all %}
-
{{ page.sub_section_one_img|richtext }}
-
{{ page.sub_section_one|richtext }}
+
+ +
+
{{ item.sub_section_text|richtext }}
-
- -
-
-
{{ page.sub_section_two_img|richtext }}
-
{{ page.sub_section_two|richtext }}
-
-
- -
-
-
{{ page.sub_section_three_img|richtext }}
-
{{ page.sub_section_three|richtext }}
-
-
- -
-
-
{{ page.sub_section_four_img|richtext }}
-
{{ page.sub_section_four|richtext }}
-
-
- -
-
-
{{ page.sub_section_five_img|richtext }}
-
{{ page.sub_section_five|richtext }}
-
-
- -
-
-
{{ page.sub_section_six_img|richtext }}
-
{{ page.sub_section_six|richtext }}
-
-
- -
+
+ {% endfor %}
- +
+
+
- -
-{% endblock %} +{% load static %} + + +{% endblock content%} \ No newline at end of file