Parcourir la source

Merge branch 'master' into dutch-amendments

Edd Baldry il y a 8 ans
Parent
commit
5bedb99bbf
64 fichiers modifiés avec 820 ajouts et 1231 suppressions
  1. 64 27
      bakerydemo/base/migrations/0001_initial.py
  2. 0 30
      bakerydemo/base/migrations/0002_auto_20170210_1217.py
  3. 0 23
      bakerydemo/base/migrations/0003_footertext.py
  4. 0 19
      bakerydemo/base/migrations/0004_auto_20170210_1420.py
  5. 0 19
      bakerydemo/base/migrations/0004_auto_20170210_1445.py
  6. 0 16
      bakerydemo/base/migrations/0005_merge_20170210_1539.py
  7. 0 16
      bakerydemo/base/migrations/0005_merge_20170210_1551.py
  8. 0 34
      bakerydemo/base/migrations/0006_auto_20170210_1556.py
  9. 0 16
      bakerydemo/base/migrations/0007_merge_20170210_1627.py
  10. 0 34
      bakerydemo/base/migrations/0008_auto_20170211_2232.py
  11. 0 31
      bakerydemo/base/migrations/0009_auto_20170218_1114.py
  12. 0 21
      bakerydemo/base/migrations/0010_auto_20170218_1119.py
  13. 0 26
      bakerydemo/base/migrations/0011_auto_20170220_0111.py
  14. 0 20
      bakerydemo/base/migrations/0012_auto_20170222_0756.py
  15. 0 20
      bakerydemo/base/migrations/0013_auto_20170227_2216.py
  16. 0 26
      bakerydemo/base/migrations/0013_auto_20170228_0714.py
  17. 0 16
      bakerydemo/base/migrations/0014_merge_20170228_1619.py
  18. 123 36
      bakerydemo/base/models.py
  19. 13 10
      bakerydemo/blog/migrations/0001_initial.py
  20. 0 29
      bakerydemo/blog/migrations/0002_auto_20170210_1556.py
  21. 0 29
      bakerydemo/blog/migrations/0003_auto_20170211_2120.py
  22. 0 21
      bakerydemo/blog/migrations/0004_auto_20170218_1103.py
  23. 0 36
      bakerydemo/blog/migrations/0005_auto_20170220_0111.py
  24. 10 9
      bakerydemo/blog/models.py
  25. 27 5
      bakerydemo/breads/migrations/0001_initial.py
  26. 0 27
      bakerydemo/breads/migrations/0002_auto_20170217_0853.py
  27. 0 21
      bakerydemo/breads/migrations/0003_auto_20170218_1102.py
  28. 0 44
      bakerydemo/breads/migrations/0004_auto_20170220_0111.py
  29. 0 31
      bakerydemo/breads/migrations/0005_auto_20170224_1047.py
  30. 11 13
      bakerydemo/breads/models.py
  31. 10 0
      bakerydemo/locations/choices.py
  32. 21 10
      bakerydemo/locations/migrations/0001_initial.py
  33. 0 21
      bakerydemo/locations/migrations/0002_auto_20170211_2229.py
  34. 0 26
      bakerydemo/locations/migrations/0003_auto_20170214_2220.py
  35. 0 21
      bakerydemo/locations/migrations/0003_auto_20170215_0723.py
  36. 0 29
      bakerydemo/locations/migrations/0004_auto_20170215_1334.py
  37. 0 22
      bakerydemo/locations/migrations/0004_locationsindexpage_image.py
  38. 0 21
      bakerydemo/locations/migrations/0005_locationoperatinghours_closed.py
  39. 0 20
      bakerydemo/locations/migrations/0005_locationsindexpage_introduction.py
  40. 0 30
      bakerydemo/locations/migrations/0006_auto_20170215_1408.py
  41. 0 21
      bakerydemo/locations/migrations/0006_auto_20170218_1102.py
  42. 0 25
      bakerydemo/locations/migrations/0007_auto_20170215_1411.py
  43. 0 16
      bakerydemo/locations/migrations/0008_merge_20170218_0921.py
  44. 0 24
      bakerydemo/locations/migrations/0009_auto_20170219_0942.py
  45. 0 16
      bakerydemo/locations/migrations/0010_merge_20170220_0111.py
  46. 0 36
      bakerydemo/locations/migrations/0011_auto_20170220_0111.py
  47. 14 32
      bakerydemo/locations/models.py
  48. 3 2
      bakerydemo/settings/base.py
  49. 253 3
      bakerydemo/static/css/main.css
  50. 3 3
      bakerydemo/templates/base.html
  51. 4 4
      bakerydemo/templates/base/form_page.html
  52. 123 2
      bakerydemo/templates/base/home_page.html
  53. 6 0
      bakerydemo/templates/base/include/header-hero.html
  54. 5 5
      bakerydemo/templates/base/standard_page.html
  55. 0 1
      bakerydemo/templates/blocks/intro_block.htm
  56. 3 1
      bakerydemo/templates/blog/blog_index_page.html
  57. 2 12
      bakerydemo/templates/blog/blog_page.html
  58. 7 7
      bakerydemo/templates/includes/footer.html
  59. 31 30
      bakerydemo/templates/includes/header.html
  60. 2 2
      bakerydemo/templates/includes/messages.html
  61. 81 81
      bakerydemo/templates/locations/location_page.html
  62. 1 0
      bakerydemo/templates/tags/breadcrumbs.html
  63. 1 1
      bakerydemo/templates/tags/top_menu.html
  64. 2 2
      bakerydemo/templates/tags/top_menu_children.html

+ 64 - 27
bakerydemo/base/migrations/0001_initial.py

@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-10 12:17
+# Generated by Django 1.10.5 on 2017-03-15 07:16
 from __future__ import unicode_literals
 
 from django.db import migrations, models
@@ -16,33 +16,20 @@ class Migration(migrations.Migration):
     initial = True
 
     dependencies = [
+        ('wagtailimages', '0018_remove_rendition_filter'),
         ('wagtailcore', '0032_add_bulk_delete_page_permission'),
-        ('wagtailimages', '0017_reduce_focal_point_key_max_length'),
     ]
 
     operations = [
         migrations.CreateModel(
-            name='AboutLocationRelationship',
+            name='FooterText',
             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)),
