Browse Source

Merge pull request #47 from wagtail/41-abstract-base-page

Create abstract base class for common fields
Scot Hacker 8 years ago
parent
commit
dc93606135

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

@@ -0,0 +1,31 @@
+# -*- 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'),
+        ),
+    ]

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

@@ -0,0 +1,21 @@
+# -*- 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'),
+        ),
+    ]

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

@@ -0,0 +1,26 @@
+# -*- 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'),
+        ),
+    ]

+ 31 - 19
bakerydemo/base/models.py

@@ -21,6 +21,31 @@ from wagtail.wagtailsnippets.models import register_snippet
 from .blocks import BaseStreamBlock
 
 
+class BasePageFieldsMixin(models.Model):
+    """
+    An abstract base class for common fields
+    """
+    introduction = models.TextField(
+        help_text='Text to describe the page',
+        blank=True)
+    image = models.ForeignKey(
+        'wagtailimages.Image',
+        null=True,
+        blank=True,
+        on_delete=models.SET_NULL,
+        related_name='+',
+        help_text='Landscape mode only; horizontal width between 1000px and 3000px.'
+    )
+
+    content_panels = Page.content_panels + [
+        FieldPanel('introduction', classname="full"),
+        ImageChooserPanel('image'),
+    ]
+
+    class Meta:
+        abstract = True
+
+
 @register_snippet
 class People(ClusterableModel):
     """
@@ -113,7 +138,7 @@ class AboutPage(Page):
         blank=True,
         on_delete=models.SET_NULL,
         related_name='+',
-        help_text='Location image'
+        help_text='About image'
     )
 
     body = StreamField(
@@ -156,7 +181,7 @@ class HomePage(Page):
         blank=True,
         on_delete=models.SET_NULL,
         related_name='+',
-        help_text='Location image'
+        help_text='Homepage image'
     )
 
     body = StreamField(
@@ -172,9 +197,9 @@ class HomePage(Page):
         return self.title
 
 
-class GalleryPage(Page):
+class GalleryPage(BasePageFieldsMixin, Page):
     """
-    This is a page to list all the locations on the site
+    This is a page to list locations from the selected Collection
     """
     choices = models.ForeignKey(
         Collection,
@@ -182,24 +207,11 @@ class GalleryPage(Page):
         null=True,
         blank=True,
         on_delete=models.SET_NULL,
-    )
-    image = models.ForeignKey(
-        'wagtailimages.Image',
-        null=True,
-        blank=True,
-        on_delete=models.SET_NULL,
-        related_name='+',
-        help_text='Location listing image'
+        help_text='Select the image collection for this gallery.'
     )
 
-    introduction = models.TextField(
-        help_text='Text to describe the index page',
-        blank=True)
-
-    content_panels = Page.content_panels + [
+    content_panels = BasePageFieldsMixin.content_panels + [
         FieldPanel('choices'),
-        ImageChooserPanel('image'),
-        FieldPanel('introduction')
     ]
 
     # parent_page_types = [

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

@@ -0,0 +1,21 @@
+# -*- 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'),
+        ),
+    ]

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

@@ -0,0 +1,36 @@
+# -*- 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'),
+        ),
+    ]

+ 8 - 40
bakerydemo/blog/models.py

@@ -11,15 +11,15 @@ from taggit.models import Tag, TaggedItemBase
 
 from wagtail.contrib.wagtailroutablepage.models import RoutablePageMixin, route
 from wagtail.wagtailadmin.edit_handlers import (
-    FieldPanel, InlinePanel, StreamFieldPanel, MultiFieldPanel
+    FieldPanel, InlinePanel, StreamFieldPanel
 )
 from wagtail.wagtailcore.fields import StreamField
 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
 
 
 class BlogPeopleRelationship(Orderable, models.Model):
@@ -42,35 +42,18 @@ class BlogPageTag(TaggedItemBase):
     content_object = ParentalKey('BlogPage', related_name='tagged_items')
 
 
-class BlogPage(Page):
+class BlogPage(BasePageFieldsMixin, Page):
     """
     A Blog Page (Post)
     """
     subtitle = models.CharField(blank=True, max_length=255)
-    introduction = models.CharField(blank=True, max_length=255)
-    image = models.ForeignKey(
-        'wagtailimages.Image',
-        null=True,
-        blank=True,
-        on_delete=models.SET_NULL,
-        related_name='+',
-        help_text='Location image'
-    )
-
     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 = Page.content_panels + [
-        MultiFieldPanel([
-            FieldPanel('subtitle'),
-            FieldPanel('introduction'),
-        ]),
-        ImageChooserPanel('image'),
+    content_panels = BasePageFieldsMixin.content_panels + [
         StreamFieldPanel('body'),
         FieldPanel('date_published'),
         InlinePanel(
@@ -78,6 +61,9 @@ class BlogPage(Page):
             panels=None, min_num=1),
         FieldPanel('tags'),
     ]
+    # Inject subtitle panel after title field
+    title_index = next((i for i, panel in enumerate(content_panels) if panel.field_name == 'title'), -1)  # noqa
+    content_panels.insert(title_index + 1, FieldPanel('subtitle'))
 
     search_fields = Page.search_fields + [
         index.SearchField('title'),
@@ -116,7 +102,7 @@ class BlogPage(Page):
     subpage_types = []
 
 
-class BlogIndexPage(RoutablePageMixin, Page):
+class BlogIndexPage(BasePageFieldsMixin, RoutablePageMixin, Page):
     """
     Index page for blogs.
     We need to alter the page model's context to return the child page objects - the
