From 6eefd5f991ea872c22a083ee3449b1fa674ef39a Mon Sep 17 00:00:00 2001 From: Scot Hacker Date: Sun, 19 Feb 2017 01:44:22 -0800 Subject: [PATCH] Improve admin display of body text on Locations (label, position) --- .../migrations/0009_auto_20170219_0942.py | 24 +++++++++++++++++++ bakerydemo/locations/models.py | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 bakerydemo/locations/migrations/0009_auto_20170219_0942.py diff --git a/bakerydemo/locations/migrations/0009_auto_20170219_0942.py b/bakerydemo/locations/migrations/0009_auto_20170219_0942.py new file mode 100644 index 0000000..5a5973e --- /dev/null +++ b/bakerydemo/locations/migrations/0009_auto_20170219_0942.py @@ -0,0 +1,24 @@ +# -*- 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'), + ), + ] diff --git a/bakerydemo/locations/models.py b/bakerydemo/locations/models.py index 68d595b..215108d 100644 --- a/bakerydemo/locations/models.py +++ b/bakerydemo/locations/models.py @@ -147,7 +147,7 @@ class LocationPage(Page): ] ) body = StreamField( - BaseStreamBlock(), verbose_name="About page detail", blank=True + 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 @@ -162,11 +162,11 @@ class LocationPage(Page): # Editor panels configuration content_panels = Page.content_panels + [ FieldPanel('introduction', classname="full"), + StreamFieldPanel('body'), FieldPanel('address', classname="full"), FieldPanel('lat_long'), ImageChooserPanel('image'), InlinePanel('hours_of_operation', label="Hours of Operation"), - StreamFieldPanel('body') ] def __str__(self):