-            ],
-            options={
-                'abstract': False,
-                'ordering': ['sort_order'],
-            },
-        ),
-        migrations.CreateModel(
-            name='AboutPage',
-            fields=[
-                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
-                ('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False)),))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='About page detail')),
-                ('image', models.ForeignKey(blank=True, help_text='Location image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
+                ('body', wagtail.wagtailcore.fields.RichTextField()),
             ],
             options={
-                'abstract': False,
+                'verbose_name_plural': 'Footer Text',
             },
-            bases=('wagtailcore.page',),
         ),
         migrations.CreateModel(
             name='FormField',
@@ -57,8 +44,8 @@ class Migration(migrations.Migration):
                 ('help_text', models.CharField(blank=True, max_length=255, verbose_name='help text')),
             ],
             options={
-                'abstract': False,
                 'ordering': ['sort_order'],
+                'abstract': False,
             },
         ),
         migrations.CreateModel(
@@ -68,9 +55,9 @@ class Migration(migrations.Migration):
                 ('to_address', models.CharField(blank=True, help_text='Optional - form submissions will be emailed to these addresses. Separate multiple addresses by comma.', max_length=255, verbose_name='to address')),
                 ('from_address', models.CharField(blank=True, max_length=255, verbose_name='from address')),
                 ('subject', models.CharField(blank=True, max_length=255, verbose_name='subject')),
-                ('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False)),))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))))),
+                ('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))))),
                 ('thank_you_text', wagtail.wagtailcore.fields.RichTextField(blank=True)),
-                ('header_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
+                ('image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
             ],
             options={
                 'abstract': False,
@@ -81,21 +68,28 @@ class Migration(migrations.Migration):
             name='GalleryPage',
             fields=[
                 ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
-                ('introduction', models.TextField(blank=True, help_text='Text to describe the index page')),
-                ('choices', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='wagtailcore.Collection')),
-                ('image', models.ForeignKey(blank=True, help_text='Location listing image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
+                ('introduction', models.TextField(blank=True, help_text='Text to describe the page')),
+                ('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Page body')),
+                ('collection', models.ForeignKey(blank=True, help_text='Select the image collection for this gallery.', null=True, on_delete=django.db.models.deletion.SET_NULL, to='wagtailcore.Collection')),
+                ('image', models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
             ],
             options={
                 'abstract': False,
             },
-            bases=('wagtailcore.page',),
+            bases=('wagtailcore.page', models.Model),
         ),
         migrations.CreateModel(
             name='HomePage',
             fields=[
                 ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
-                ('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False)),))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Home page detail')),
-                ('image', models.ForeignKey(blank=True, help_text='Location image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
+                ('hero_text', models.CharField(help_text='Write an introduction for the bakery', max_length=255)),
+                ('hero_cta', models.CharField(help_text='Text to display on Call to Action', max_length=255, verbose_name='Hero CTA')),
+                ('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Home content block')),
+                ('promo_title', models.CharField(blank=True, help_text='Title to display above the promo copy', max_length=255, null=True)),
+                ('promo_text', wagtail.wagtailcore.fields.RichTextField(blank=True, help_text='Write some promotional copy', null=True)),
+                ('featured_section_1_title', models.CharField(blank=True, help_text='Title to display above the promo copy', max_length=255, null=True)),
+                ('featured_section_2_title', models.CharField(blank=True, help_text='Title to display above the promo copy', max_length=255, null=True)),
+                ('featured_section_3_title', models.CharField(blank=True, help_text='Title to display above the promo copy', max_length=255, null=True)),
             ],
             options={
                 'abstract': False,
@@ -116,6 +110,49 @@ class Migration(migrations.Migration):
                 'verbose_name': 'Person',
             },
         ),
+        migrations.CreateModel(
+            name='StandardPage',
+            fields=[
+                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
+                ('introduction', models.TextField(blank=True, help_text='Text to describe the page')),
+                ('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Page body')),
+                ('image', models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
+            ],
+            options={
+                'abstract': False,
+            },
+            bases=('wagtailcore.page', models.Model),
+        ),
+        migrations.AddField(
+            model_name='homepage',
+            name='featured_section_1',
+            field=models.ForeignKey(blank=True, help_text='First featured section for the homepage. Will display up to three child items.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.Page', verbose_name='Featured section 1'),
+        ),
+        migrations.AddField(
+            model_name='homepage',
+            name='featured_section_2',
+            field=models.ForeignKey(blank=True, help_text='Second featured section for the homepage. Will display up to three child items.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.Page', verbose_name='Featured section 2'),
+        ),
+        migrations.AddField(
+            model_name='homepage',
+            name='featured_section_3',
+            field=models.ForeignKey(blank=True, help_text='Third featured section for the homepage. Will display up to six child items.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.Page', verbose_name='Featured section 3'),
+        ),
+        migrations.AddField(
+            model_name='homepage',
+            name='hero_cta_link',
+            field=models.ForeignKey(blank=True, help_text='Choose a page to link to for the Call to Action', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.Page', verbose_name='Hero CTA link'),
+        ),
+        migrations.AddField(
+            model_name='homepage',
+            name='image',
+            field=models.ForeignKey(blank=True, help_text='Homepage image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
+        ),
+        migrations.AddField(
+            model_name='homepage',
+            name='promo_image',
+            field=models.ForeignKey(blank=True, help_text='Promo image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
+        ),
         migrations.AddField(
             model_name='formfield',
             name='page',

+ 0 - 30
bakerydemo/base/migrations/0002_auto_20170210_1217.py

@@ -1,30 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-10 12:17
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import django.db.models.deletion
-import modelcluster.fields
-
-
-class Migration(migrations.Migration):
-
-    initial = True
-
-    dependencies = [
-        ('locations', '0001_initial'),
-        ('base', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='aboutlocationrelationship',
-            name='locations',
-            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='about_location_relationship', to='locations.LocationPage'),
-        ),
-        migrations.AddField(
-            model_name='aboutlocationrelationship',
-            name='page',
-            field=modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='location_about_relationship', to='base.AboutPage'),
-        ),
-    ]

+ 0 - 23
bakerydemo/base/migrations/0003_footertext.py

@@ -1,23 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-10 13:38
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import wagtail.wagtailcore.fields
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('base', '0002_auto_20170210_1217'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='FooterText',
-            fields=[
-                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('body', wagtail.wagtailcore.fields.RichTextField()),
-            ],
-        ),
-    ]

+ 0 - 19
bakerydemo/base/migrations/0004_auto_20170210_1420.py

@@ -1,19 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-10 14:20
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('base', '0003_footertext'),
-    ]
-
-    operations = [
-        migrations.AlterModelOptions(
-            name='footertext',
-            options={'verbose_name_plural': 'Footer Text'},
-        ),
-    ]

+ 0 - 19
bakerydemo/base/migrations/0004_auto_20170210_1445.py

@@ -1,19 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-10 14:45
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('base', '0003_footertext'),
-    ]
-
-    operations = [
-        migrations.AlterModelOptions(
-            name='footertext',
-            options={'verbose_name_plural': 'Footer Text'},
-        ),
-    ]

+ 0 - 16
bakerydemo/base/migrations/0005_merge_20170210_1539.py

@@ -1,16 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-10 15:39
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('base', '0004_auto_20170210_1445'),
-        ('base', '0004_auto_20170210_1420'),
-    ]
-
-    operations = [
-    ]

+ 0 - 16
bakerydemo/base/migrations/0005_merge_20170210_1551.py

@@ -1,16 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-10 15:51
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('base', '0004_auto_20170210_1420'),
-        ('base', '0004_auto_20170210_1445'),
-    ]
-
-    operations = [
-    ]

+ 0 - 34
bakerydemo/base/migrations/0006_auto_20170210_1556.py

@@ -1,34 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-10 15:56
-from __future__ import unicode_literals
-
-from django.db import migrations
-import wagtail.wagtailcore.blocks
-import wagtail.wagtailcore.fields
-import wagtail.wagtailembeds.blocks
-import wagtail.wagtailimages.blocks
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('base', '0005_merge_20170210_1539'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='aboutpage',
-            name='body',
-            field=wagtail.wagtailcore.fields.StreamField([(b'intro_block', wagtail.wagtailcore.blocks.TextBlock()), (b'heading_block', wagtail.wagtailcore.blocks.StructBlock([(b'heading_text', wagtail.wagtailcore.blocks.CharBlock(classname=b'title', required=True)), (b'size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[(b'', b'Select a header size'), (b'h2', b'H2'), (b'h3', b'H3'), (b'h4', b'H4')], required=False))])), (b'paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon=b'fa-paragraph', template=b'blocks/paragraph_block.html')), (b'image_block', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), (b'caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))])), (b'block_quote', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.TextBlock()), (b'attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label=b'e.g. Guy Picciotto', required=False))])), (b'embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text=b'Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon=b'fa-s15', template=b'blocks/embed_block.html'))], blank=True, verbose_name='About page detail'),
-        ),
-        migrations.AlterField(
-            model_name='formpage',
-            name='body',
-            field=wagtail.wagtailcore.fields.StreamField([(b'intro_block', wagtail.wagtailcore.blocks.TextBlock()), (b'heading_block', wagtail.wagtailcore.blocks.StructBlock([(b'heading_text', wagtail.wagtailcore.blocks.CharBlock(classname=b'title', required=True)), (b'size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[(b'', b'Select a header size'), (b'h2', b'H2'), (b'h3', b'H3'), (b'h4', b'H4')], required=False))])), (b'paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon=b'fa-paragraph', template=b'blocks/paragraph_block.html')), (b'image_block', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), (b'caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))])), (b'block_quote', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.TextBlock()), (b'attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label=b'e.g. Guy Picciotto', required=False))])), (b'embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text=b'Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon=b'fa-s15', template=b'blocks/embed_block.html'))]),
-        ),
-        migrations.AlterField(
-            model_name='homepage',
-            name='body',
-            field=wagtail.wagtailcore.fields.StreamField([(b'intro_block', wagtail.wagtailcore.blocks.TextBlock()), (b'heading_block', wagtail.wagtailcore.blocks.StructBlock([(b'heading_text', wagtail.wagtailcore.blocks.CharBlock(classname=b'title', required=True)), (b'size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[(b'', b'Select a header size'), (b'h2', b'H2'), (b'h3', b'H3'), (b'h4', b'H4')], required=False))])), (b'paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon=b'fa-paragraph', template=b'blocks/paragraph_block.html')), (b'image_block', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), (b'caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))])), (b'block_quote', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.TextBlock()), (b'attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label=b'e.g. Guy Picciotto', required=False))])), (b'embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text=b'Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon=b'fa-s15', template=b'blocks/embed_block.html'))], blank=True, verbose_name='Home page detail'),
-        ),
-    ]

+ 0 - 16
bakerydemo/base/migrations/0007_merge_20170210_1627.py

@@ -1,16 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-10 16:27
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('base', '0005_merge_20170210_1551'),
-        ('base', '0006_auto_20170210_1556'),
-    ]
-
-    operations = [
-    ]

+ 0 - 34
bakerydemo/base/migrations/0008_auto_20170211_2232.py

@@ -1,34 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-11 22:32
-from __future__ import unicode_literals
-
-from django.db import migrations
-import wagtail.wagtailcore.blocks
-import wagtail.wagtailcore.fields
-import wagtail.wagtailembeds.blocks
-import wagtail.wagtailimages.blocks
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('base', '0007_merge_20170210_1627'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='aboutpage',
-            name='body',
-            field=wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='About page detail'),
-        ),
-        migrations.AlterField(
-            model_name='formpage',
-            name='body',
-            field=wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html')))),
-        ),
-        migrations.AlterField(
-            model_name='homepage',
-            name='body',
-            field=wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Home page detail'),
-        ),
-    ]

+ 0 - 31
bakerydemo/base/migrations/0009_auto_20170218_1114.py

@@ -1,31 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-18 11:14
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('base', '0008_auto_20170211_2232'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='aboutpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text='About image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
-        ),
-        migrations.AlterField(
-            model_name='gallerypage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text='Listing image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
-        ),
-        migrations.AlterField(
-            model_name='homepage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text='Homepage image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
-        ),
-    ]

+ 0 - 21
bakerydemo/base/migrations/0010_auto_20170218_1119.py

@@ -1,21 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-18 11:19
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('base', '0009_auto_20170218_1114'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='gallerypage',
-            name='choices',
-            field=models.ForeignKey(blank=True, help_text='Select the image collection for this gallery.', null=True, on_delete=django.db.models.deletion.SET_NULL, to='wagtailcore.Collection'),
-        ),
-    ]

+ 0 - 26
bakerydemo/base/migrations/0011_auto_20170220_0111.py

@@ -1,26 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-20 01:11
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('base', '0010_auto_20170218_1119'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='gallerypage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
-        ),
-        migrations.AlterField(
-            model_name='gallerypage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text='Text to describe the page'),
-        ),
-    ]

+ 0 - 20
bakerydemo/base/migrations/0012_auto_20170222_0756.py

@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-22 07:56
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('base', '0011_auto_20170220_0111'),
-    ]
-
-    operations = [
-        migrations.RenameField(
-            model_name='gallerypage',
-            old_name='choices',
-            new_name='collection',
-        ),
-    ]

+ 0 - 20
bakerydemo/base/migrations/0013_auto_20170227_2216.py

@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-27 22:16
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('base', '0012_auto_20170222_0756'),
-    ]
-
-    operations = [
-        migrations.RenameField(
-            model_name='formpage',
-            old_name='header_image',
-            new_name='image',
-        ),
-    ]

+ 0 - 26
bakerydemo/base/migrations/0013_auto_20170228_0714.py

@@ -1,26 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-28 07:14
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('base', '0012_auto_20170222_0756'),
-    ]
-
-    operations = [
-        migrations.RemoveField(
-            model_name='aboutlocationrelationship',
-            name='locations',
-        ),
-        migrations.RemoveField(
-            model_name='aboutlocationrelationship',
-            name='page',
-        ),
-        migrations.DeleteModel(
-            name='AboutLocationRelationship',
-        ),
-    ]

+ 0 - 16
bakerydemo/base/migrations/0014_merge_20170228_1619.py

@@ -1,16 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-28 16:19
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('base', '0013_auto_20170227_2216'),
-        ('base', '0013_auto_20170228_0714'),
-    ]
-
-    operations = [
-    ]

+ 123 - 36
bakerydemo/base/models.py

@@ -6,11 +6,10 @@ from modelcluster.fields import ParentalKey
 from modelcluster.models import ClusterableModel
 
 from wagtail.wagtailadmin.edit_handlers import (
-    FieldPanel, FieldRowPanel, InlinePanel, MultiFieldPanel,
-    PageChooserPanel, StreamFieldPanel,
+    FieldPanel, FieldRowPanel, InlinePanel, MultiFieldPanel, PageChooserPanel, StreamFieldPanel,
 )
 from wagtail.wagtailcore.fields import RichTextField, StreamField
-from wagtail.wagtailcore.models import Collection, Orderable, Page
+from wagtail.wagtailcore.models import Collection, Page
 from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormField
 from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
 from wagtail.wagtailsearch import index
@@ -34,10 +33,14 @@ class BasePageFieldsMixin(models.Model):
         related_name='+',
         help_text='Landscape mode only; horizontal width between 1000px and 3000px.'
     )
+    body = StreamField(
+        BaseStreamBlock(), verbose_name="Page body", blank=True
+    )
 
     content_panels = Page.content_panels + [
         FieldPanel('introduction', classname="full"),
         ImageChooserPanel('image'),
+        StreamFieldPanel('body'),
     ]
 
     class Meta:
@@ -109,9 +112,19 @@ class FooterText(models.Model):
         verbose_name_plural = 'Footer Text'
 
 
-class AboutPage(Page):
+class StandardPage(Page, BasePageFieldsMixin):
     """
-    The About Page
+    A fairly generic site page, to be used for About, etc.
+    Defines no fields of its own - just a wrapper for the fields defined in BasePageFieldsMixin.
+    """
+
+    # Inherit the content panels from BasePageFieldsMixin
+    content_panels = BasePageFieldsMixin.content_panels + []
+
+
+class HomePage(Page):
+    """
+    The Home Page
     """
     image = models.ForeignKey(
         'wagtailimages.Image',
@@ -119,54 +132,128 @@ class AboutPage(Page):
         blank=True,
         on_delete=models.SET_NULL,
         related_name='+',
-        help_text='About image'
+        help_text='Homepage image'
+    )
+    hero_text = models.CharField(
+        max_length=255,
+        help_text='Write an introduction for the bakery'
+        )
+    hero_cta = models.CharField(
+        verbose_name='Hero CTA',
+        max_length=255,
+        help_text='Text to display on Call to Action'
+        )
+    hero_cta_link = models.ForeignKey(
+        'wagtailcore.Page',
+        null=True,
+        blank=True,
+        on_delete=models.SET_NULL,
+        related_name='+',
+        verbose_name='Hero CTA link',
+        help_text='Choose a page to link to for the Call to Action'
     )
 
     body = StreamField(
-        BaseStreamBlock(), verbose_name="About page detail", blank=True
+        BaseStreamBlock(), verbose_name="Home content block", blank=True
     )
-    # We've defined the StreamBlock() within blocks.py that we've imported on
-    # line 12. Defining it in a different file gives us consistency across the
-    # site, though StreamFields _can_ be created on a per model basis if you
-    # have a use case for it
 
-    content_panels = Page.content_panels + [
-        ImageChooserPanel('image'),
-        StreamFieldPanel('body'),
-    ]
-
-    # parent_page_types = [
-    #    'home.HomePage'
-    # ]
-
-    # Defining what content type can sit under the parent
-    # The empty array means that no children can be placed under the
-    # LocationPage page model
-    subpage_types = []
-
-    # api_fields = ['image', 'body']
+    promo_image = models.ForeignKey(
+        'wagtailimages.Image',
+        null=True,
+        blank=True,
+        on_delete=models.SET_NULL,
+        related_name='+',
+        help_text='Promo image'
+    )
+    promo_title = models.CharField(
+        null=True,
+        blank=True,
+        max_length=255,
+        help_text='Title to display above the promo copy'
+    )
+    promo_text = RichTextField(
+        null=True,
+        blank=True,
+        help_text='Write some promotional copy'
+    )
 
+    featured_section_1_title = models.CharField(
+        null=True,
+        blank=True,
+        max_length=255,
+        help_text='Title to display above the promo copy'
+    )
+    featured_section_1 = models.ForeignKey(
+        'wagtailcore.Page',
+        null=True,
+        blank=True,
+        on_delete=models.SET_NULL,
+        related_name='+',
+        help_text='First featured section for the homepage. Will display up to three child items.',
+        verbose_name='Featured section 1'
+    )
 
-class HomePage(Page):
-    """
-    The Home Page
-    """
-    image = models.ForeignKey(
-        'wagtailimages.Image',
+    featured_section_2_title = models.CharField(
+        null=True,
+        blank=True,
+        max_length=255,
+        help_text='Title to display above the promo copy'
+    )
+    featured_section_2 = models.ForeignKey(
+        'wagtailcore.Page',
         null=True,
         blank=True,
         on_delete=models.SET_NULL,
         related_name='+',
-        help_text='Homepage image'
+        help_text='Second featured section for the homepage. Will display up to three child items.',
+        verbose_name='Featured section 2'
     )
 
-    body = StreamField(
-        BaseStreamBlock(), verbose_name="Home page detail", blank=True
+    featured_section_3_title = models.CharField(
+        null=True,
+        blank=True,
+        max_length=255,
+        help_text='Title to display above the promo copy'
+    )
+    featured_section_3 = models.ForeignKey(
+        'wagtailcore.Page',
+        null=True,
+        blank=True,
+        on_delete=models.SET_NULL,
+        related_name='+',
+        help_text='Third featured section for the homepage. Will display up to six child items.',
+        verbose_name='Featured section 3'
     )
 
     content_panels = Page.content_panels + [
-        ImageChooserPanel('image'),
+        MultiFieldPanel([
+            ImageChooserPanel('image'),
+            FieldPanel('hero_text', classname="full"),
+            MultiFieldPanel([
+                FieldPanel('hero_cta'),
+                PageChooserPanel('hero_cta_link'),
+                ])
+            ], heading="Hero section"),
+        MultiFieldPanel([
+                ImageChooserPanel('promo_image'),
+                FieldPanel('promo_title'),
+                FieldPanel('promo_text'),
+            ], heading="Promo section"),
         StreamFieldPanel('body'),
+        MultiFieldPanel([
+            MultiFieldPanel([
+                FieldPanel('featured_section_1_title'),
+                PageChooserPanel('featured_section_1'),
+                ]),
+            MultiFieldPanel([
+                FieldPanel('featured_section_2_title'),
+                PageChooserPanel('featured_section_2'),
+                ]),
+            MultiFieldPanel([
+                FieldPanel('featured_section_3_title'),
+                PageChooserPanel('featured_section_3'),
+                ])
+        ], heading="Featured homepage sections", classname="collapsible")
     ]
 
     def __str__(self):

+ 13 - 10
bakerydemo/blog/migrations/0001_initial.py

@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-10 12:17
+# Generated by Django 1.10.5 on 2017-03-15 07:16
 from __future__ import unicode_literals
 
 from django.db import migrations, models
@@ -18,10 +18,10 @@ class Migration(migrations.Migration):
     initial = True
 
     dependencies = [
+        ('taggit', '0002_auto_20150616_2121'),
         ('wagtailcore', '0032_add_bulk_delete_page_permission'),
-        ('wagtailimages', '0017_reduce_focal_point_key_max_length'),
         ('base', '0001_initial'),
-        ('taggit', '0002_auto_20150616_2121'),
+        ('wagtailimages', '0018_remove_rendition_filter'),
     ]
 
     operations = [
@@ -29,26 +29,29 @@ class Migration(migrations.Migration):
             name='BlogIndexPage',
             fields=[
                 ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
-                ('introduction', models.TextField(blank=True, help_text='Text to describe the index page')),
-                ('image', models.ForeignKey(blank=True, help_text='Location listing image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
+                ('introduction', models.TextField(blank=True, help_text='Text to describe the page')),
+                ('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Page body')),
+                ('image', models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
             ],
             options={
                 'abstract': False,
             },
-            bases=(wagtail.contrib.wagtailroutablepage.models.RoutablePageMixin, 'wagtailcore.page'),
+            bases=(wagtail.contrib.wagtailroutablepage.models.RoutablePageMixin, 'wagtailcore.page', models.Model),
         ),
         migrations.CreateModel(
             name='BlogPage',
             fields=[
                 ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
+                ('introduction', models.TextField(blank=True, help_text='Text to describe the page')),
+                ('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Page body')),
+                ('subtitle', models.CharField(blank=True, max_length=255)),
                 ('date_published', models.DateField(blank=True, null=True, verbose_name='Date article published')),
-                ('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False)),))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Blog post')),
-                ('image', models.ForeignKey(blank=True, help_text='Location image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
+                ('image', models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
             ],
             options={
                 'abstract': False,
             },
-            bases=('wagtailcore.page',),
+            bases=('wagtailcore.page', models.Model),
         ),
         migrations.CreateModel(
             name='BlogPageTag',
@@ -70,8 +73,8 @@ class Migration(migrations.Migration):
                 ('people', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='person_blog_relationship', to='base.People')),
             ],
             options={
-                'abstract': False,
                 'ordering': ['sort_order'],
+                'abstract': False,
             },
         ),
         migrations.AddField(

+ 0 - 29
bakerydemo/blog/migrations/0002_auto_20170210_1556.py

@@ -1,29 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-10 15:56
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import wagtail.wagtailcore.blocks
-import wagtail.wagtailcore.fields
-import wagtail.wagtailembeds.blocks
-import wagtail.wagtailimages.blocks
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('blog', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='blogpage',
-            name='subtitle',
-            field=models.CharField(blank=True, max_length=255),
-        ),
-        migrations.AlterField(
-            model_name='blogpage',
-            name='body',
-            field=wagtail.wagtailcore.fields.StreamField([(b'intro_block', wagtail.wagtailcore.blocks.TextBlock()), (b'heading_block', wagtail.wagtailcore.blocks.StructBlock([(b'heading_text', wagtail.wagtailcore.blocks.CharBlock(classname=b'title', required=True)), (b'size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[(b'', b'Select a header size'), (b'h2', b'H2'), (b'h3', b'H3'), (b'h4', b'H4')], required=False))])), (b'paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon=b'fa-paragraph', template=b'blocks/paragraph_block.html')), (b'image_block', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), (b'caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))])), (b'block_quote', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.TextBlock()), (b'attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label=b'e.g. Guy Picciotto', required=False))])), (b'embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text=b'Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon=b'fa-s15', template=b'blocks/embed_block.html'))], blank=True, verbose_name='Blog post'),
-        ),
-    ]

+ 0 - 29
bakerydemo/blog/migrations/0003_auto_20170211_2120.py

@@ -1,29 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-11 21:20
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import wagtail.wagtailcore.blocks
-import wagtail.wagtailcore.fields
-import wagtail.wagtailembeds.blocks
-import wagtail.wagtailimages.blocks
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('blog', '0002_auto_20170210_1556'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='blogpage',
-            name='introduction',
-            field=models.CharField(blank=True, max_length=255),
-        ),
-        migrations.AlterField(
-            model_name='blogpage',
-            name='body',
-            field=wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Blog post'),
-        ),
-    ]

+ 0 - 21
bakerydemo/blog/migrations/0004_auto_20170218_1103.py

@@ -1,21 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-18 11:03
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('blog', '0003_auto_20170211_2120'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='blogindexpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text='Listing image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
-        ),
-    ]

+ 0 - 36
bakerydemo/blog/migrations/0005_auto_20170220_0111.py

@@ -1,36 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-20 01:11
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('blog', '0004_auto_20170218_1103'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='blogindexpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
-        ),
-        migrations.AlterField(
-            model_name='blogindexpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text='Text to describe the page'),
-        ),
-        migrations.AlterField(
-            model_name='blogpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
-        ),
-        migrations.AlterField(
-            model_name='blogpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text='Text to describe the page'),
-        ),
-    ]

+ 10 - 9
bakerydemo/blog/models.py