@@ -125,24 +111,6 @@ class BlogIndexPage(RoutablePageMixin, Page):
     RoutablePageMixin is used to allow for a custom sub-URL for tag views.
     """
 
-    image = models.ForeignKey(
-        'wagtailimages.Image',
-        null=True,
-        blank=True,
-        on_delete=models.SET_NULL,
-        related_name='+',
-        help_text='Location listing image'
-    )
-
-    introduction = models.TextField(
-        help_text='Text to describe the index page',
-        blank=True)
-
-    content_panels = Page.content_panels + [
-        ImageChooserPanel('image'),
-        FieldPanel('introduction')
-    ]
-
     # What pages types can live under this page type?
     subpage_types = ['BlogPage']
 

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

@@ -0,0 +1,21 @@
+# -*- 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'),
+        ),
+    ]

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

@@ -0,0 +1,44 @@
+# -*- 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'),
+        ),
+    ]

+ 12 - 38
bakerydemo/breads/models.py

@@ -1,14 +1,15 @@
+from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
 from django.db import models
 
 from wagtail.wagtailadmin.edit_handlers import FieldPanel, StreamFieldPanel
 from wagtail.wagtailcore.fields import StreamField
 from wagtail.wagtailcore.models import Page
 
-from wagtail.wagtailcore import blocks
-from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
 from wagtail.wagtailsearch import index
 from wagtail.wagtailsnippets.models import register_snippet
-from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
+
+from bakerydemo.base.blocks import BaseStreamBlock
+from bakerydemo.base.models import BasePageFieldsMixin
 
 
 @register_snippet
@@ -46,7 +47,7 @@ class BreadType(models.Model):
         verbose_name_plural = "Bread types"
 
 
-class BreadPage(Page):
+class BreadPage(BasePageFieldsMixin, Page):
     """
     Detail view for a specific bread
     """
@@ -57,10 +58,9 @@ class BreadPage(Page):
         null=True,
         blank=True,
     )
-    description = StreamField([
-        ('heading', blocks.CharBlock(classname="full title")),
-        ('paragraph', blocks.RichTextBlock()),
-    ])
+    body = StreamField(
+        BaseStreamBlock(), verbose_name="Describe the bread", blank=True
+    )
     bread_type = models.ForeignKey(
         'breads.BreadType',
         null=True,
@@ -68,26 +68,16 @@ class BreadPage(Page):
         on_delete=models.SET_NULL,
         related_name='+'
     )
-    image = models.ForeignKey(
-        'wagtailimages.Image',
-        on_delete=models.SET_NULL,
-        null=True,
-        blank=True,
-        related_name='+',
-        help_text='Landscape mode only; horizontal width between 1000px and 3000px.'
-    )
 
-    content_panels = [
-        FieldPanel('title'),
+    content_panels = BasePageFieldsMixin.content_panels + [
+        StreamFieldPanel('body'),
         FieldPanel('origin'),
         FieldPanel('bread_type'),
-        ImageChooserPanel('image'),
-        StreamFieldPanel('description'),
     ]
 
     search_fields = Page.search_fields + [
         index.SearchField('title'),
-        index.SearchField('description'),
+        index.SearchField('body'),
     ]
 
     parent_page_types = ['BreadsIndexPage']
@@ -95,31 +85,15 @@ class BreadPage(Page):
     api_fields = ['title', 'bread_type', 'origin', 'image']
 
 
-class BreadsIndexPage(Page):
+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
     """
 
-    introduction = models.TextField(
-        help_text='Text to describe the index page',
-        blank=True)
-    image = models.ForeignKey(
-        'wagtailimages.Image',
-        null=True,
-        blank=True,
-        on_delete=models.SET_NULL,
-        related_name='+',
-        help_text='Location listing image'
-    )
     subpage_types = ['BreadPage']
 
-    content_panels = Page.content_panels + [
-        FieldPanel('introduction'),
-        ImageChooserPanel('image'),
-    ]
-
     def get_context(self, request):
         context = super(BreadsIndexPage, self).get_context(request)
 

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