@@ -10,15 +10,12 @@ from modelcluster.fields import ParentalKey
 from taggit.models import Tag, TaggedItemBase
 
 from wagtail.contrib.wagtailroutablepage.models import RoutablePageMixin, route
-from wagtail.wagtailadmin.edit_handlers import (
-    FieldPanel, InlinePanel, StreamFieldPanel
-)
-from wagtail.wagtailcore.fields import StreamField
+from wagtail.wagtailadmin.edit_handlers import FieldPanel, InlinePanel
 from wagtail.wagtailcore.models import Page, Orderable
+from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
 from wagtail.wagtailsearch import index
 from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel
 
-from bakerydemo.base.blocks import BaseStreamBlock
 from bakerydemo.base.models import BasePageFieldsMixin
 
 
@@ -49,12 +46,8 @@ class BlogPage(BasePageFieldsMixin, Page):
     subtitle = models.CharField(blank=True, max_length=255)
     tags = ClusterTaggableManager(through=BlogPageTag, blank=True)
     date_published = models.DateField("Date article published", blank=True, null=True)
-    body = StreamField(
-        BaseStreamBlock(), verbose_name="Blog post", blank=True
-    )
 
     content_panels = BasePageFieldsMixin.content_panels + [
-        StreamFieldPanel('body'),
         FieldPanel('date_published'),
         InlinePanel(
             'blog_person_relationship', label="Author(s)",
@@ -114,6 +107,9 @@ class BlogIndexPage(BasePageFieldsMixin, RoutablePageMixin, Page):
     # What pages types can live under this page type?
     subpage_types = ['BlogPage']
 
+    def children(self):
+        return self.get_children().specific().live()
+
     def get_context(self, request):
         context = super(BlogIndexPage, self).get_context(request)
         context['posts'] = BlogPage.objects.descendant_of(
@@ -167,3 +163,8 @@ class BlogIndexPage(BasePageFieldsMixin, RoutablePageMixin, Page):
             tags += post.get_tags  # Not tags.append() because we don't want a list of lists
         tags = sorted(set(tags))
         return tags
+
+    content_panels = Page.content_panels + [
+        FieldPanel('introduction', classname="full"),
+        ImageChooserPanel('image'),
+    ]

+ 27 - 5
bakerydemo/breads/migrations/0001_initial.py

@@ -1,11 +1,14 @@
 # -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-10 12:17
+# Generated by Django 1.10.5 on 2017-03-15 07:16
 from __future__ import unicode_literals
 
 from django.db import migrations, models
 import django.db.models.deletion
+import modelcluster.fields
 import wagtail.wagtailcore.blocks
 import wagtail.wagtailcore.fields
+import wagtail.wagtailembeds.blocks
+import wagtail.wagtailimages.blocks
 
 
 class Migration(migrations.Migration):
@@ -14,30 +17,44 @@ class Migration(migrations.Migration):
 
     dependencies = [
         ('wagtailcore', '0032_add_bulk_delete_page_permission'),
-        ('wagtailimages', '0017_reduce_focal_point_key_max_length'),
+        ('wagtailimages', '0018_remove_rendition_filter'),
     ]
 
     operations = [
+        migrations.CreateModel(
+            name='BreadIngredient',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('name', models.CharField(max_length=255)),
+            ],
+            options={
+                'verbose_name_plural': 'Bread ingredients',
+            },
+        ),
         migrations.CreateModel(
             name='BreadPage',
             fields=[
                 ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
-                ('description', wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock())))),
+                ('introduction', models.TextField(blank=True, help_text='Text to describe the page')),
+                ('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Page body')),
             ],
             options={
                 'abstract': False,
             },
-            bases=('wagtailcore.page',),
+            bases=('wagtailcore.page', models.Model),
         ),
         migrations.CreateModel(
             name='BreadsIndexPage',
             fields=[
                 ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
+                ('introduction', models.TextField(blank=True, help_text='Text to describe the page')),
+                ('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Page body')),
+                ('image', models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
             ],
             options={
                 'abstract': False,
             },
-            bases=('wagtailcore.page',),
+            bases=('wagtailcore.page', models.Model),
         ),
         migrations.CreateModel(
             name='BreadType',
@@ -69,6 +86,11 @@ class Migration(migrations.Migration):
             name='image',
             field=models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
         ),
+        migrations.AddField(
+            model_name='breadpage',
+            name='ingredients',
+            field=modelcluster.fields.ParentalManyToManyField(blank=True, to='breads.BreadIngredient'),
+        ),
         migrations.AddField(
             model_name='breadpage',
             name='origin',

+ 0 - 27
bakerydemo/breads/migrations/0002_auto_20170217_0853.py

@@ -1,27 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-17 08:53
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('wagtailimages', '0018_remove_rendition_filter'),
-        ('breads', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='breadsindexpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text='Location listing image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
-        ),
-        migrations.AddField(
-            model_name='breadsindexpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text='Text to describe the index page'),
-        ),
-    ]

+ 0 - 21
bakerydemo/breads/migrations/0003_auto_20170218_1102.py

@@ -1,21 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-18 11:02
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('breads', '0002_auto_20170217_0853'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='breadsindexpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text='Listing image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
-        ),
-    ]

+ 0 - 44
bakerydemo/breads/migrations/0004_auto_20170220_0111.py

@@ -1,44 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-20 01:11
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import django.db.models.deletion
-import wagtail.wagtailcore.blocks
-import wagtail.wagtailcore.fields
-import wagtail.wagtailembeds.blocks
-import wagtail.wagtailimages.blocks
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('breads', '0003_auto_20170218_1102'),
-    ]
-
-    operations = [
-        migrations.RemoveField(
-            model_name='breadpage',
-            name='description',
-        ),
-        migrations.AddField(
-            model_name='breadpage',
-            name='body',
-            field=wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Describe the bread'),
-        ),
-        migrations.AddField(
-            model_name='breadpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text='Text to describe the page'),
-        ),
-        migrations.AlterField(
-            model_name='breadsindexpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
-        ),
-        migrations.AlterField(
-            model_name='breadsindexpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text='Text to describe the page'),
-        ),
-    ]

+ 0 - 31
bakerydemo/breads/migrations/0005_auto_20170224_1047.py

@@ -1,31 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-24 10:47
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import modelcluster.fields
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('breads', '0004_auto_20170220_0111'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='BreadIngredient',
-            fields=[
-                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
-                ('name', models.CharField(max_length=255)),
-            ],
-            options={
-                'verbose_name_plural': 'Bread ingredients',
-            },
-        ),
-        migrations.AddField(
-            model_name='breadpage',
-            name='ingredients',
-            field=modelcluster.fields.ParentalManyToManyField(blank=True, to='breads.BreadIngredient'),
-        ),
-    ]

+ 11 - 13
bakerydemo/breads/models.py

@@ -4,16 +4,12 @@ from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
 
 from modelcluster.fields import ParentalManyToManyField
 
-from wagtail.wagtailadmin.edit_handlers import (
-    FieldPanel, MultiFieldPanel, StreamFieldPanel
-)
-from wagtail.wagtailcore.fields import StreamField
+from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel
 from wagtail.wagtailcore.models import Page
-
 from wagtail.wagtailsearch import index
 from wagtail.wagtailsnippets.models import register_snippet
+from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
 
-from bakerydemo.base.blocks import BaseStreamBlock
 from bakerydemo.base.models import BasePageFieldsMixin
 
 
@@ -82,9 +78,6 @@ class BreadPage(BasePageFieldsMixin, Page):
         null=True,
         blank=True,
     )