@@ -0,0 +1,21 @@
+# -*- 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'),
+        ),
+    ]

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

@@ -0,0 +1,16 @@
+# -*- 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 = [
+    ]

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

@@ -0,0 +1,36 @@
+# -*- 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'),
+        ),
+    ]

+ 15 - 38
bakerydemo/locations/models.py

@@ -11,12 +11,10 @@ from wagtail.wagtailadmin.edit_handlers import (
     InlinePanel,
     StreamFieldPanel)
 from wagtail.wagtailcore.models import Orderable, Page
-from wagtail.wagtailimages.edit_handlers import (
-    ImageChooserPanel,
-    )
 from wagtail.wagtailcore.fields import StreamField
 from wagtail.wagtailsearch import index
 
+from bakerydemo.base.models import BasePageFieldsMixin
 from bakerydemo.base.blocks import BaseStreamBlock
 
 
@@ -57,7 +55,7 @@ class OperatingHours(models.Model):
         "Closed?",
         blank=True,
         help_text='Tick if location is closed on this day'
-        )
+    )
 
     panels = [
         FieldPanel('day'),
@@ -70,10 +68,18 @@ class OperatingHours(models.Model):
         abstract = True
 
     def __str__(self):
+        if self.opening_time:
+            opening = self.opening_time.strftime('%H:%M')
+        else:
+            opening = '--'
+        if self.closing_time:
+            closed = self.opening_time.strftime('%H:%M')
+        else:
+            closed = '--'
         return '{}: {} - {} {}'.format(
             self.day,
-            self.opening_time.strftime('%H:%M'),
-            self.closing_time.strftime('%H:%M'),
+            opening,
+            closed,
             settings.TIME_ZONE
         )
 
@@ -88,29 +94,12 @@ class LocationOperatingHours(Orderable, OperatingHours):
     )
 
 
-class LocationsIndexPage(Page):
+class LocationsIndexPage(BasePageFieldsMixin, Page):
     """
     Index page for locations
     """
-
-    introduction = models.TextField(
-        help_text='Text to describe the index page',
-        blank=True)
-    image = models.ForeignKey(
-        'wagtailimages.Image',
-        null=True,
-        blank=True,
-        on_delete=models.SET_NULL,
-        related_name='+',
-        help_text='Location listing image'
-    )
     subpage_types = ['LocationPage']
 
-    content_panels = Page.content_panels + [
-        FieldPanel('introduction'),
-        ImageChooserPanel('image'),
-    ]
-
     def get_context(self, request):
         context = super(LocationsIndexPage, self).get_context(request)
         context['locations'] = LocationPage.objects.descendant_of(
@@ -119,21 +108,11 @@ class LocationsIndexPage(Page):
         return context
 
 
-class LocationPage(Page):
+class LocationPage(BasePageFieldsMixin, Page):
     """
     Detail for a specific bakery location.
     """
-    introduction = models.TextField(
-        help_text='Text to describe the index page',
-        blank=True)
     address = models.TextField()
-    image = models.ForeignKey(
-        'wagtailimages.Image',
-        null=True,
-        blank=True,
-        on_delete=models.SET_NULL,
-        related_name='+'
-    )
     lat_long = models.CharField(
         max_length=36,
         help_text="Comma separated lat/long. (Ex. 64.144367, -21.939182) \
@@ -160,12 +139,10 @@ class LocationPage(Page):
     ]
 
     # Editor panels configuration
-    content_panels = Page.content_panels + [
-        FieldPanel('introduction', classname="full"),
+    content_panels = BasePageFieldsMixin.content_panels + [
         StreamFieldPanel('body'),
         FieldPanel('address', classname="full"),
         FieldPanel('lat_long'),
-        ImageChooserPanel('image'),
         InlinePanel('hours_of_operation', label="Hours of Operation"),
     ]
 

+ 1 - 1
bakerydemo/templates/breads/bread_page.html

@@ -9,5 +9,5 @@
 
     <p>{{ page.origin }}</p>
     <p>{{ page.bread_type }}</p>
-    {{ page.description }}
+    {{ page.body }}
 {% endblock content %}

+ 3 - 4
bakerydemo/templates/locations/locations_index_page.html

@@ -17,13 +17,12 @@
             <div class="col-md-6 location-list-item">
                 <a href="{% pageurl location %}">
                 <h1 class="location-list-title">
-                
-        
+
                     {% image location.image fill-660x270-c75 as image %}
                     <img src="{{ image.url }}" width="{{ image.width }}" height="{{ image.height }}" alt="{{ image.alt }}" class="" />
-                    
+
                     <span class="title">{{ location.title }}</span>
-                
+
                 </h1></a>
                     <address>{{ location.address }}</address>
                     <a href="https://google.com/maps/?q={{ location.lat_long }}" class="btn">Map</a>