-    body = StreamField(
-        BaseStreamBlock(), verbose_name="Describe the bread", blank=True
-    )
     bread_type = models.ForeignKey(
         'breads.BreadType',
         null=True,
@@ -95,7 +88,6 @@ class BreadPage(BasePageFieldsMixin, Page):
     ingredients = ParentalManyToManyField('BreadIngredient', blank=True)
 
     content_panels = BasePageFieldsMixin.content_panels + [
-        StreamFieldPanel('body'),
         FieldPanel('origin'),
         FieldPanel('bread_type'),
         MultiFieldPanel(
@@ -117,14 +109,12 @@ class BreadPage(BasePageFieldsMixin, Page):
 
     parent_page_types = ['BreadsIndexPage']
 
-    api_fields = ['title', 'bread_type', 'origin', 'image']
-
 
 class BreadsIndexPage(BasePageFieldsMixin, Page):
     """
     Index page for breads. We don't have any fields within our model but we need
     to alter the page model's context to return the child page objects - the
-    BreadPage - so that it works as an index page
+    BreadPage - so that it works as an index page.
     """
 
     subpage_types = ['BreadPage']
@@ -133,6 +123,9 @@ class BreadsIndexPage(BasePageFieldsMixin, Page):
         return BreadPage.objects.live().descendant_of(
             self).order_by('-first_published_at')
 
+    def children(self):
+        return self.get_children().specific().live()
+
     def paginate(self, request, *args):
         page = request.GET.get('page')
         paginator = Paginator(self.get_breads(), 12)
@@ -152,3 +145,8 @@ class BreadsIndexPage(BasePageFieldsMixin, Page):
         context['breads'] = breads
 
         return context
+
+    content_panels = Page.content_panels + [
+        FieldPanel('introduction', classname="full"),
+        ImageChooserPanel('image'),
+    ]

+ 10 - 0
bakerydemo/locations/choices.py

@@ -0,0 +1,10 @@
+
+DAY_CHOICES = (
+    ('MON', 'Monday'),
+    ('TUES', 'Tuesday'),
+    ('WED', 'Wednesday'),
+    ('THUR', 'Thursday'),
+    ('FRI', 'Friday'),
+    ('SAT', 'Saturday'),
+    ('SUN', 'Sunday'),
+)

+ 21 - 10
bakerydemo/locations/migrations/0001_initial.py

@@ -1,10 +1,15 @@
 # -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-10 12:17
+# Generated by Django 1.10.5 on 2017-03-15 07:16
 from __future__ import unicode_literals
 
+import django.core.validators
 from django.db import migrations, models
 import django.db.models.deletion
 import modelcluster.fields
+import wagtail.wagtailcore.blocks
+import wagtail.wagtailcore.fields
+import wagtail.wagtailembeds.blocks
+import wagtail.wagtailimages.blocks
 
 
 class Migration(migrations.Migration):
@@ -13,7 +18,7 @@ class Migration(migrations.Migration):
 
     dependencies = [
         ('wagtailcore', '0032_add_bulk_delete_page_permission'),
-        ('wagtailimages', '0017_reduce_focal_point_key_max_length'),
+        ('wagtailimages', '0018_remove_rendition_filter'),
     ]
 
     operations = [
@@ -22,37 +27,43 @@ class Migration(migrations.Migration):
             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)),
-                ('day', models.CharField(choices=[('MON', 'MON'), ('TUE', 'TUE'), ('WED', 'WED'), ('THU', 'THU'), ('FRI', 'FRI'), ('SAT', 'SAT'), ('SUN', 'SUN')], default='MON', max_length=3)),
-                ('opening_time', models.TimeField()),
-                ('closing_time', models.TimeField()),
+                ('day', models.CharField(choices=[('MON', 'Monday'), ('TUES', 'Tuesday'), ('WED', 'Wednesday'), ('THUR', 'Thursday'), ('FRI', 'Friday'), ('SAT', 'Saturday'), ('SUN', 'Sunday')], default='MON', max_length=4)),
+                ('opening_time', models.TimeField(blank=True, null=True)),
+                ('closing_time', models.TimeField(blank=True, null=True)),
+                ('closed', models.BooleanField(help_text='Tick if location is closed on this day', verbose_name='Closed?')),
             ],
             options={
-                'abstract': False,
                 'ordering': ['sort_order'],
+                'abstract': False,
             },
         ),
         migrations.CreateModel(
             name='LocationPage',
             fields=[
                 ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
+                ('introduction', models.TextField(blank=True, help_text='Text to describe the page')),
+                ('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Page body')),
                 ('address', models.TextField()),
-                ('lat_long', models.CharField(help_text="Comma separated lat/long. (Ex. 64.144367, -21.939182)                    Right click Google Maps and click 'What's Here'", max_length=36)),
-                ('image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
+                ('lat_long', models.CharField(help_text="Comma separated lat/long. (Ex. 64.144367, -21.939182)                    Right click Google Maps and select 'What's Here'", max_length=36, validators=[django.core.validators.RegexValidator(code='invalid_lat_long', message='Lat Long must be a comma-separated numeric lat and long', regex='^(\\-?\\d+(\\.\\d+)?),\\s*(\\-?\\d+(\\.\\d+)?)$')])),
+                ('image', models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
             ],
             options={
                 'abstract': False,
             },
-            bases=('wagtailcore.page',),
+            bases=('wagtailcore.page', models.Model),
         ),
         migrations.CreateModel(
             name='LocationsIndexPage',
             fields=[
                 ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
+                ('introduction', models.TextField(blank=True, help_text='Text to describe the page')),
+                ('body', wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Page body')),
+                ('image', models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
             ],
             options={
                 'abstract': False,
             },
-            bases=('wagtailcore.page',),
+            bases=('wagtailcore.page', models.Model),
         ),
         migrations.AddField(
             model_name='locationoperatinghours',

+ 0 - 21
bakerydemo/locations/migrations/0002_auto_20170211_2229.py

@@ -1,21 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-11 22:29
-from __future__ import unicode_literals
-
-import django.core.validators
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('locations', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='locationpage',
-            name='lat_long',
-            field=models.CharField(help_text="Comma separated lat/long. (Ex. 64.144367, -21.939182)                    Right click Google Maps and click 'What's Here'", max_length=36, validators=[django.core.validators.RegexValidator(code='invalid_lat_long', message='Lat Long must be a comma separated numeric lat and long', regex='^(\\-?\\d+(\\.\\d+)?),\\s*(\\-?\\d+(\\.\\d+)?)$')]),
-        ),
-    ]

+ 0 - 26
bakerydemo/locations/migrations/0003_auto_20170214_2220.py

@@ -1,26 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-14 22:20
-from __future__ import unicode_literals
-
-import django.core.validators
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('locations', '0002_auto_20170211_2229'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='locationoperatinghours',
-            name='day',
-            field=models.CharField(choices=[('Mon', 'Mon'), ('Tue', 'Tue'), ('Wed', 'Weds'), ('Thu', 'Thu'), ('Fri', 'Fri'), ('Sat', 'Sat'), ('Sun', 'Sun')], default='Mon', max_length=4),
-        ),
-        migrations.AlterField(
-            model_name='locationpage',
-            name='lat_long',
-            field=models.CharField(help_text="Comma separated lat/long. (Ex. 64.144367, -21.939182)                    Right click Google Maps and select 'What's Here'", max_length=36, validators=[django.core.validators.RegexValidator(code='invalid_lat_long', message='Lat Long must be a comma-separated numeric lat and long', regex='^(\\-?\\d+(\\.\\d+)?),\\s*(\\-?\\d+(\\.\\d+)?)$')]),
-        ),
-    ]

+ 0 - 21
bakerydemo/locations/migrations/0003_auto_20170215_0723.py

@@ -1,21 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-15 07:23
-from __future__ import unicode_literals
-
-import django.core.validators
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('locations', '0002_auto_20170211_2229'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='locationpage',
-            name='lat_long',
-            field=models.CharField(help_text="Comma separated lat/long. (Ex. 64.144367, -21.939182)                    Right click Google Maps and select 'What's Here'", max_length=36, validators=[django.core.validators.RegexValidator(code='invalid_lat_long', message='Lat Long must be a comma-separated numeric lat and long', regex='^(\\-?\\d+(\\.\\d+)?),\\s*(\\-?\\d+(\\.\\d+)?)$')]),
-        ),
-    ]

+ 0 - 29
bakerydemo/locations/migrations/0004_auto_20170215_1334.py

@@ -1,29 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-15 13:34
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import wagtail.wagtailcore.blocks
-import wagtail.wagtailcore.fields
-import wagtail.wagtailembeds.blocks
-import wagtail.wagtailimages.blocks
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('locations', '0003_auto_20170214_2220'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='locationpage',
-            name='body',
-            field=wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='About page detail'),
-        ),
-        migrations.AddField(
-            model_name='locationpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text='Text to describe the index page'),
-        ),
-    ]

+ 0 - 22
bakerydemo/locations/migrations/0004_locationsindexpage_image.py

@@ -1,22 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-17 08:20
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('wagtailimages', '0018_remove_rendition_filter'),
-        ('locations', '0003_auto_20170215_0723'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='locationsindexpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text='Location listing image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
-        ),
-    ]

+ 0 - 21
bakerydemo/locations/migrations/0005_locationoperatinghours_closed.py

@@ -1,21 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-15 13:38
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('locations', '0004_auto_20170215_1334'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='locationoperatinghours',
-            name='closed',
-            field=models.BooleanField(default='False', help_text='Tick if location is closed', verbose_name='Closed?'),
-            preserve_default=False,
-        ),
-    ]

+ 0 - 20
bakerydemo/locations/migrations/0005_locationsindexpage_introduction.py

@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-17 08:24
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('locations', '0004_locationsindexpage_image'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='locationsindexpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text='Text to describe the index page'),
-        ),
-    ]

+ 0 - 30
bakerydemo/locations/migrations/0006_auto_20170215_1408.py

@@ -1,30 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-15 14:08
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('locations', '0005_locationoperatinghours_closed'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='locationoperatinghours',
-            name='closed',
-            field=models.BooleanField(help_text='Tick if location is closed on this day', verbose_name='Closed?'),
-        ),
-        migrations.AlterField(
-            model_name='locationoperatinghours',
-            name='closing_time',
-            field=models.TimeField(blank=True),
-        ),
-        migrations.AlterField(
-            model_name='locationoperatinghours',
-            name='opening_time',
-            field=models.TimeField(blank=True),
-        ),
-    ]

+ 0 - 21
bakerydemo/locations/migrations/0006_auto_20170218_1102.py

@@ -1,21 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-18 11:02
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('locations', '0005_locationsindexpage_introduction'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='locationsindexpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text='Listing image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
-        ),
-    ]

+ 0 - 25
bakerydemo/locations/migrations/0007_auto_20170215_1411.py

@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-15 14:11
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('locations', '0006_auto_20170215_1408'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='locationoperatinghours',
-            name='closing_time',
-            field=models.TimeField(blank=True, null=True),
-        ),
-        migrations.AlterField(
-            model_name='locationoperatinghours',
-            name='opening_time',
-            field=models.TimeField(blank=True, null=True),
-        ),
-    ]

+ 0 - 16
bakerydemo/locations/migrations/0008_merge_20170218_0921.py

@@ -1,16 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-18 09:21
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('locations', '0007_auto_20170215_1411'),
-        ('locations', '0005_locationsindexpage_introduction'),
-    ]
-
-    operations = [
-    ]

+ 0 - 24
bakerydemo/locations/migrations/0009_auto_20170219_0942.py

@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-19 09:42
-from __future__ import unicode_literals
-
-from django.db import migrations
-import wagtail.wagtailcore.blocks
-import wagtail.wagtailcore.fields
-import wagtail.wagtailembeds.blocks
-import wagtail.wagtailimages.blocks
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('locations', '0008_merge_20170218_0921'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='locationpage',
-            name='body',
-            field=wagtail.wagtailcore.fields.StreamField((('heading_block', wagtail.wagtailcore.blocks.StructBlock((('heading_text', wagtail.wagtailcore.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.wagtailcore.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.wagtailcore.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('block_quote', wagtail.wagtailcore.blocks.StructBlock((('text', wagtail.wagtailcore.blocks.TextBlock()), ('attribute_name', wagtail.wagtailcore.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.wagtailembeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='About this location'),
-        ),
-    ]

+ 0 - 16
bakerydemo/locations/migrations/0010_merge_20170220_0111.py

@@ -1,16 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-20 01:11
-from __future__ import unicode_literals
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('locations', '0009_auto_20170219_0942'),
-        ('locations', '0006_auto_20170218_1102'),
-    ]
-
-    operations = [
-    ]

+ 0 - 36
bakerydemo/locations/migrations/0011_auto_20170220_0111.py

@@ -1,36 +0,0 @@
-# -*- coding: utf-8 -*-
-# Generated by Django 1.10.5 on 2017-02-20 01:11
-from __future__ import unicode_literals
-
-from django.db import migrations, models
-import django.db.models.deletion
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('locations', '0010_merge_20170220_0111'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='locationpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
-        ),
-        migrations.AlterField(
-            model_name='locationpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text='Text to describe the page'),
-        ),
-        migrations.AlterField(
-            model_name='locationsindexpage',
-            name='image',
-            field=models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
-        ),
-        migrations.AlterField(
-            model_name='locationsindexpage',
-            name='introduction',
-            field=models.TextField(blank=True, help_text='Text to describe the page'),
-        ),
-    ]

+ 14 - 32
bakerydemo/locations/models.py

@@ -6,44 +6,24 @@ from django.db import models
 
 from modelcluster.fields import ParentalKey
 
-from wagtail.wagtailadmin.edit_handlers import (
-    FieldPanel,
-    InlinePanel,
-    StreamFieldPanel)
+from wagtail.wagtailadmin.edit_handlers import FieldPanel, InlinePanel
 from wagtail.wagtailcore.models import Orderable, Page
-from wagtail.wagtailcore.fields import StreamField
 from wagtail.wagtailsearch import index
+from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
 
 from bakerydemo.base.models import BasePageFieldsMixin
-from bakerydemo.base.blocks import BaseStreamBlock
+from bakerydemo.locations.choices import DAY_CHOICES
 
 
 class OperatingHours(models.Model):
     """
     Django model to capture operating hours for a Location
     """
-    MONDAY = 'Mon'
-    TUESDAY = 'Tue'
-    WEDNESDAY = 'Wed'
-    THURSDAY = 'Thu'
-    FRIDAY = 'Fri'
-    SATURDAY = 'Sat'
-    SUNDAY = 'Sun'
-
-    DAY_CHOICES = (
-        (MONDAY, 'Mon'),
-        (TUESDAY, 'Tue'),
-        (WEDNESDAY, 'Weds'),
-        (THURSDAY, 'Thu'),
-        (FRIDAY, 'Fri'),
-        (SATURDAY, 'Sat'),
-        (SUNDAY, 'Sun'),
-    )
 
     day = models.CharField(
         max_length=4,
         choices=DAY_CHOICES,
-        default=MONDAY,
+        default='MON'
     )
     opening_time = models.TimeField(
         blank=True,
@@ -100,6 +80,9 @@ class LocationsIndexPage(BasePageFieldsMixin, Page):
     """
     subpage_types = ['LocationPage']
 
+    def children(self):
+        return self.get_children().specific().live()
+
     def get_context(self, request):
         context = super(LocationsIndexPage, self).get_context(request)
         context['locations'] = LocationPage.objects.descendant_of(
@@ -107,6 +90,11 @@ class LocationsIndexPage(BasePageFieldsMixin, Page):
             'title')
         return context
 
+    content_panels = Page.content_panels + [
+        FieldPanel('introduction', classname="full"),
+        ImageChooserPanel('image'),
+    ]
+
 
 class LocationPage(BasePageFieldsMixin, Page):
     """
@@ -125,22 +113,15 @@ class LocationPage(BasePageFieldsMixin, Page):
             ),
         ]
     )
-    body = StreamField(
-        BaseStreamBlock(), verbose_name="About this location", blank=True
-    )
-    # We've defined the StreamBlock() within blocks.py that we've imported on
-    # line 12. Defining it in a different file gives us consistency across the
-    # site, though StreamFields _can_ be created on a per model basis if you
-    # have a use case for it
 
     # Search index configuration
     search_fields = Page.search_fields + [
         index.SearchField('address'),
+        index.SearchField('body'),
     ]
 
     # Editor panels configuration
     content_panels = BasePageFieldsMixin.content_panels + [
-        StreamFieldPanel('body'),
         FieldPanel('address', classname="full"),
         FieldPanel('lat_long'),
         InlinePanel('hours_of_operation', label="Hours of Operation"),
@@ -173,6 +154,7 @@ class LocationPage(BasePageFieldsMixin, Page):
         context = super(LocationPage, self).get_context(request)
         context['lat'] = self.lat_long.split(",")[0]
         context['long'] = self.lat_long.split(",")[1]
+        context['google_map_api_key'] = settings.GOOGLE_MAP_API_KEY
         return context
 
     parent_page_types = ['LocationsIndexPage']

+ 3 - 2
bakerydemo/settings/base.py

@@ -162,6 +162,9 @@ STATIC_URL = '/static/'
 MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
 MEDIA_URL = '/media/'
 
+# Override in local settings or replace with your own key. Please don't use our demo key in production!
+GOOGLE_MAP_API_KEY = 'AIzaSyD31CT9P9KxvNUJOwDq2kcFEIG8ADgaFgw'
+
 # Use Elasticsearch as the search backend for extra performance and better search results
 WAGTAILSEARCH_BACKENDS = {
     'default': {
@@ -170,7 +173,5 @@ WAGTAILSEARCH_BACKENDS = {
     },
 }
 
-
 # Wagtail settings
-
 WAGTAIL_SITE_NAME = "bakerydemo"

+ 253 - 3
bakerydemo/static/css/main.css

@@ -20,7 +20,7 @@ body {
 }
 
 h1 {
-  font-weight: 900;
+  font-weight: 300;
   font-family: 'Lato', sans-serif;
   position: relative;
 }
@@ -494,8 +494,8 @@ li.has-submenu a.allow-toggle {
 }
 
 .breadcrumb-container {
-  /*background-color: rgba(21, 38, 44, 0.8);*/
   background: linear-gradient(to right, rgba(21,38,44,0.8) 0%,rgba(0,0,0,0.9) 100%);
+  margin-top: -1px;
   position: relative;
   z-index: 3;
 }
@@ -809,7 +809,8 @@ span.outline {
   margin-right: 10px;
 }
 
-.form-page .fieldWrapper ul, li {
+.form-page .fieldWrapper ul, 
+.form-page .fieldWrapper li {
   list-style: none;
   padding: 0;
   margin: 0;
@@ -846,6 +847,230 @@ span.outline {
   }
 }
 
+/* Homepage */
+.homepage .hero {
+  margin: 0;
+  padding: 200px 0 30px 0;
+}
+
+.homepage .hero h1 {
+  font-size: 2.2em;
+  text-transform: uppercase;
+}
+
+.homepage .hero h1:after {
+  background-color: rgba(255,255,255, 0.7);
+  content: "";
+  display: block;
+  height: 5px;
+  margin: 20px auto;
+  width: 250px;
+}
+
+.homepage .home-hero {
+  margin-bottom: 0;
+  padding-bottom: 60px;
+  text-align: center;
+}
+.homepage .home-hero .lead {
+  color: #ddd;
+  font-size: 1.6em;
+  margin: 40px auto;
+}
+
+.homepage .home-hero .hero-cta-link {
+  color: #fff;
+  border: 1px solid #aaa;
+  border-radius: 4px;
+  padding: 10px 34px 10px 10px;
+  display: inline-block;
+  vertical-align: middle;
+  transform: perspective(1px) translateZ(0);
+  box-shadow: 0 0 1px transparent;
+  position: relative;
+  transition-duration: 0.1s;
+}
+.homepage .home-hero .hero-cta-link:before {
+  content: "\f18e";
+  font-family: FontAwesome;
+  font-size: 1.2em;
+  font-weight: 200;
+  opacity: 0.8;
+  padding: 0 1px;
+  position: absolute;
+  right: 0.2em;
+  top: 0.2em;
+  transform: translateZ(0);
+  transition-duration: 0.1s;
+  transition-property: transform;
+  transition-timing-function: ease-out;
+}
+.homepage .home-hero .hero-cta-link:hover:before,
+.homepage .home-hero .hero-cta-link:focus:before,
+.homepage .home-hero .hero-cta-link:active:before {
+  transform: translateX(4px);
+}
+
+.homepage .streamfield {
+  background: linear-gradient(45deg, rgba(170,170,170,1) 0%,rgba(238,238,238,1) 44%);
+}
+.homepage .streamfield-column {
+  padding: 60px;
+  margin: 0 auto;
+  float: none;
+}
+.homepage .streamfield-column h1,
+.homepage .streamfield-column h2,
+.homepage .streamfield-column h3,
+.homepage .streamfield-column h4,
+.homepage .streamfield-column h5 {
+  text-align: center;
+}
+
+.homepage .promo-row {
+  padding: 40px 0 40px 0;
+}
+.homepage .promo {
+  background: linear-gradient(190deg, rgba(0,4,8,1) 0%,rgba(55,28,25,1) 100%);
+  border-radius: 0px 0px 10px 10px;
+  color: #fff;
+  height: 100%;
+  margin-bottom: 20px;
+  margin-top: -40px;
+  padding: 40px 60px;
+  text-align: center;
+}
+.homepage .promo h1,
+.homepage .promo h2,
+.homepage .promo h3,
+.homepage .promo h4 {
+  color: #eb7400;
+  font-weight: 200;
+}
+.homepage .promo p,
+.homepage .promo li {
+  color: #ccc;
+  line-height: 1.6em;
+}
+.homepage .promo a {
+  color: #fff;
+}
+@media (max-width: 970px) {
+  .homepage .promo {
+    padding: 30px 40px;
+  }
+  .homepage .promo figure img {
+    max-width: 120px;
+    height: auto;
+  }
+  .homepage .promo p {
+    color: #fff;
+    font-size: 1em;
+  }
+}
+@media (max-width: 766px) {
+  .homepage .promo {
+    margin-left: 15px;
+    margin-right: 15px;
+  }
+}
+
+.homepage .promo figure img {
+  border-radius: 100%;
+  margin: auto;
+  width: auto;
+}
+
+.homepage .feature-1 h2 {
+  margin-top: 0;
+  margin-bottom: 20px;
+}
+
+.homepage .feature-1 .featured-children li {
+  border: 1px solid #ccc;
+  border-radius: 3px;
+  margin-bottom: 10px;
+}
+
+.homepage .feature-1 .featured-children li figure {
+  width: 100%;
+  overflow: hidden;
+  margin: 0;
+}
+
+.homepage .feature-1 .featured-children li img {
+  width: auto;
+}
+
+.homepage .feature-1 .featured-children li h3 {
+  margin-top: 40px;
+  font-weight: 300;
+  font-size: 1.4em;
+}
+
+.homepage .feature-2 {
+  padding: 40px 0 20px;
+}
+
+.homepage .feature-2 .feature-2-row {
+  display: flex;
+  flex-wrap: wrap;
+}
+
+.homepage .feature-2 h2,
+.homepage .feature-3 h2 {
+  text-align: center;
+  margin: 20px;
+}
+
+.homepage .feature-2 .feature-2-item {
+  display: flex;
+  flex-direction: column;
+  margin: 0 auto 20px;
+}
+
+.homepage .feature-2 .feature-2-item figure {
+  margin-bottom: 0;
+}
+
+.homepage .feature-2 .feature-2-item img {
+  min-height: 210px;
+}
+
+.homepage .feature-2 .feature-2-item .feature-2-text {
+  background-color: #dfdfdf;
+  border-radius: 0 0 10px 10px;
+  padding: 0 20px;
+  flex: 1;
+}
+
+.homepage .feature-2 figure,
+.homepage .feature-3 figure {
+  background-color: #eb7400;
+  margin: 0;
+}
+
+@media (max-width: 766px) {
+  .homepage .feature-2 .feature-2-row {
+    display: inline-block;
+  }
+}
+
+.homepage .feature-3 h3 {
+  color: #fff;
+  font-weight: 300;
+  font-size: 1.8em;
+  margin-bottom: 135px;
+  margin-top: -145px;
+  position: relative;
+  text-align: center;
+  text-shadow: 0px 0px 30px rgba(0, 0, 0, 1);
+  z-index: 1;
+}
+.homepage .feature-2 li:hover img,
+.homepage .feature-3 li:hover img {
+  opacity: 0.3;
+}
 /* No gutters */
 .row.no-gutters {
   margin-right: 0;
@@ -876,3 +1101,28 @@ span.outline {
     display: none;
   }
 }
+
+/* From Wagtail core */
+/* Responsive image/video classes */
+.rich-text img {
+    max-width: 100%;
+    height: auto;
+}
+.richtext-image.left{
+    float:left;
+}
+.richtext-image.right{
+    float:right;
+}
+.responsive-object {
+    position: relative;
+}
+.responsive-object iframe,
+.responsive-object object,
+.responsive-object embed {
+    position: absolute;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+}

+ 3 - 3
bakerydemo/templates/base.html

@@ -8,8 +8,8 @@
 {% wagtailuserbar %}
 
 {% block header %}
-    {% include "includes/header.html" with parent=site_root calling_page=self %}
     {# Header contains the main_navigation block #}
+    {% include "includes/header.html" with parent=site_root calling_page=self %}
 {% endblock header %}
 
 {% block head-extra %}
@@ -21,11 +21,11 @@
 
 
 {% block breadcrumbs %}
-    {% breadcrumbs %}
     {# breadcrumbs is defined in base/templatetags/navigation_tags.py #}
+    {% breadcrumbs %}
 {% endblock breadcrumbs %}
 
-<content>
+<content role="main">
     {% block content %}
     {% endblock content %}
 </content>

+ 4 - 4
bakerydemo/templates/base/form_page.html

@@ -21,18 +21,18 @@
         You could render your form using a Django rendering shortcut such as `{{ form.as_p }}` but that will tend towards unsemantic code, and make it difficult to style. You can read more on Django form at:
         https://docs.djangoproject.com/en/1.10/topics/forms/#form-rendering-options
         {% endcomment %}
-            <form action="{% pageurl page %}" method="POST">
+            <form action="{% pageurl page %}" method="POST" role="form">
                 {% csrf_token %}
                 {% if form.subject.errors %}
-                    <ol>
+                    <ol role="alertdialog">
                     {% for error in form.subject.errors %}
-                        <li><strong>{{ error|escape }}</strong></li>
+                        <li role="alert"><strong>{{ error|escape }}</strong></li>
                     {% endfor %}
                     </ol>
                 {% endif %}
 
                 {% for field in form %}
-                    <div class="fieldWrapper">
+                    <div class="fieldWrapper" aria-required={% if field.field.required %}"true"{% else %}"false"{% endif %}>
                         
                         {{ field.label_tag }}{% if field.field.required %}<span class="required">*</span>{% endif %}
 

+ 123 - 2
bakerydemo/templates/base/home_page.html

@@ -1,7 +1,128 @@
 {% extends "base.html" %}
-{% load wagtailimages_tags %}
+{% load wagtailimages_tags wagtailcore_tags %}
 
 {% block content %}
+<div class="homepage">
 
-    {{ page.body }}
+{% image page.image fill-1920x600 as image %}
+<div class="container-fluid hero" style="background-image:url('{{ image.url }}')">
+    <div class="hero-gradient-mask"></div>
+    <div class="container">
+        <div class="row">
+            <div class="col-md-8 col-md-offset-2 home-hero">
+                <h1>{{ page.title }}</h1>
+                <p class="lead">{{ page.hero_text }}</p>
+                <a href="{% pageurl page.hero_cta_link %}" class="hero-cta-link hvr-icon-forward">
+                    {{ page.hero_cta }}
+                </a>
+            </div>
+        </div>
+    </div>
+</div>
+
+<div class="container">
+    <div class="row promo-row">
+        <div class="col-sm-5 promo">
+            {% if page.promo_image or page.promo_title or page.promo_text %}
+                <figure>{% image page.promo_image fill-200x200-c100 %}</figure>
+                <div class="promo-text">
+                    <h3>{{ page.promo_title }}</h3>
+                    {{ page.promo_text|safe }}
+                </div>
+            {% endif %}
+        </div>
+
+        <div class="col-sm-6 col-sm-offset-1 feature-1">
+            {% if page.featured_section_1 %}
+            <h2>{{ page.featured_section_1_title }}</h2>
+                <div class="featured-children">
+                    {% for childpage in page.featured_section_1.specific.children|slice:"4" %}
+                        <li>
+                            <div class="row">
+                                <div class="col-xs-4">
+                                    <a href="{{childpage.url}}">
+                                        <figure>
+                                            {% image childpage.image fill-180x140-c100 %}
+                                        </figure>
+                                    </a>
+                                </div>
+                                <div class="col-xs-8">
+                                    <h3><a href="{{childpage.url}}">{{childpage.title}}</a></h3>
+                                </div>
+                            </div>
+                        </li>
+                    {% endfor %}
+                </div>
+            {% endif %}
+        </div>
+    </div>
+</div>
+
+{% if page.body %}
+<div class="container-fluid streamfield">
+    <div class="container">
+        <div class="row">
+            <div class="col-md-7 streamfield-column">
+                {{ page.body }}
+            </div>
+        </div>
+    </div>
+</div>
+{% endif %}
+
+<div class="container">
+    <div class="row">
+        <div class="col-md-12 feature-2">
+            {% if page.featured_section_2 %}
+            <h2>{{ page.featured_section_2_title }}</h2>
+                <div class="featured-children row feature-2-row">
+                    {% for childpage in page.featured_section_2.specific.children|slice:"3" %}
+                        <li class="col-sm-4 feature-2-item">
+                            <a href="{{childpage.url}}">
+                                <figure>
+                                    {% image childpage.image height-210 %}
+                                </figure>
+                            </a>
+                            <div class="feature-2-text">
+                                <h3><a href="{{childpage.url}}">{{childpage.title}}</a></h3>
+                                <p>{{ childpage.introduction|truncatewords:15 }}</p>
+                            </div>
+                        </li>
+                    {% endfor %}
+                </div>
+            {% endif %}
+        </div>
+    </div>
+</div>
+
+<div class="container">
+    <div class="row">
+        <div class="col-md-12 feature-3">
+            {% if page.featured_section_3 %}
+            <h2>{{ page.featured_section_3_title }}</h2>
+                <div class="featured-children row">
+                    {% for childpage in page.featured_section_3.specific.children|slice:"6" %}
+                        <li class="col-md-4">
+                            <a href="{{childpage.url}}">
+                                <figure>
+                                    {% image childpage.image width-380 %}
+                                </figure>
+                                <h3>{{childpage.title}}</h3>
+                            </a>
+                        </li>
+                    {% endfor %}
+                </div>
+            {% endif %}
+        </div>
+    </div>
+</div>
+</div>
 {% endblock content %}
+
+HERO
+----
+promo | bread
+-----
+Blog x3
+-----
+Location x 6

+ 6 - 0
bakerydemo/templates/base/include/header-hero.html

@@ -8,6 +8,9 @@
             <div class="row">
                 <div class="col-md-7">
                     <h1>{{ page.title }}</h1>
+                    {% if page.subtitle %}
+                        <p class="stand-first">{{ page.subtitle }}</p>
+                    {% endif %}
                 </div>
             </div>
         </div>
@@ -17,6 +20,9 @@
         <div class="row">
             <div class="col-md-7">
                 <h1>{{ page.title }}</h1>
+                {% if page.subtitle %}
+                    <p class="stand-first">{{ page.subtitle }}</p>
+                {% endif %}
             </div>
         </div>
     </div>

+ 5 - 5
bakerydemo/templates/base/about_page.html → bakerydemo/templates/base/standard_page.html

@@ -4,11 +4,11 @@
 {% block content %}
     {% include "base/include/header.html" %}
 
-<div class="container">
-    <div class="row">
-        <div class="col-md-7">
-            {{ page.body }}
+    <div class="container">
+        <div class="row">
+            <div class="col-md-7">
+                {{ page.body }}
+            </div>
         </div>
     </div>
-</div>
 {% endblock content %}

+ 0 - 1
bakerydemo/templates/blocks/intro_block.htm

@@ -1 +0,0 @@
-intro_block.html

+ 3 - 1
bakerydemo/templates/blog/blog_index_page.html

@@ -35,7 +35,9 @@
                                 <p>{{ blog.introduction|truncatewords:15 }}</p>
                             </div>
                             <div class="small footer">
-                                {{ blog.date_published }} by
+                                {% if blog.date_published %}
+                                    {{ blog.date_published }} by 
+                                {% endif %}
                                 {% for author in blog.authors %}
                                     {{ author }}{% if not forloop.last %}, {% endif %}
                                 {% endfor %}

+ 2 - 12
bakerydemo/templates/blog/blog_page.html

@@ -4,21 +4,11 @@
 {% block content %}
 
 {% image self.image fill-1920x600 as hero_img %}
-<div class="container-fluid hero" style="background-image:url('{{ hero_img.url }}')">
-<div class="hero-gradient-mask"></div>
-    <div class="container">
-        <div class="row">
-            <div class="col-md-7 col-md-offset-2">
-                <h1>{{ page.title }}</h1>
-                <p class="stand-first">{{ page.subtitle }}</p>
-            </div>
-        </div>
-    </div>
-</div>
+    {% include "base/include/header-hero.html" %}
 
 <div class="container">
     <div class="row">
-        <div class="col-md-7 col-md-offset-2">
+        <div class="col-md-8">
             {% if page.introduction %}
                 <p class="intro">{{ page.introduction }}</p>
             {% endif %}

+ 7 - 7
bakerydemo/templates/includes/footer.html

@@ -1,30 +1,30 @@
 {% load navigation_tags static %}
 
-<div class="container">
+<div class="container" role="contentinfo">
     <div class="row">
         <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
             <ul class="list-inline text-center">
                 <li>
-                    <a href="#">
+                    <a href="https://github.com/wagtail/wagtail">
                         <span class="fa-stack fa-lg">
                             <i class="fa fa-circle fa-stack-2x"></i>
-                            <i class="fa fa-twitter fa-stack-1x fa-inverse"></i>
+                            <i class="fa fa-github fa-stack-1x fa-inverse"></i>
                         </span>
                     </a>
                 </li>
                 <li>
-                    <a href="#">
+                    <a href="https://twitter.com/wagtailcms" target="_blank">
                         <span class="fa-stack fa-lg">
                             <i class="fa fa-circle fa-stack-2x"></i>
-                            <i class="fa fa-facebook fa-stack-1x fa-inverse"></i>
+                            <i class="fa fa-twitter fa-stack-1x fa-inverse"></i>
                         </span>
                     </a>
                 </li>
                 <li>
-                    <a href="#">
+                    <a href="https://wagtail.io/" target="_blank">
                         <span class="fa-stack fa-lg">
                             <i class="fa fa-circle fa-stack-2x"></i>
-                            <i class="fa fa-github fa-stack-1x fa-inverse"></i>
+                            <i class="fa fa-link fa-stack-1x fa-inverse"></i>
                         </span>
                     </a>
                 </li>

+ 31 - 30
bakerydemo/templates/includes/header.html

@@ -1,32 +1,33 @@
 {% load navigation_tags %}
-<div class="header clearfix">
-  <div class="container">
-    <div class="row">
-      <div class="col-lg-12">
-        <a href="#" class="logo">The Wagtail Bakery</a>
-          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-navigation" aria-expanded="false">
-            <span class="sr-only">Toggle navigation</span>
-            <span class="icon-bar"></span>
-            <span class="icon-bar"></span>
-            <span class="icon-bar"></span>
-          </button>
-        <form action="/search" method="get" class="search" _lpchecked="1">
-          <input name="q" type="text" placeholder="Search the site" id="" aria-label="Search the site" autocomplete="off">
-          <a href="#" class="search-icon">
-            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 451 451"><path d="M447.05 428l-109.6-109.6c29.4-33.8 47.2-77.9 47.2-126.1C384.65 86.2 298.35 0 192.35 0 86.25 0 .05 86.3.05 192.3s86.3 192.3 192.3 192.3c48.2 0 92.3-17.8 126.1-47.2L428.05 447c2.6 2.6 6.1 4 9.5 4s6.9-1.3 9.5-4c5.2-5.2 5.2-13.8 0-19zM26.95 192.3c0-91.2 74.2-165.3 165.3-165.3 91.2 0 165.3 74.2 165.3 165.3s-74.1 165.4-165.3 165.4c-91.1 0-165.3-74.2-165.3-165.4z"></path></svg>
-          </a>
-        </form>
-        
-        {% block main_navigation %}
-          <nav class="collapse navbar-collapse" id="main-navigation">
-            <ul class="nav nav-pills">
-              {% get_site_root as site_root %}
-              {% top_menu parent=site_root calling_page=self %}
-              {# main_menu is defined in base/templatetags/navigation_tags.py #}
-            </ul>
-          </nav>
-        {% endblock %}
-      </div>
+<div class="header clearfix" role="banner">
+    <div class="container">
+        <div class="row">
+            <div class="col-lg-12">
+                <a href="/" class="logo">The Wagtail Bakery</a>
+                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-navigation" aria-label="Mobile menu" aria-expanded="false">
+                        <span class="sr-only">Toggle navigation</span>
+                        <span class="icon-bar"></span>
+                        <span class="icon-bar"></span>
+                        <span class="icon-bar"></span>
+                    </button>
+
+                <form action="/search" method="get" class="search" _lpchecked="1" role="search">
+                    <input name="q" type="text" placeholder="Search the site" id="" aria-label="Search the site" autocomplete="off">
+                    <a href="#" class="search-icon">
+                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 451 451"><path d="M447.05 428l-109.6-109.6c29.4-33.8 47.2-77.9 47.2-126.1C384.65 86.2 298.35 0 192.35 0 86.25 0 .05 86.3.05 192.3s86.3 192.3 192.3 192.3c48.2 0 92.3-17.8 126.1-47.2L428.05 447c2.6 2.6 6.1 4 9.5 4s6.9-1.3 9.5-4c5.2-5.2 5.2-13.8 0-19zM26.95 192.3c0-91.2 74.2-165.3 165.3-165.3 91.2 0 165.3 74.2 165.3 165.3s-74.1 165.4-165.3 165.4c-91.1 0-165.3-74.2-165.3-165.4z"></path></svg>
+                    </a>
+                </form>
+
+                {% block main_navigation %}
+                    <nav class="collapse navbar-collapse" id="main-navigation" role="navigation" aria-label="Primary site navigation">
+                        <ul class="nav nav-pills">
+                            {# main_menu is defined in base/templatetags/navigation_tags.py #}
+                            {% get_site_root as site_root %}
+                            {% top_menu parent=site_root calling_page=self %}
+                        </ul>
+                    </nav>
+                {% endblock %}
+            </div>
+        </div>
     </div>
-  </div> 
-</div>
+</div>

+ 2 - 2
bakerydemo/templates/includes/messages.html

@@ -1,8 +1,8 @@
 {% if messages %}
-    <div>
+    <div role="alertdialog">
         <ul class="messages">
             {% for message in messages %}
-            <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
+            <li{% if message.tags %} class="{{ message.tags }}"{% endif %} role="alert">{{ message }}</li>
             {% endfor %}
         </ul>
     </div>

+ 81 - 81
bakerydemo/templates/locations/location_page.html

@@ -5,107 +5,107 @@
     <style>
         /* Following two selectors needed for Google map embed */
         #map {
-          height: 100%;
+            height: 100%;
         }
     </style>
 {% endblock head-extra %}
 
 {% block content %}
-{# @TODO This is identical to the header within blog_page.html. We should create an include #}
-{% image self.image fill-1920x600 as hero_img %}
-<div class="container-fluid hero" style="background-image:url('{{ hero_img.url }}')">
-<div class="hero-gradient-mask"></div>
-    <div class="container">
-        <div class="row">
-            <div class="col-md-7">
-                <h1>{{ page.title }}</h1>
-                <p class="stand-first">
-                {% if page.is_open %}
-                  This location is currently open
-                {% else %}
-                  Sorry, this location is currently closed
-                {% endif %}
-                </p>
+    {% image self.image fill-1920x600 as hero_img %}
+    <div class="container-fluid hero" style="background-image:url('{{ hero_img.url }}')">
+        <div class="hero-gradient-mask"></div>
+            <div class="container">
+                <div class="row">
+                    <div class="col-md-7">
+                        <h1>{{ page.title }}</h1>
+                        <p class="stand-first">
+                            {% if page.is_open %}
+                                This location is currently open
+                            {% else %}
+                                Sorry, this location is currently closed
+                            {% endif %}
+                        </p>
+                    </div>
+                </div>
             </div>
         </div>
-    </div>
-</div>
 
-<div class="container">
-    <div class="row">
-        <div class="col-md-7">
-          <div class="row">
-            {% if page.introduction %}
-                <div class="intro col-md-7"><p>{{ page.introduction }}</p></div>
-            {% endif %}
+        <div class="container">
+            <div class="row">
+                <div class="col-md-7">
+                    <div class="row">
+                    {% if page.introduction %}
+                        <div class="intro col-md-7"><p>{{ page.introduction }}</p></div>
+                    {% endif %}
 
-            {% if page.operating_hours %}
-                <div class="col-md-4 col-md-offset-1 location-opening">
-                <h3>Opening hours</h3>
-                {% for hours in page.operating_hours %}
-                  <time itemprop="openingHours" datetime="{{ hours }}" class="location-time">
-                    <span class="day">{{ hours.day }}</span>:
-                    <span class="hours">
-                      {% if hours.closed == True %}
-                        Closed
-                        {% else %}
-                        {% if hours.opening_time %}
-                          {{ hours.opening_time }}
-                        {% endif %} -
-                        {% if hours.closing_time %}
-                          {{ hours.closing_time }}
-                        {% endif %}
-                      {% endif %}
-                      </span></time>
-                {% endfor %}
+                    {% if page.operating_hours %}
+                        <div class="col-md-4 col-md-offset-1 location-opening">
+                        <h3>Opening hours</h3>
+                        {% for hours in page.operating_hours %}
+                            <time itemprop="openingHours" datetime="{{ hours }}" class="location-time">
+                            <span class="day">{{ hours.day }}</span>:
+                            <span class="hours">
+                                {% if hours.closed == True %}
+                                    Closed
+                                {% else %}
+                                {% if hours.opening_time %}
+                                    {{ hours.opening_time }}
+                                {% endif %} -
+                                {% if hours.closing_time %}
+                                    {{ hours.closing_time }}
+                                {% endif %}
+                                {% endif %}
+                                </span></time>
+                        {% endfor %}
+                        </div>
+                    {% endif %}
+                    </div>
                 </div>
-            {% endif %}
-          </div>
+            </div>
         </div>
-    </div>
-</div>
-<div class="container-flex">
-  <div class="row">
-    <div class="col-md-2 col-md-offset-5 location-address">
-      <h3>Address</h3>
-        <address>{{ page.address|linebreaks }}</address>
-    </div>
-  </div>
+        <div class="container-flex">
+            <div class="row">
+                <div class="col-md-2 col-md-offset-5 location-address">
+                    <h3>Address</h3>
+                    <address>{{ page.address|linebreaks }}</address>
+                </div>
+            </div>
 
-  <div class="map-container">
-    <div id="map" class="maps embed-container"></div>
-  </div>
-</div>
+            <div class="map-container">
+                <div id="map" class="maps embed-container"></div>
+            </div>
+        </div>
 
-<div class="container">
-  <div class="row">
-    <div class="col-md-7 location-body">
-      {{ page.body }}
+        <div class="container">
+            <div class="row">
+                <div class="col-md-7 location-body">
+                    {{ page.body }}
+                </div>
+            </div>
+        </div>
     </div>
-  </div>
-</div>
 
     <script>
-      var map;
-      function initMap() {
+        var map;
+        function initMap() {
         map = new google.maps.Map(document.getElementById('map'), {
-          center: {
-              lat: {{lat}},
-              lng: {{long}}
-          },
-          zoom: 15,
-          scrollwheel: false
+            center: {
+                lat: {{lat}},
+                lng: {{long}}
+            },
+            zoom: 15,
+            scrollwheel: false
         });
         var marker = new google.maps.Marker({
-          position: {
-              lat: {{lat}},
-              lng: {{long}}
-          },
-          map: map,
-          title: '{{page.title}}'
+            position: {
+                lat: {{lat}},
+                lng: {{long}}
+            },
+            map: map,
+            title: '{{page.title}}'
         });
-      }
+        }
     </script>
-    <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyD31CT9P9KxvNUJOwDq2kcFEIG8ADgaFgw&callback=initMap" async defer></script>
+    <script src="https://maps.googleapis.com/maps/api/js?key={{ google_map_api_key }}&callback=initMap" async defer></script>
 
 {% endblock content %}

+ 1 - 0
bakerydemo/templates/tags/breadcrumbs.html

@@ -7,6 +7,7 @@
           <div class="col-lg-12">
             {% if ancestors %}
               <ol class="breadcrumb">
+
                 <li><a href="/"><i class="fa fa-home" aria-hidden="true"></i><span class="hidden" aria-hidden="false">Home</span></a></li>
                   {% for ancestor in ancestors|slice:"1:" %}
                     {% if forloop.last %}

+ 1 - 1
bakerydemo/templates/tags/top_menu.html

@@ -8,7 +8,7 @@
               {% top_menu_children parent=menuitem %}
               {# Used to display child menu items #}
       {% else %}
-          <a href="{% pageurl menuitem %}">{{ menuitem.title }}</a>
+          <a href="{% pageurl menuitem %}" role="menuitem">{{ menuitem.title }}</a>
       {% endif %}
   </li>
 {% endfor %}

+ 2 - 2
bakerydemo/templates/tags/top_menu_children.html

@@ -1,7 +1,7 @@
 {% load navigation_tags wagtailcore_tags %}
 
-<ul class="dropdown-menu">
+<ul class="dropdown-menu" role="menu">
   {% for child in menuitems_children %}
-    <li><a href="{% pageurl child %}">{{ child.title }}</a></li>
+    <li><a href="{% pageurl child %}" role="menuitem">{{ child.title }}</a></li>
   {% endfor %}
 </ul>