From 88ee0c363dda6b1de0a1078e2f2feb405704a4f1 Mon Sep 17 00:00:00 2001 From: jacklinke Date: Thu, 20 Feb 2025 03:05:59 -0500 Subject: [PATCH 1/6] Update custom Navbar/Footer models and templatetags to work in multi-site installs --- .../pro/project_name/settings/base.py | 4 + .../0003_footer_site_navbar_site.py | 25 ++++++ .../project_template/pro/website/models.py | 16 ++++ .../pro/website/templatetags/website_tags.py | 76 +++++++++++++++--- coderedcms/settings.py | 3 + docs/how_to/headers_and_footers.rst | 78 ++++++++----------- 6 files changed, 146 insertions(+), 56 deletions(-) create mode 100644 coderedcms/project_template/pro/website/migrations/0003_footer_site_navbar_site.py diff --git a/coderedcms/project_template/pro/project_name/settings/base.py b/coderedcms/project_template/pro/project_name/settings/base.py index d0975ea3..e51bd03a 100644 --- a/coderedcms/project_template/pro/project_name/settings/base.py +++ b/coderedcms/project_template/pro/project_name/settings/base.py @@ -194,3 +194,7 @@ # custom implementation. CRX_DISABLE_NAVBAR = True CRX_DISABLE_FOOTER = True + +# Default to True to maintain existing behavior for existing installations. +CRX_NO_SITE_NAVBAR_FALLBACK = True +CRX_NO_SITE_FOOTER_FALLBACK = True diff --git a/coderedcms/project_template/pro/website/migrations/0003_footer_site_navbar_site.py b/coderedcms/project_template/pro/website/migrations/0003_footer_site_navbar_site.py new file mode 100644 index 00000000..8743adf0 --- /dev/null +++ b/coderedcms/project_template/pro/website/migrations/0003_footer_site_navbar_site.py @@ -0,0 +1,25 @@ +# Generated by Django 5.1.6 on 2025-02-17 15:16 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailcore', '0094_alter_page_locale'), + ('website', '0002_initial_data'), + ] + + operations = [ + migrations.AddField( + model_name='footer', + name='site', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='footers', to='wagtailcore.site'), + ), + migrations.AddField( + model_name='navbar', + name='site', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='navbars', to='wagtailcore.site'), + ), + ] diff --git a/coderedcms/project_template/pro/website/models.py b/coderedcms/project_template/pro/website/models.py index fb13ca0c..0bba668c 100644 --- a/coderedcms/project_template/pro/website/models.py +++ b/coderedcms/project_template/pro/website/models.py @@ -221,9 +221,17 @@ class Meta: ], use_json_field=True, ) + site = models.ForeignKey( + "wagtailcore.Site", + on_delete=models.CASCADE, + related_name="navbars", + null=True, + blank=True, + ) panels = [ FieldPanel("name"), + FieldPanel("site"), FieldPanel("content"), ] @@ -249,9 +257,17 @@ class Meta: blank=True, use_json_field=True, ) + site = models.ForeignKey( + "wagtailcore.Site", + on_delete=models.CASCADE, + related_name="footers", + null=True, + blank=True, + ) panels = [ FieldPanel("name"), + FieldPanel("site"), FieldPanel("content"), ] diff --git a/coderedcms/project_template/pro/website/templatetags/website_tags.py b/coderedcms/project_template/pro/website/templatetags/website_tags.py index 2e64855a..b8c6844f 100644 --- a/coderedcms/project_template/pro/website/templatetags/website_tags.py +++ b/coderedcms/project_template/pro/website/templatetags/website_tags.py @@ -1,4 +1,6 @@ +from coderedcms.settings import crx_settings from django import template +from wagtail.models import Site from website.models import Footer from website.models import Navbar @@ -7,17 +9,67 @@ register = template.Library() -@register.simple_tag -def get_website_navbars(): - # NOTE: For a multi-site, you may need to create SiteSettings to - # choose a Navbar, then query those here. Or, add a Foreign Key to - # the Site on the Navbar, and query those. - return Navbar.objects.all() +@register.simple_tag(takes_context=True) +def get_website_navbars(context): + """Get the navbars for the current site. + If CRX_NAVBAR_FALLBACK is True and no navbars are associated with the current site, returns all navbars. + If we can't determine the current site, returns all navbars regardless of the fallback setting. -@register.simple_tag -def get_website_footers(): - # NOTE: For a multi-site, you may need to create SiteSettings to - # choose a Footer, then query those here. Or, add a Foreign Key to - # the Site on the Footer, and query those. - return Footer.objects.all() + Args: + context: The template context which contains the current request + + Returns: + QuerySet: Navbar queryset filtered by the current site, or all navbars if fallback conditions are met + """ + try: + # Get the current request from context + request = context['request'] + # Get the current site from the request + current_site = Site.find_for_request(request) + # Get navbars associated with the current site + site_navbars = Navbar.objects.filter(site=current_site) + + # If no navbars are found for the current site and fallback is enabled, + # return all navbars + if not site_navbars.exists() and getattr(crx_settings, 'CRX_NO_SITE_NAVBAR_FALLBACK', False): + return Navbar.objects.all() + + return site_navbars + + except (KeyError, AttributeError): + # Fallback to returning all navbars if we can't determine the current site + return Navbar.objects.all() + + +@register.simple_tag(takes_context=True) +def get_website_footers(context): + """Get the footers for the current site. + + If CRX_NO_SITE_FOOTER_FALLBACK is True and no footers are associated with the current site, returns all + footers. If we can't determine the current site, returns all footers regardless of the fallback setting. + + Args: + context: The template context which contains the current request + + Returns: + QuerySet: Footer queryset filtered by the current site, or all footers if fallback conditions are met + """ + try: + # Get the current request from context + request = context['request'] + # Get the current site from the request + current_site = Site.find_for_request(request) + # Get footers associated with the current site + site_footers = Footer.objects.filter(site=current_site) + + # If no footers are found for the current site and fallback is enabled, + # return all footers + if not site_footers.exists() and getattr(crx_settings, 'CRX_NO_SITE_FOOTER_FALLBACK', False): + return Footer.objects.all() + + return site_footers + + except (KeyError, AttributeError): + # Fallback to returning all footers if we can't determine the current site + return Footer.objects.all() diff --git a/coderedcms/settings.py b/coderedcms/settings.py index d3244c6d..02dc5a25 100644 --- a/coderedcms/settings.py +++ b/coderedcms/settings.py @@ -195,6 +195,9 @@ class _DefaultSettings: CRX_DISABLE_NAVBAR = False CRX_DISABLE_FOOTER = False + CRX_NO_SITE_NAVBAR_FALLBACK = False + CRX_NO_SITE_FOOTER_FALLBACK = False + def __getattribute__(self, attr: str): # First load from Django settings. # If it does not exist, load from _DefaultSettings. diff --git a/docs/how_to/headers_and_footers.rst b/docs/how_to/headers_and_footers.rst index c75df9e7..2abb1869 100644 --- a/docs/how_to/headers_and_footers.rst +++ b/docs/how_to/headers_and_footers.rst @@ -3,64 +3,54 @@ Customize Navbar and Footer Navbar ------ - -The navbar (also known as Navigation Bar, Header, or Menu) is a shared piece +The navbar (also known as Navigation Bar, Header, or Menu) is a shared piece of navigation. Wagtail CRX shows an area for the navbar at the top of most pages on the site. The logo and style of the navbar can be customized under **Settings > -Layout**. The links shown in the navbar can be customized by creating a "Navbar" -snippet under **Snippets > Navbar**. - -.. note:: +Layout**. - Each Navbar snippet is rendered sequentially in the navbar area. This currently - does not support multi-site, i.e. all Navbar snippets are present on all sites. +For the basic template, create and manage navbars under **Snippets > Navbar**. Then use +**Settings > CRX Settings** to select which navbars to display and their ordering. The +Site Navbar Layout includes settings for the whole navbar, while the Site Navbar chooser +allows you to select specific navbars for your site. -Customizing the design of the stock navbar can be accomplished by baked in -Django template overrides. +For the pro template, create navbars under **Snippets > Navbar** and select the specific +site for each navbar within the navbar snippet edit page. Navbars are ordered by the +default model ordering. When no site-specific navbars are configured and +`CRX_NO_SITE_NAVBAR_FALLBACK` is True (default in pro template), all navbars will be +displayed. Set `CRX_NO_SITE_NAVBAR_FALLBACK = False` in your settings to disable this +fallback behavior. -Create a ``templates\coderedcms\snippets`` directory in your project, -most likely in the ``website`` directory. +Customizing the design of the stock navbar can be accomplished through Django template +overrides. Create a `templates/coderedcms/snippets` directory in your project, +most likely in the `website` directory. -In that directory create a file called ``navbar.html``. This file will then -override the ``navbar.html`` file included with Wagtail CRX. +In that directory create a file called `navbar.html`. This file will then +override the `navbar.html` file included with Wagtail CRX. -It is advisable to initially copy the contents of `Wagtail CRX navbar.html`_, but +It is advisable to initially copy the contents of [Wagtail CRX navbar.html](https://github.com/coderedcorp/coderedcms/blob/main/coderedcms/templates/coderedcms/snippets/navbar.html), but not necessary. -.. _Wagtail CRX navbar.html: https://github.com/coderedcorp/coderedcms/blob/main/coderedcms/templates/coderedcms/snippets/navbar.html - - Footer ------ - The footer is a shared piece of content shown at the bottom of every page on the -site. Content can be added to the footer by creating a "Footer" snippet under -**Snippets > Footer**. +site. Create footers under **Snippets > Footer**. -.. note:: +For the basic template, use **Settings > CRX Settings** to select which footers to +display and specify their ordering through the Site Footers setting. - Each Footer snippet is rendered sequentially in the footer area. This - currently does not support multi-site, i.e. all Footer snippets are present - on all sites. +For the pro template, select the specific site within each footer snippet edit page. +Footers are ordered by the default model ordering. When no site-specific footers are +configured and `CRX_NO_SITE_FOOTER_FALLBACK` is True (default in pro template), all +footers will be displayed. Set `CRX_NO_SITE_FOOTER_FALLBACK = False` in your settings +to disable this fallback behavior. -Customizing the design of the sock footer can be accomplished similarly to the -navbar, by overriding the Django template. +Customizing the design of the stock footer can be accomplished similarly to the +navbar, by overriding the Django template. Create a `templates/coderedcms/snippets/` +directory in your project, most likely in the `website` directory. -Create a ``templates/coderedcms/snippets/`` directory in your project, -most likely in the ``website`` directory. +In that directory create a file named `footer.html`. This file will then +override the `footer.html` file included with Wagtail CRX. -In that directory create a filed named ``footer.html``. This file will then -override the ``footer.html`` file included with Wagtail CRX. - -Similarly, it is advisable to initially copy the contents of `Wagtail CRX -footer.html`_, but not necessary. - -.. note:: - - You can now create more than one navbar menu or footer and choose which ones to render on your site. In **Settings > CRX Settings**, - select your navbars in **Site Navbars**. Select your footers in **Site Footers**. The Site Navbar Layout includes settings for the whole - navbar, while the Site Navbar chooser allows you to choose which menu you want for your site. This features allows you to - select a different navbar/footer per site in a multisite installation OR render several navbars/footers in selected order - on a single site. - -.. _Wagtail CRX footer.html: https://github.com/coderedcorp/coderedcms/blob/main/coderedcms/templates/coderedcms/snippets/footer.html +Similarly, it is advisable to initially copy the contents of [Wagtail CRX +footer.html](https://github.com/coderedcorp/coderedcms/blob/main/coderedcms/templates/coderedcms/snippets/footer.html), but +not necessary. From d1ed5b2a5a3a3913ce061dabf4aaff8edf6cd3cf Mon Sep 17 00:00:00 2001 From: jacklinke Date: Thu, 20 Feb 2025 23:19:41 -0500 Subject: [PATCH 2/6] Remove the need for setting based on comments from vsalvino --- .../pro/project_name/settings/base.py | 3 --- .../pro/website/templatetags/website_tags.py | 11 ----------- coderedcms/settings.py | 3 --- 3 files changed, 17 deletions(-) diff --git a/coderedcms/project_template/pro/project_name/settings/base.py b/coderedcms/project_template/pro/project_name/settings/base.py index e51bd03a..8a413b16 100644 --- a/coderedcms/project_template/pro/project_name/settings/base.py +++ b/coderedcms/project_template/pro/project_name/settings/base.py @@ -195,6 +195,3 @@ CRX_DISABLE_NAVBAR = True CRX_DISABLE_FOOTER = True -# Default to True to maintain existing behavior for existing installations. -CRX_NO_SITE_NAVBAR_FALLBACK = True -CRX_NO_SITE_FOOTER_FALLBACK = True diff --git a/coderedcms/project_template/pro/website/templatetags/website_tags.py b/coderedcms/project_template/pro/website/templatetags/website_tags.py index b8c6844f..4afcdd8e 100644 --- a/coderedcms/project_template/pro/website/templatetags/website_tags.py +++ b/coderedcms/project_template/pro/website/templatetags/website_tags.py @@ -1,4 +1,3 @@ -from coderedcms.settings import crx_settings from django import template from wagtail.models import Site @@ -30,11 +29,6 @@ def get_website_navbars(context): # Get navbars associated with the current site site_navbars = Navbar.objects.filter(site=current_site) - # If no navbars are found for the current site and fallback is enabled, - # return all navbars - if not site_navbars.exists() and getattr(crx_settings, 'CRX_NO_SITE_NAVBAR_FALLBACK', False): - return Navbar.objects.all() - return site_navbars except (KeyError, AttributeError): @@ -63,11 +57,6 @@ def get_website_footers(context): # Get footers associated with the current site site_footers = Footer.objects.filter(site=current_site) - # If no footers are found for the current site and fallback is enabled, - # return all footers - if not site_footers.exists() and getattr(crx_settings, 'CRX_NO_SITE_FOOTER_FALLBACK', False): - return Footer.objects.all() - return site_footers except (KeyError, AttributeError): diff --git a/coderedcms/settings.py b/coderedcms/settings.py index 02dc5a25..d3244c6d 100644 --- a/coderedcms/settings.py +++ b/coderedcms/settings.py @@ -195,9 +195,6 @@ class _DefaultSettings: CRX_DISABLE_NAVBAR = False CRX_DISABLE_FOOTER = False - CRX_NO_SITE_NAVBAR_FALLBACK = False - CRX_NO_SITE_FOOTER_FALLBACK = False - def __getattribute__(self, attr: str): # First load from Django settings. # If it does not exist, load from _DefaultSettings. From 3fb21c6979a1f4445f81e6af29fab6f76a321c66 Mon Sep 17 00:00:00 2001 From: jacklinke Date: Thu, 20 Feb 2025 23:20:11 -0500 Subject: [PATCH 3/6] Reset pro template migrations using oldest supported versions of django and wagtail --- .../pro/website/migrations/0001_initial.py | 48 +++++++++-------- .../website/migrations/0002_initial_data.py | 52 ------------------- .../0003_footer_site_navbar_site.py | 25 --------- 3 files changed, 25 insertions(+), 100 deletions(-) delete mode 100644 coderedcms/project_template/pro/website/migrations/0002_initial_data.py delete mode 100644 coderedcms/project_template/pro/website/migrations/0003_footer_site_navbar_site.py diff --git a/coderedcms/project_template/pro/website/migrations/0001_initial.py b/coderedcms/project_template/pro/website/migrations/0001_initial.py index 9edc4843..3bccc6d0 100644 --- a/coderedcms/project_template/pro/website/migrations/0001_initial.py +++ b/coderedcms/project_template/pro/website/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.19 on 2025-02-07 00:23 +# Generated by Django 4.2 on 2025-02-21 03:54 import coderedcms.fields from django.conf import settings @@ -16,7 +16,7 @@ class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('coderedcms', '0042_remove_coderedsessionformsubmission_thumbnails_by_path'), + ('coderedcms', '0044_layoutsettings_recaptcha_public_key_and_more'), ('wagtailcore', '0094_alter_page_locale'), ] @@ -58,17 +58,6 @@ class Migration(migrations.Migration): }, bases=('coderedcms.coderedpage', models.Model, eventtools.models.OccurrenceMixin), ), - migrations.CreateModel( - name='Footer', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=255)), - ('content', wagtail.fields.StreamField([('hero', 88), ('row', 82), ('cardgrid', 86), ('html', 29)], blank=True, block_lookup={0: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Default')], 'label': 'Template', 'required': False}), 1: ('wagtail.blocks.CharBlock', (), {'label': 'Custom CSS Class', 'max_length': 255, 'required': False}), 2: ('wagtail.blocks.CharBlock', (), {'label': 'Custom ID', 'max_length': 255, 'required': False}), 3: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2)]], {}), 4: ('wagtail.blocks.BooleanBlock', (), {'default': True, 'label': 'Full width', 'required': False}), 5: ('wagtail.blocks.BooleanBlock', (), {'help_text': 'Background images scroll slower than foreground images, creating an illusion of depth.', 'label': 'Parallax Effect', 'required': False}), 6: ('wagtail.images.blocks.ImageChooserBlock', (), {'required': False}), 7: ('wagtail.blocks.BooleanBlock', (), {'default': False, 'label': 'Tile background image', 'required': False}), 8: ('wagtail.blocks.CharBlock', (), {'help_text': 'Hexadecimal, rgba, or CSS color notation (e.g. #ff0011)', 'label': 'Background color', 'max_length': 255, 'required': False}), 9: ('wagtail.blocks.CharBlock', (), {'help_text': 'Hexadecimal, rgba, or CSS color notation (e.g. #ff0011)', 'label': 'Text color', 'max_length': 255, 'required': False}), 10: ('wagtail.blocks.BooleanBlock', (), {'label': 'Full width', 'required': False}), 11: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Always expanded'), ('sm', 'sm - Expand on small screens (phone, 576px) and larger'), ('md', 'md - Expand on medium screens (tablet, 768px) and larger'), ('lg', 'lg - Expand on large screens (laptop, 992px) and larger'), ('xl', 'xl - Expand on extra large screens (wide monitor, 1200px)')], 'help_text': 'Screen size at which the column will expand horizontally or stack vertically.', 'required': False, 'verbose_name': 'Column Breakpoint'}), 12: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2), ('column_breakpoint', 11)]], {}), 13: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Automatically size'), ('12', 'Full row'), ('6', 'Half - 1/2 column'), ('4', 'Thirds - 1/3 column'), ('8', 'Thirds - 2/3 column'), ('3', 'Quarters - 1/4 column'), ('9', 'Quarters - 3/4 column'), ('2', 'Sixths - 1/6 column'), ('10', 'Sixths - 5/6 column'), ('1', 'Twelfths - 1/12 column'), ('5', 'Twelfths - 5/12 column'), ('7', 'Twelfths - 7/12 column'), ('11', 'Twelfths - 11/12 column')], 'label': 'Column size', 'required': False}), 14: ('coderedcms.blocks.html_blocks.RichTextBlock', (), {'icon': 'cr-font'}), 15: ('wagtail.blocks.CharBlock', (), {'label': 'Tracking Event Category', 'max_length': 255, 'required': False}), 16: ('wagtail.blocks.CharBlock', (), {'label': 'Tracking Event Label', 'max_length': 255, 'required': False}), 17: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2), ('ga_tracking_event_category', 15), ('ga_tracking_event_label', 16)]], {}), 18: ('wagtail.blocks.PageChooserBlock', (), {'label': 'Page link', 'required': False}), 19: ('wagtail.documents.blocks.DocumentChooserBlock', (), {'label': 'Document link', 'required': False}), 20: ('wagtail.blocks.CharBlock', (), {'label': 'Other link', 'max_length': 255, 'required': False}), 21: ('wagtail.blocks.CharBlock', (), {'label': 'Title', 'max_length': 255, 'required': False}), 22: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('btn-primary', 'Primary'), ('btn-secondary', 'Secondary'), ('btn-success', 'Success'), ('btn-danger', 'Danger'), ('btn-warning', 'Warning'), ('btn-info', 'Info'), ('btn-link', 'Link'), ('btn-light', 'Light'), ('btn-dark', 'Dark'), ('btn-outline-primary', 'Outline Primary'), ('btn-outline-secondary', 'Outline Secondary'), ('btn-outline-success', 'Outline Success'), ('btn-outline-danger', 'Outline Danger'), ('btn-outline-warning', 'Outline Warning'), ('btn-outline-info', 'Outline Info'), ('btn-outline-light', 'Outline Light'), ('btn-outline-dark', 'Outline Dark')], 'label': 'Button Style', 'required': False}), 23: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('btn-sm', 'Small'), ('', 'Default'), ('btn-lg', 'Large')], 'label': 'Button Size', 'required': False}), 24: ('wagtail.blocks.StructBlock', [[('settings', 17), ('page_link', 18), ('doc_link', 19), ('other_link', 20), ('button_title', 21), ('button_style', 22), ('button_size', 23)]], {}), 25: ('wagtail.images.blocks.ImageChooserBlock', (), {'label': 'Image'}), 26: ('wagtail.blocks.StructBlock', [[('settings', 3), ('image', 25)]], {}), 27: ('wagtail.blocks.CharBlock', (), {'help_text': 'Alternate text to show if the image doesn’t load', 'max_length': 255, 'required': True}), 28: ('wagtail.blocks.StructBlock', [[('settings', 17), ('page_link', 18), ('doc_link', 19), ('other_link', 20), ('button_title', 21), ('image', 25), ('alt_text', 27)]], {}), 29: ('wagtail.blocks.RawHTMLBlock', (), {'form_classname': 'monospace', 'icon': 'code', 'label': 'HTML'}), 30: ('wagtail.blocks.StructBlock', [[('settings', 17), ('button_style', 22), ('button_size', 23), ('button_title', 21), ('downloadable_file', 19)]], {}), 31: ('wagtail.embeds.blocks.EmbedBlock', (), {'help_text': 'Link to a YouTube/Vimeo video, tweet, facebook post, etc.', 'label': 'URL', 'required': True}), 32: ('wagtail.blocks.StructBlock', [[('settings', 3), ('url', 31)]], {}), 33: ('wagtail.blocks.TextBlock', (), {'label': 'Quote Text', 'required': True, 'rows': 4}), 34: ('wagtail.blocks.CharBlock', (), {'label': 'Author', 'max_length': 255, 'required': False}), 35: ('wagtail.blocks.StructBlock', [[('settings', 3), ('text', 33), ('author', 34)]], {}), 36: ('wagtail.contrib.table_block.blocks.TableBlock', (), {}), 37: ('wagtail.blocks.StructBlock', [[('settings', 3), ('table', 36)]], {}), 38: ('wagtail.blocks.CharBlock', (), {'help_text': 'Address or search term used to find your location on the map.', 'label': 'Search query', 'max_length': 255, 'required': False}), 39: ('wagtail.blocks.CharBlock', (), {'help_text': 'Map title for screen readers, ex: "Map to Goodale Park"', 'label': 'Map title', 'max_length': 255, 'required': False}), 40: ('wagtail.blocks.CharBlock', (), {'help_text': 'Requires API key to use place ID.', 'label': 'Google place ID', 'max_length': 255, 'required': False}), 41: ('wagtail.blocks.IntegerBlock', (), {'default': 14, 'help_text': 'Requires API key to use zoom. 1: World, 5: Landmass/continent, 10: City, 15: Streets, 20: Buildings', 'label': 'Map zoom level', 'required': False}), 42: ('wagtail.blocks.StructBlock', [[('settings', 3), ('search', 38), ('map_title', 39), ('place_id', 40), ('map_zoom_level', 41)]], {}), 43: ('wagtail.blocks.PageChooserBlock', (), {'help_text': 'Show a preview of pages that are children of the selected page. Uses ordering specified in the page’s LAYOUT tab.', 'label': 'Parent page', 'required': True}), 44: ('coderedcms.blocks.base_blocks.ClassifierTermChooserBlock', (), {'help_text': 'Only show pages that are classified with this term.', 'label': 'Classified as', 'required': False}), 45: ('wagtail.blocks.IntegerBlock', (), {'default': 3, 'label': 'Number of pages to show'}), 46: ('wagtail.blocks.StructBlock', [[('settings', 3), ('indexed_by', 43), ('classified_by', 44), ('num_posts', 45)]], {}), 47: ('wagtail.blocks.PageChooserBlock', (), {'help_text': 'Show a mini preview of the selected page.', 'label': 'Page to preview', 'required': True}), 48: ('wagtail.blocks.StructBlock', [[('settings', 3), ('page', 47)]], {}), 49: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.Accordion',), {}), 50: ('wagtail.blocks.StructBlock', [[('settings', 3), ('accordion', 49)]], {}), 51: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Default'), ('coderedcms/blocks/card_block.html', 'Card'), ('coderedcms/blocks/card_head.html', 'Card with header'), ('coderedcms/blocks/card_foot.html', 'Card with footer'), ('coderedcms/blocks/card_head_foot.html', 'Card with header and footer'), ('coderedcms/blocks/card_blurb.html', 'Blurb - rounded image and no border'), ('coderedcms/blocks/card_img.html', 'Cover image - use image as background')], 'label': 'Template', 'required': False}), 52: ('wagtail.blocks.StructBlock', [[('custom_template', 51), ('custom_css_class', 1), ('custom_id', 2)]], {}), 53: ('wagtail.images.blocks.ImageChooserBlock', (), {'label': 'Image', 'max_length': 255, 'required': False}), 54: ('wagtail.blocks.CharBlock', (), {'label': 'Subtitle', 'max_length': 255, 'required': False}), 55: ('wagtail.blocks.RichTextBlock', (), {'features': ['bold', 'italic', 'ol', 'ul', 'hr', 'link', 'document-link'], 'label': 'Body'}), 56: ('wagtail.blocks.StreamBlock', [[('Links', 24)]], {'blank': True, 'label': 'Links', 'required': False}), 57: ('wagtail.blocks.StructBlock', [[('settings', 52), ('image', 53), ('title', 21), ('subtitle', 54), ('description', 55), ('links', 56)]], {}), 58: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.Carousel',), {}), 59: ('wagtail.blocks.StructBlock', [[('settings', 3), ('carousel', 58)]], {}), 60: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.FilmStrip',), {}), 61: ('wagtail.blocks.StructBlock', [[('settings', 3), ('film_strip', 60)]], {}), 62: ('coderedcms.blocks.base_blocks.CollectionChooserBlock', (), {'label': 'Image Collection', 'required': True}), 63: ('wagtail.blocks.StructBlock', [[('settings', 3), ('collection', 62)]], {}), 64: ('wagtail.blocks.CharBlock', (), {'label': 'Modal heading', 'max_length': 255, 'required': False}), 65: ('wagtail.blocks.StreamBlock', [[('text', 14), ('button', 24), ('image', 26), ('image_link', 28), ('html', 29), ('download', 30), ('embed_video', 32), ('quote', 35), ('table', 37), ('google_map', 42), ('page_list', 46), ('page_preview', 48)]], {'label': 'Content'}), 66: ('wagtail.blocks.CharBlock', (), {'icon': 'cr-font', 'label': 'Simple Text', 'max_length': 255}), 67: ('wagtail.blocks.StreamBlock', [[('text', 66), ('button', 24)]], {'label': 'Modal footer', 'required': False}), 68: ('wagtail.blocks.StructBlock', [[('settings', 3), ('button_style', 22), ('button_size', 23), ('button_title', 21), ('header', 64), ('content', 65), ('footer', 67)]], {}), 69: ('wagtail.blocks.CharBlock', (), {'label': 'Heading', 'max_length': 255, 'required': False}), 70: ('wagtail.images.blocks.ImageChooserBlock', (), {'label': 'Image', 'required': False}), 71: ('wagtail.blocks.CharBlock', (), {'label': 'Name', 'max_length': 255, 'required': True}), 72: ('wagtail.blocks.TextBlock', (), {'label': 'Description', 'required': False, 'rows': 4}), 73: ('wagtail.blocks.CharBlock', (), {'help_text': 'Any text here. Include currency sign if desired.', 'label': 'Price', 'required': True}), 74: ('wagtail.blocks.StructBlock', [[('settings', 3), ('image', 70), ('name', 71), ('description', 72), ('price', 73)]], {}), 75: ('wagtail.blocks.StreamBlock', [[('item', 74)]], {'label': 'Items'}), 76: ('wagtail.blocks.StructBlock', [[('settings', 3), ('heading', 69), ('items', 75)]], {}), 77: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.ReusableContent',), {}), 78: ('wagtail.blocks.StructBlock', [[('settings', 3), ('content', 77)]], {}), 79: ('wagtail.blocks.StreamBlock', [[('text', 14), ('button', 24), ('image', 26), ('image_link', 28), ('html', 29), ('download', 30), ('embed_video', 32), ('quote', 35), ('table', 37), ('google_map', 42), ('page_list', 46), ('page_preview', 48), ('accordion', 50), ('card', 57), ('carousel', 59), ('film_strip', 61), ('image_gallery', 63), ('modal', 68), ('pricelist', 76), ('reusable_content', 78)]], {'label': 'Content'}), 80: ('wagtail.blocks.StructBlock', [[('settings', 12), ('column_size', 13), ('content', 79)]], {}), 81: ('wagtail.blocks.StreamBlock', [[('content', 80)]], {'label': 'Content'}), 82: ('wagtail.blocks.StructBlock', [[('settings', 3), ('fluid', 10), ('content', 81)]], {}), 83: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Default'), ('coderedcms/blocks/cardgrid_group.html', 'Card group - attached cards of equal size'), ('coderedcms/blocks/cardgrid_deck.html', 'Card deck - separate cards of equal size'), ('coderedcms/blocks/cardgrid_columns.html', 'Card masonry - fluid brick pattern')], 'label': 'Template', 'required': False}), 84: ('wagtail.blocks.StructBlock', [[('custom_template', 83), ('custom_css_class', 1), ('custom_id', 2)]], {}), 85: ('wagtail.blocks.StreamBlock', [[('card', 57)]], {'label': 'Content'}), 86: ('wagtail.blocks.StructBlock', [[('settings', 84), ('fluid', 10), ('content', 85)]], {}), 87: ('wagtail.blocks.StreamBlock', [[('row', 82), ('cardgrid', 86), ('html', 29)]], {'label': 'Content'}), 88: ('wagtail.blocks.StructBlock', [[('settings', 3), ('fluid', 4), ('is_parallax', 5), ('background_image', 6), ('tile_image', 7), ('background_color', 8), ('foreground_color', 9), ('content', 87)]], {})}, verbose_name='Content')), - ], - options={ - 'verbose_name': 'Footer', - }, - ), migrations.CreateModel( name='FormPage', fields=[ @@ -128,26 +117,27 @@ class Migration(migrations.Migration): bases=('coderedcms.coderedpage',), ), migrations.CreateModel( - name='Navbar', + name='WebPage', fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=255)), - ('content', wagtail.fields.StreamField([('link', 10), ('dropdown', 43)], block_lookup={0: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Default')], 'label': 'Template', 'required': False}), 1: ('wagtail.blocks.CharBlock', (), {'label': 'Custom CSS Class', 'max_length': 255, 'required': False}), 2: ('wagtail.blocks.CharBlock', (), {'label': 'Custom ID', 'max_length': 255, 'required': False}), 3: ('wagtail.blocks.CharBlock', (), {'label': 'Tracking Event Category', 'max_length': 255, 'required': False}), 4: ('wagtail.blocks.CharBlock', (), {'label': 'Tracking Event Label', 'max_length': 255, 'required': False}), 5: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2), ('ga_tracking_event_category', 3), ('ga_tracking_event_label', 4)]], {}), 6: ('wagtail.blocks.PageChooserBlock', (), {'label': 'Page link', 'required': False}), 7: ('wagtail.documents.blocks.DocumentChooserBlock', (), {'label': 'Document link', 'required': False}), 8: ('wagtail.blocks.CharBlock', (), {'label': 'Other link', 'max_length': 255, 'required': False}), 9: ('wagtail.blocks.CharBlock', (), {'label': 'Title', 'max_length': 255, 'required': False}), 10: ('wagtail.blocks.StructBlock', [[('settings', 5), ('page_link', 6), ('doc_link', 7), ('other_link', 8), ('button_title', 9)]], {}), 11: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2)]], {}), 12: ('wagtail.blocks.CharBlock', (), {'label': 'Title', 'max_length': 255, 'required': True}), 13: ('wagtail.blocks.StreamBlock', [[('link', 10)]], {'label': 'Links', 'required': True}), 14: ('coderedcms.blocks.html_blocks.RichTextBlock', (), {'icon': 'cr-font'}), 15: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('btn-primary', 'Primary'), ('btn-secondary', 'Secondary'), ('btn-success', 'Success'), ('btn-danger', 'Danger'), ('btn-warning', 'Warning'), ('btn-info', 'Info'), ('btn-link', 'Link'), ('btn-light', 'Light'), ('btn-dark', 'Dark'), ('btn-outline-primary', 'Outline Primary'), ('btn-outline-secondary', 'Outline Secondary'), ('btn-outline-success', 'Outline Success'), ('btn-outline-danger', 'Outline Danger'), ('btn-outline-warning', 'Outline Warning'), ('btn-outline-info', 'Outline Info'), ('btn-outline-light', 'Outline Light'), ('btn-outline-dark', 'Outline Dark')], 'label': 'Button Style', 'required': False}), 16: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('btn-sm', 'Small'), ('', 'Default'), ('btn-lg', 'Large')], 'label': 'Button Size', 'required': False}), 17: ('wagtail.blocks.StructBlock', [[('settings', 5), ('page_link', 6), ('doc_link', 7), ('other_link', 8), ('button_title', 9), ('button_style', 15), ('button_size', 16)]], {}), 18: ('wagtail.images.blocks.ImageChooserBlock', (), {'label': 'Image'}), 19: ('wagtail.blocks.StructBlock', [[('settings', 11), ('image', 18)]], {}), 20: ('wagtail.blocks.CharBlock', (), {'help_text': 'Alternate text to show if the image doesn’t load', 'max_length': 255, 'required': True}), 21: ('wagtail.blocks.StructBlock', [[('settings', 5), ('page_link', 6), ('doc_link', 7), ('other_link', 8), ('button_title', 9), ('image', 18), ('alt_text', 20)]], {}), 22: ('wagtail.blocks.RawHTMLBlock', (), {'form_classname': 'monospace', 'icon': 'code', 'label': 'HTML'}), 23: ('wagtail.blocks.StructBlock', [[('settings', 5), ('button_style', 15), ('button_size', 16), ('button_title', 9), ('downloadable_file', 7)]], {}), 24: ('wagtail.embeds.blocks.EmbedBlock', (), {'help_text': 'Link to a YouTube/Vimeo video, tweet, facebook post, etc.', 'label': 'URL', 'required': True}), 25: ('wagtail.blocks.StructBlock', [[('settings', 11), ('url', 24)]], {}), 26: ('wagtail.blocks.TextBlock', (), {'label': 'Quote Text', 'required': True, 'rows': 4}), 27: ('wagtail.blocks.CharBlock', (), {'label': 'Author', 'max_length': 255, 'required': False}), 28: ('wagtail.blocks.StructBlock', [[('settings', 11), ('text', 26), ('author', 27)]], {}), 29: ('wagtail.contrib.table_block.blocks.TableBlock', (), {}), 30: ('wagtail.blocks.StructBlock', [[('settings', 11), ('table', 29)]], {}), 31: ('wagtail.blocks.CharBlock', (), {'help_text': 'Address or search term used to find your location on the map.', 'label': 'Search query', 'max_length': 255, 'required': False}), 32: ('wagtail.blocks.CharBlock', (), {'help_text': 'Map title for screen readers, ex: "Map to Goodale Park"', 'label': 'Map title', 'max_length': 255, 'required': False}), 33: ('wagtail.blocks.CharBlock', (), {'help_text': 'Requires API key to use place ID.', 'label': 'Google place ID', 'max_length': 255, 'required': False}), 34: ('wagtail.blocks.IntegerBlock', (), {'default': 14, 'help_text': 'Requires API key to use zoom. 1: World, 5: Landmass/continent, 10: City, 15: Streets, 20: Buildings', 'label': 'Map zoom level', 'required': False}), 35: ('wagtail.blocks.StructBlock', [[('settings', 11), ('search', 31), ('map_title', 32), ('place_id', 33), ('map_zoom_level', 34)]], {}), 36: ('wagtail.blocks.PageChooserBlock', (), {'help_text': 'Show a preview of pages that are children of the selected page. Uses ordering specified in the page’s LAYOUT tab.', 'label': 'Parent page', 'required': True}), 37: ('coderedcms.blocks.base_blocks.ClassifierTermChooserBlock', (), {'help_text': 'Only show pages that are classified with this term.', 'label': 'Classified as', 'required': False}), 38: ('wagtail.blocks.IntegerBlock', (), {'default': 3, 'label': 'Number of pages to show'}), 39: ('wagtail.blocks.StructBlock', [[('settings', 11), ('indexed_by', 36), ('classified_by', 37), ('num_posts', 38)]], {}), 40: ('wagtail.blocks.PageChooserBlock', (), {'help_text': 'Show a mini preview of the selected page.', 'label': 'Page to preview', 'required': True}), 41: ('wagtail.blocks.StructBlock', [[('settings', 11), ('page', 40)]], {}), 42: ('wagtail.blocks.StreamBlock', [[('text', 14), ('button', 17), ('image', 19), ('image_link', 21), ('html', 22), ('download', 23), ('embed_video', 25), ('quote', 28), ('table', 30), ('google_map', 35), ('page_list', 39), ('page_preview', 41)]], {'label': 'Description', 'required': False}), 43: ('wagtail.blocks.StructBlock', [[('settings', 11), ('title', 12), ('links', 13), ('description', 42)]], {})})), + ('coderedpage_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='coderedcms.coderedpage')), + ('body', wagtail.fields.StreamField([('hero', 88), ('row', 82), ('cardgrid', 86), ('html', 29)], blank=True, block_lookup={0: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Default')], 'label': 'Template', 'required': False}), 1: ('wagtail.blocks.CharBlock', (), {'label': 'Custom CSS Class', 'max_length': 255, 'required': False}), 2: ('wagtail.blocks.CharBlock', (), {'label': 'Custom ID', 'max_length': 255, 'required': False}), 3: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2)]], {}), 4: ('wagtail.blocks.BooleanBlock', (), {'default': True, 'label': 'Full width', 'required': False}), 5: ('wagtail.blocks.BooleanBlock', (), {'help_text': 'Background images scroll slower than foreground images, creating an illusion of depth.', 'label': 'Parallax Effect', 'required': False}), 6: ('wagtail.images.blocks.ImageChooserBlock', (), {'required': False}), 7: ('wagtail.blocks.BooleanBlock', (), {'default': False, 'label': 'Tile background image', 'required': False}), 8: ('wagtail.blocks.CharBlock', (), {'help_text': 'Hexadecimal, rgba, or CSS color notation (e.g. #ff0011)', 'label': 'Background color', 'max_length': 255, 'required': False}), 9: ('wagtail.blocks.CharBlock', (), {'help_text': 'Hexadecimal, rgba, or CSS color notation (e.g. #ff0011)', 'label': 'Text color', 'max_length': 255, 'required': False}), 10: ('wagtail.blocks.BooleanBlock', (), {'label': 'Full width', 'required': False}), 11: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Always expanded'), ('sm', 'sm - Expand on small screens (phone, 576px) and larger'), ('md', 'md - Expand on medium screens (tablet, 768px) and larger'), ('lg', 'lg - Expand on large screens (laptop, 992px) and larger'), ('xl', 'xl - Expand on extra large screens (wide monitor, 1200px)')], 'help_text': 'Screen size at which the column will expand horizontally or stack vertically.', 'required': False, 'verbose_name': 'Column Breakpoint'}), 12: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2), ('column_breakpoint', 11)]], {}), 13: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Automatically size'), ('12', 'Full row'), ('6', 'Half - 1/2 column'), ('4', 'Thirds - 1/3 column'), ('8', 'Thirds - 2/3 column'), ('3', 'Quarters - 1/4 column'), ('9', 'Quarters - 3/4 column'), ('2', 'Sixths - 1/6 column'), ('10', 'Sixths - 5/6 column'), ('1', 'Twelfths - 1/12 column'), ('5', 'Twelfths - 5/12 column'), ('7', 'Twelfths - 7/12 column'), ('11', 'Twelfths - 11/12 column')], 'label': 'Column size', 'required': False}), 14: ('coderedcms.blocks.html_blocks.RichTextBlock', (), {'icon': 'cr-font'}), 15: ('wagtail.blocks.CharBlock', (), {'label': 'Tracking Event Category', 'max_length': 255, 'required': False}), 16: ('wagtail.blocks.CharBlock', (), {'label': 'Tracking Event Label', 'max_length': 255, 'required': False}), 17: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2), ('ga_tracking_event_category', 15), ('ga_tracking_event_label', 16)]], {}), 18: ('wagtail.blocks.PageChooserBlock', (), {'label': 'Page link', 'required': False}), 19: ('wagtail.documents.blocks.DocumentChooserBlock', (), {'label': 'Document link', 'required': False}), 20: ('wagtail.blocks.CharBlock', (), {'label': 'Other link', 'max_length': 255, 'required': False}), 21: ('wagtail.blocks.CharBlock', (), {'label': 'Title', 'max_length': 255, 'required': False}), 22: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('btn-primary', 'Primary'), ('btn-secondary', 'Secondary'), ('btn-success', 'Success'), ('btn-danger', 'Danger'), ('btn-warning', 'Warning'), ('btn-info', 'Info'), ('btn-link', 'Link'), ('btn-light', 'Light'), ('btn-dark', 'Dark'), ('btn-outline-primary', 'Outline Primary'), ('btn-outline-secondary', 'Outline Secondary'), ('btn-outline-success', 'Outline Success'), ('btn-outline-danger', 'Outline Danger'), ('btn-outline-warning', 'Outline Warning'), ('btn-outline-info', 'Outline Info'), ('btn-outline-light', 'Outline Light'), ('btn-outline-dark', 'Outline Dark')], 'label': 'Button Style', 'required': False}), 23: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('btn-sm', 'Small'), ('', 'Default'), ('btn-lg', 'Large')], 'label': 'Button Size', 'required': False}), 24: ('wagtail.blocks.StructBlock', [[('settings', 17), ('page_link', 18), ('doc_link', 19), ('other_link', 20), ('button_title', 21), ('button_style', 22), ('button_size', 23)]], {}), 25: ('wagtail.images.blocks.ImageChooserBlock', (), {'label': 'Image'}), 26: ('wagtail.blocks.StructBlock', [[('settings', 3), ('image', 25)]], {}), 27: ('wagtail.blocks.CharBlock', (), {'help_text': 'Alternate text to show if the image doesn’t load', 'max_length': 255, 'required': True}), 28: ('wagtail.blocks.StructBlock', [[('settings', 17), ('page_link', 18), ('doc_link', 19), ('other_link', 20), ('button_title', 21), ('image', 25), ('alt_text', 27)]], {}), 29: ('wagtail.blocks.RawHTMLBlock', (), {'form_classname': 'monospace', 'icon': 'code', 'label': 'HTML'}), 30: ('wagtail.blocks.StructBlock', [[('settings', 17), ('button_style', 22), ('button_size', 23), ('button_title', 21), ('downloadable_file', 19)]], {}), 31: ('wagtail.embeds.blocks.EmbedBlock', (), {'help_text': 'Link to a YouTube/Vimeo video, tweet, facebook post, etc.', 'label': 'URL', 'required': True}), 32: ('wagtail.blocks.StructBlock', [[('settings', 3), ('url', 31)]], {}), 33: ('wagtail.blocks.TextBlock', (), {'label': 'Quote Text', 'required': True, 'rows': 4}), 34: ('wagtail.blocks.CharBlock', (), {'label': 'Author', 'max_length': 255, 'required': False}), 35: ('wagtail.blocks.StructBlock', [[('settings', 3), ('text', 33), ('author', 34)]], {}), 36: ('wagtail.contrib.table_block.blocks.TableBlock', (), {}), 37: ('wagtail.blocks.StructBlock', [[('settings', 3), ('table', 36)]], {}), 38: ('wagtail.blocks.CharBlock', (), {'help_text': 'Address or search term used to find your location on the map.', 'label': 'Search query', 'max_length': 255, 'required': False}), 39: ('wagtail.blocks.CharBlock', (), {'help_text': 'Map title for screen readers, ex: "Map to Goodale Park"', 'label': 'Map title', 'max_length': 255, 'required': False}), 40: ('wagtail.blocks.CharBlock', (), {'help_text': 'Requires API key to use place ID.', 'label': 'Google place ID', 'max_length': 255, 'required': False}), 41: ('wagtail.blocks.IntegerBlock', (), {'default': 14, 'help_text': 'Requires API key to use zoom. 1: World, 5: Landmass/continent, 10: City, 15: Streets, 20: Buildings', 'label': 'Map zoom level', 'required': False}), 42: ('wagtail.blocks.StructBlock', [[('settings', 3), ('search', 38), ('map_title', 39), ('place_id', 40), ('map_zoom_level', 41)]], {}), 43: ('wagtail.blocks.PageChooserBlock', (), {'help_text': 'Show a preview of pages that are children of the selected page. Uses ordering specified in the page’s LAYOUT tab.', 'label': 'Parent page', 'required': True}), 44: ('coderedcms.blocks.base_blocks.ClassifierTermChooserBlock', (), {'help_text': 'Only show pages that are classified with this term.', 'label': 'Classified as', 'required': False}), 45: ('wagtail.blocks.IntegerBlock', (), {'default': 3, 'label': 'Number of pages to show'}), 46: ('wagtail.blocks.StructBlock', [[('settings', 3), ('indexed_by', 43), ('classified_by', 44), ('num_posts', 45)]], {}), 47: ('wagtail.blocks.PageChooserBlock', (), {'help_text': 'Show a mini preview of the selected page.', 'label': 'Page to preview', 'required': True}), 48: ('wagtail.blocks.StructBlock', [[('settings', 3), ('page', 47)]], {}), 49: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.Accordion',), {}), 50: ('wagtail.blocks.StructBlock', [[('settings', 3), ('accordion', 49)]], {}), 51: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Default'), ('coderedcms/blocks/card_block.html', 'Card'), ('coderedcms/blocks/card_head.html', 'Card with header'), ('coderedcms/blocks/card_foot.html', 'Card with footer'), ('coderedcms/blocks/card_head_foot.html', 'Card with header and footer'), ('coderedcms/blocks/card_blurb.html', 'Blurb - rounded image and no border'), ('coderedcms/blocks/card_img.html', 'Cover image - use image as background')], 'label': 'Template', 'required': False}), 52: ('wagtail.blocks.StructBlock', [[('custom_template', 51), ('custom_css_class', 1), ('custom_id', 2)]], {}), 53: ('wagtail.images.blocks.ImageChooserBlock', (), {'label': 'Image', 'max_length': 255, 'required': False}), 54: ('wagtail.blocks.CharBlock', (), {'label': 'Subtitle', 'max_length': 255, 'required': False}), 55: ('wagtail.blocks.RichTextBlock', (), {'features': ['bold', 'italic', 'ol', 'ul', 'hr', 'link', 'document-link'], 'label': 'Body'}), 56: ('wagtail.blocks.StreamBlock', [[('Links', 24)]], {'blank': True, 'label': 'Links', 'required': False}), 57: ('wagtail.blocks.StructBlock', [[('settings', 52), ('image', 53), ('title', 21), ('subtitle', 54), ('description', 55), ('links', 56)]], {}), 58: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.Carousel',), {}), 59: ('wagtail.blocks.StructBlock', [[('settings', 3), ('carousel', 58)]], {}), 60: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.FilmStrip',), {}), 61: ('wagtail.blocks.StructBlock', [[('settings', 3), ('film_strip', 60)]], {}), 62: ('coderedcms.blocks.base_blocks.CollectionChooserBlock', (), {'label': 'Image Collection', 'required': True}), 63: ('wagtail.blocks.StructBlock', [[('settings', 3), ('collection', 62)]], {}), 64: ('wagtail.blocks.CharBlock', (), {'label': 'Modal heading', 'max_length': 255, 'required': False}), 65: ('wagtail.blocks.StreamBlock', [[('text', 14), ('button', 24), ('image', 26), ('image_link', 28), ('html', 29), ('download', 30), ('embed_video', 32), ('quote', 35), ('table', 37), ('google_map', 42), ('page_list', 46), ('page_preview', 48)]], {'label': 'Content'}), 66: ('wagtail.blocks.CharBlock', (), {'icon': 'cr-font', 'label': 'Simple Text', 'max_length': 255}), 67: ('wagtail.blocks.StreamBlock', [[('text', 66), ('button', 24)]], {'label': 'Modal footer', 'required': False}), 68: ('wagtail.blocks.StructBlock', [[('settings', 3), ('button_style', 22), ('button_size', 23), ('button_title', 21), ('header', 64), ('content', 65), ('footer', 67)]], {}), 69: ('wagtail.blocks.CharBlock', (), {'label': 'Heading', 'max_length': 255, 'required': False}), 70: ('wagtail.images.blocks.ImageChooserBlock', (), {'label': 'Image', 'required': False}), 71: ('wagtail.blocks.CharBlock', (), {'label': 'Name', 'max_length': 255, 'required': True}), 72: ('wagtail.blocks.TextBlock', (), {'label': 'Description', 'required': False, 'rows': 4}), 73: ('wagtail.blocks.CharBlock', (), {'help_text': 'Any text here. Include currency sign if desired.', 'label': 'Price', 'required': True}), 74: ('wagtail.blocks.StructBlock', [[('settings', 3), ('image', 70), ('name', 71), ('description', 72), ('price', 73)]], {}), 75: ('wagtail.blocks.StreamBlock', [[('item', 74)]], {'label': 'Items'}), 76: ('wagtail.blocks.StructBlock', [[('settings', 3), ('heading', 69), ('items', 75)]], {}), 77: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.ReusableContent',), {}), 78: ('wagtail.blocks.StructBlock', [[('settings', 3), ('content', 77)]], {}), 79: ('wagtail.blocks.StreamBlock', [[('text', 14), ('button', 24), ('image', 26), ('image_link', 28), ('html', 29), ('download', 30), ('embed_video', 32), ('quote', 35), ('table', 37), ('google_map', 42), ('page_list', 46), ('page_preview', 48), ('accordion', 50), ('card', 57), ('carousel', 59), ('film_strip', 61), ('image_gallery', 63), ('modal', 68), ('pricelist', 76), ('reusable_content', 78)]], {'label': 'Content'}), 80: ('wagtail.blocks.StructBlock', [[('settings', 12), ('column_size', 13), ('content', 79)]], {}), 81: ('wagtail.blocks.StreamBlock', [[('content', 80)]], {'label': 'Content'}), 82: ('wagtail.blocks.StructBlock', [[('settings', 3), ('fluid', 10), ('content', 81)]], {}), 83: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Default'), ('coderedcms/blocks/cardgrid_group.html', 'Card group - attached cards of equal size'), ('coderedcms/blocks/cardgrid_deck.html', 'Card deck - separate cards of equal size'), ('coderedcms/blocks/cardgrid_columns.html', 'Card masonry - fluid brick pattern')], 'label': 'Template', 'required': False}), 84: ('wagtail.blocks.StructBlock', [[('custom_template', 83), ('custom_css_class', 1), ('custom_id', 2)]], {}), 85: ('wagtail.blocks.StreamBlock', [[('card', 57)]], {'label': 'Content'}), 86: ('wagtail.blocks.StructBlock', [[('settings', 84), ('fluid', 10), ('content', 85)]], {}), 87: ('wagtail.blocks.StreamBlock', [[('row', 82), ('cardgrid', 86), ('html', 29)]], {'label': 'Content'}), 88: ('wagtail.blocks.StructBlock', [[('settings', 3), ('fluid', 4), ('is_parallax', 5), ('background_image', 6), ('tile_image', 7), ('background_color', 8), ('foreground_color', 9), ('content', 87)]], {})}, null=True)), ], options={ - 'verbose_name': 'Navigation Bar', + 'verbose_name': 'Web Page', }, + bases=('coderedcms.coderedpage',), ), migrations.CreateModel( - name='WebPage', + name='Navbar', fields=[ - ('coderedpage_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='coderedcms.coderedpage')), - ('body', wagtail.fields.StreamField([('hero', 88), ('row', 82), ('cardgrid', 86), ('html', 29)], blank=True, block_lookup={0: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Default')], 'label': 'Template', 'required': False}), 1: ('wagtail.blocks.CharBlock', (), {'label': 'Custom CSS Class', 'max_length': 255, 'required': False}), 2: ('wagtail.blocks.CharBlock', (), {'label': 'Custom ID', 'max_length': 255, 'required': False}), 3: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2)]], {}), 4: ('wagtail.blocks.BooleanBlock', (), {'default': True, 'label': 'Full width', 'required': False}), 5: ('wagtail.blocks.BooleanBlock', (), {'help_text': 'Background images scroll slower than foreground images, creating an illusion of depth.', 'label': 'Parallax Effect', 'required': False}), 6: ('wagtail.images.blocks.ImageChooserBlock', (), {'required': False}), 7: ('wagtail.blocks.BooleanBlock', (), {'default': False, 'label': 'Tile background image', 'required': False}), 8: ('wagtail.blocks.CharBlock', (), {'help_text': 'Hexadecimal, rgba, or CSS color notation (e.g. #ff0011)', 'label': 'Background color', 'max_length': 255, 'required': False}), 9: ('wagtail.blocks.CharBlock', (), {'help_text': 'Hexadecimal, rgba, or CSS color notation (e.g. #ff0011)', 'label': 'Text color', 'max_length': 255, 'required': False}), 10: ('wagtail.blocks.BooleanBlock', (), {'label': 'Full width', 'required': False}), 11: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Always expanded'), ('sm', 'sm - Expand on small screens (phone, 576px) and larger'), ('md', 'md - Expand on medium screens (tablet, 768px) and larger'), ('lg', 'lg - Expand on large screens (laptop, 992px) and larger'), ('xl', 'xl - Expand on extra large screens (wide monitor, 1200px)')], 'help_text': 'Screen size at which the column will expand horizontally or stack vertically.', 'required': False, 'verbose_name': 'Column Breakpoint'}), 12: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2), ('column_breakpoint', 11)]], {}), 13: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Automatically size'), ('12', 'Full row'), ('6', 'Half - 1/2 column'), ('4', 'Thirds - 1/3 column'), ('8', 'Thirds - 2/3 column'), ('3', 'Quarters - 1/4 column'), ('9', 'Quarters - 3/4 column'), ('2', 'Sixths - 1/6 column'), ('10', 'Sixths - 5/6 column'), ('1', 'Twelfths - 1/12 column'), ('5', 'Twelfths - 5/12 column'), ('7', 'Twelfths - 7/12 column'), ('11', 'Twelfths - 11/12 column')], 'label': 'Column size', 'required': False}), 14: ('coderedcms.blocks.html_blocks.RichTextBlock', (), {'icon': 'cr-font'}), 15: ('wagtail.blocks.CharBlock', (), {'label': 'Tracking Event Category', 'max_length': 255, 'required': False}), 16: ('wagtail.blocks.CharBlock', (), {'label': 'Tracking Event Label', 'max_length': 255, 'required': False}), 17: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2), ('ga_tracking_event_category', 15), ('ga_tracking_event_label', 16)]], {}), 18: ('wagtail.blocks.PageChooserBlock', (), {'label': 'Page link', 'required': False}), 19: ('wagtail.documents.blocks.DocumentChooserBlock', (), {'label': 'Document link', 'required': False}), 20: ('wagtail.blocks.CharBlock', (), {'label': 'Other link', 'max_length': 255, 'required': False}), 21: ('wagtail.blocks.CharBlock', (), {'label': 'Title', 'max_length': 255, 'required': False}), 22: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('btn-primary', 'Primary'), ('btn-secondary', 'Secondary'), ('btn-success', 'Success'), ('btn-danger', 'Danger'), ('btn-warning', 'Warning'), ('btn-info', 'Info'), ('btn-link', 'Link'), ('btn-light', 'Light'), ('btn-dark', 'Dark'), ('btn-outline-primary', 'Outline Primary'), ('btn-outline-secondary', 'Outline Secondary'), ('btn-outline-success', 'Outline Success'), ('btn-outline-danger', 'Outline Danger'), ('btn-outline-warning', 'Outline Warning'), ('btn-outline-info', 'Outline Info'), ('btn-outline-light', 'Outline Light'), ('btn-outline-dark', 'Outline Dark')], 'label': 'Button Style', 'required': False}), 23: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('btn-sm', 'Small'), ('', 'Default'), ('btn-lg', 'Large')], 'label': 'Button Size', 'required': False}), 24: ('wagtail.blocks.StructBlock', [[('settings', 17), ('page_link', 18), ('doc_link', 19), ('other_link', 20), ('button_title', 21), ('button_style', 22), ('button_size', 23)]], {}), 25: ('wagtail.images.blocks.ImageChooserBlock', (), {'label': 'Image'}), 26: ('wagtail.blocks.StructBlock', [[('settings', 3), ('image', 25)]], {}), 27: ('wagtail.blocks.CharBlock', (), {'help_text': 'Alternate text to show if the image doesn’t load', 'max_length': 255, 'required': True}), 28: ('wagtail.blocks.StructBlock', [[('settings', 17), ('page_link', 18), ('doc_link', 19), ('other_link', 20), ('button_title', 21), ('image', 25), ('alt_text', 27)]], {}), 29: ('wagtail.blocks.RawHTMLBlock', (), {'form_classname': 'monospace', 'icon': 'code', 'label': 'HTML'}), 30: ('wagtail.blocks.StructBlock', [[('settings', 17), ('button_style', 22), ('button_size', 23), ('button_title', 21), ('downloadable_file', 19)]], {}), 31: ('wagtail.embeds.blocks.EmbedBlock', (), {'help_text': 'Link to a YouTube/Vimeo video, tweet, facebook post, etc.', 'label': 'URL', 'required': True}), 32: ('wagtail.blocks.StructBlock', [[('settings', 3), ('url', 31)]], {}), 33: ('wagtail.blocks.TextBlock', (), {'label': 'Quote Text', 'required': True, 'rows': 4}), 34: ('wagtail.blocks.CharBlock', (), {'label': 'Author', 'max_length': 255, 'required': False}), 35: ('wagtail.blocks.StructBlock', [[('settings', 3), ('text', 33), ('author', 34)]], {}), 36: ('wagtail.contrib.table_block.blocks.TableBlock', (), {}), 37: ('wagtail.blocks.StructBlock', [[('settings', 3), ('table', 36)]], {}), 38: ('wagtail.blocks.CharBlock', (), {'help_text': 'Address or search term used to find your location on the map.', 'label': 'Search query', 'max_length': 255, 'required': False}), 39: ('wagtail.blocks.CharBlock', (), {'help_text': 'Map title for screen readers, ex: "Map to Goodale Park"', 'label': 'Map title', 'max_length': 255, 'required': False}), 40: ('wagtail.blocks.CharBlock', (), {'help_text': 'Requires API key to use place ID.', 'label': 'Google place ID', 'max_length': 255, 'required': False}), 41: ('wagtail.blocks.IntegerBlock', (), {'default': 14, 'help_text': 'Requires API key to use zoom. 1: World, 5: Landmass/continent, 10: City, 15: Streets, 20: Buildings', 'label': 'Map zoom level', 'required': False}), 42: ('wagtail.blocks.StructBlock', [[('settings', 3), ('search', 38), ('map_title', 39), ('place_id', 40), ('map_zoom_level', 41)]], {}), 43: ('wagtail.blocks.PageChooserBlock', (), {'help_text': 'Show a preview of pages that are children of the selected page. Uses ordering specified in the page’s LAYOUT tab.', 'label': 'Parent page', 'required': True}), 44: ('coderedcms.blocks.base_blocks.ClassifierTermChooserBlock', (), {'help_text': 'Only show pages that are classified with this term.', 'label': 'Classified as', 'required': False}), 45: ('wagtail.blocks.IntegerBlock', (), {'default': 3, 'label': 'Number of pages to show'}), 46: ('wagtail.blocks.StructBlock', [[('settings', 3), ('indexed_by', 43), ('classified_by', 44), ('num_posts', 45)]], {}), 47: ('wagtail.blocks.PageChooserBlock', (), {'help_text': 'Show a mini preview of the selected page.', 'label': 'Page to preview', 'required': True}), 48: ('wagtail.blocks.StructBlock', [[('settings', 3), ('page', 47)]], {}), 49: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.Accordion',), {}), 50: ('wagtail.blocks.StructBlock', [[('settings', 3), ('accordion', 49)]], {}), 51: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Default'), ('coderedcms/blocks/card_block.html', 'Card'), ('coderedcms/blocks/card_head.html', 'Card with header'), ('coderedcms/blocks/card_foot.html', 'Card with footer'), ('coderedcms/blocks/card_head_foot.html', 'Card with header and footer'), ('coderedcms/blocks/card_blurb.html', 'Blurb - rounded image and no border'), ('coderedcms/blocks/card_img.html', 'Cover image - use image as background')], 'label': 'Template', 'required': False}), 52: ('wagtail.blocks.StructBlock', [[('custom_template', 51), ('custom_css_class', 1), ('custom_id', 2)]], {}), 53: ('wagtail.images.blocks.ImageChooserBlock', (), {'label': 'Image', 'max_length': 255, 'required': False}), 54: ('wagtail.blocks.CharBlock', (), {'label': 'Subtitle', 'max_length': 255, 'required': False}), 55: ('wagtail.blocks.RichTextBlock', (), {'features': ['bold', 'italic', 'ol', 'ul', 'hr', 'link', 'document-link'], 'label': 'Body'}), 56: ('wagtail.blocks.StreamBlock', [[('Links', 24)]], {'blank': True, 'label': 'Links', 'required': False}), 57: ('wagtail.blocks.StructBlock', [[('settings', 52), ('image', 53), ('title', 21), ('subtitle', 54), ('description', 55), ('links', 56)]], {}), 58: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.Carousel',), {}), 59: ('wagtail.blocks.StructBlock', [[('settings', 3), ('carousel', 58)]], {}), 60: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.FilmStrip',), {}), 61: ('wagtail.blocks.StructBlock', [[('settings', 3), ('film_strip', 60)]], {}), 62: ('coderedcms.blocks.base_blocks.CollectionChooserBlock', (), {'label': 'Image Collection', 'required': True}), 63: ('wagtail.blocks.StructBlock', [[('settings', 3), ('collection', 62)]], {}), 64: ('wagtail.blocks.CharBlock', (), {'label': 'Modal heading', 'max_length': 255, 'required': False}), 65: ('wagtail.blocks.StreamBlock', [[('text', 14), ('button', 24), ('image', 26), ('image_link', 28), ('html', 29), ('download', 30), ('embed_video', 32), ('quote', 35), ('table', 37), ('google_map', 42), ('page_list', 46), ('page_preview', 48)]], {'label': 'Content'}), 66: ('wagtail.blocks.CharBlock', (), {'icon': 'cr-font', 'label': 'Simple Text', 'max_length': 255}), 67: ('wagtail.blocks.StreamBlock', [[('text', 66), ('button', 24)]], {'label': 'Modal footer', 'required': False}), 68: ('wagtail.blocks.StructBlock', [[('settings', 3), ('button_style', 22), ('button_size', 23), ('button_title', 21), ('header', 64), ('content', 65), ('footer', 67)]], {}), 69: ('wagtail.blocks.CharBlock', (), {'label': 'Heading', 'max_length': 255, 'required': False}), 70: ('wagtail.images.blocks.ImageChooserBlock', (), {'label': 'Image', 'required': False}), 71: ('wagtail.blocks.CharBlock', (), {'label': 'Name', 'max_length': 255, 'required': True}), 72: ('wagtail.blocks.TextBlock', (), {'label': 'Description', 'required': False, 'rows': 4}), 73: ('wagtail.blocks.CharBlock', (), {'help_text': 'Any text here. Include currency sign if desired.', 'label': 'Price', 'required': True}), 74: ('wagtail.blocks.StructBlock', [[('settings', 3), ('image', 70), ('name', 71), ('description', 72), ('price', 73)]], {}), 75: ('wagtail.blocks.StreamBlock', [[('item', 74)]], {'label': 'Items'}), 76: ('wagtail.blocks.StructBlock', [[('settings', 3), ('heading', 69), ('items', 75)]], {}), 77: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.ReusableContent',), {}), 78: ('wagtail.blocks.StructBlock', [[('settings', 3), ('content', 77)]], {}), 79: ('wagtail.blocks.StreamBlock', [[('text', 14), ('button', 24), ('image', 26), ('image_link', 28), ('html', 29), ('download', 30), ('embed_video', 32), ('quote', 35), ('table', 37), ('google_map', 42), ('page_list', 46), ('page_preview', 48), ('accordion', 50), ('card', 57), ('carousel', 59), ('film_strip', 61), ('image_gallery', 63), ('modal', 68), ('pricelist', 76), ('reusable_content', 78)]], {'label': 'Content'}), 80: ('wagtail.blocks.StructBlock', [[('settings', 12), ('column_size', 13), ('content', 79)]], {}), 81: ('wagtail.blocks.StreamBlock', [[('content', 80)]], {'label': 'Content'}), 82: ('wagtail.blocks.StructBlock', [[('settings', 3), ('fluid', 10), ('content', 81)]], {}), 83: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Default'), ('coderedcms/blocks/cardgrid_group.html', 'Card group - attached cards of equal size'), ('coderedcms/blocks/cardgrid_deck.html', 'Card deck - separate cards of equal size'), ('coderedcms/blocks/cardgrid_columns.html', 'Card masonry - fluid brick pattern')], 'label': 'Template', 'required': False}), 84: ('wagtail.blocks.StructBlock', [[('custom_template', 83), ('custom_css_class', 1), ('custom_id', 2)]], {}), 85: ('wagtail.blocks.StreamBlock', [[('card', 57)]], {'label': 'Content'}), 86: ('wagtail.blocks.StructBlock', [[('settings', 84), ('fluid', 10), ('content', 85)]], {}), 87: ('wagtail.blocks.StreamBlock', [[('row', 82), ('cardgrid', 86), ('html', 29)]], {'label': 'Content'}), 88: ('wagtail.blocks.StructBlock', [[('settings', 3), ('fluid', 4), ('is_parallax', 5), ('background_image', 6), ('tile_image', 7), ('background_color', 8), ('foreground_color', 9), ('content', 87)]], {})}, null=True)), + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('content', wagtail.fields.StreamField([('link', 10), ('dropdown', 43)], block_lookup={0: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Default')], 'label': 'Template', 'required': False}), 1: ('wagtail.blocks.CharBlock', (), {'label': 'Custom CSS Class', 'max_length': 255, 'required': False}), 2: ('wagtail.blocks.CharBlock', (), {'label': 'Custom ID', 'max_length': 255, 'required': False}), 3: ('wagtail.blocks.CharBlock', (), {'label': 'Tracking Event Category', 'max_length': 255, 'required': False}), 4: ('wagtail.blocks.CharBlock', (), {'label': 'Tracking Event Label', 'max_length': 255, 'required': False}), 5: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2), ('ga_tracking_event_category', 3), ('ga_tracking_event_label', 4)]], {}), 6: ('wagtail.blocks.PageChooserBlock', (), {'label': 'Page link', 'required': False}), 7: ('wagtail.documents.blocks.DocumentChooserBlock', (), {'label': 'Document link', 'required': False}), 8: ('wagtail.blocks.CharBlock', (), {'label': 'Other link', 'max_length': 255, 'required': False}), 9: ('wagtail.blocks.CharBlock', (), {'label': 'Title', 'max_length': 255, 'required': False}), 10: ('wagtail.blocks.StructBlock', [[('settings', 5), ('page_link', 6), ('doc_link', 7), ('other_link', 8), ('button_title', 9)]], {}), 11: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2)]], {}), 12: ('wagtail.blocks.CharBlock', (), {'label': 'Title', 'max_length': 255, 'required': True}), 13: ('wagtail.blocks.StreamBlock', [[('link', 10)]], {'label': 'Links', 'required': True}), 14: ('coderedcms.blocks.html_blocks.RichTextBlock', (), {'icon': 'cr-font'}), 15: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('btn-primary', 'Primary'), ('btn-secondary', 'Secondary'), ('btn-success', 'Success'), ('btn-danger', 'Danger'), ('btn-warning', 'Warning'), ('btn-info', 'Info'), ('btn-link', 'Link'), ('btn-light', 'Light'), ('btn-dark', 'Dark'), ('btn-outline-primary', 'Outline Primary'), ('btn-outline-secondary', 'Outline Secondary'), ('btn-outline-success', 'Outline Success'), ('btn-outline-danger', 'Outline Danger'), ('btn-outline-warning', 'Outline Warning'), ('btn-outline-info', 'Outline Info'), ('btn-outline-light', 'Outline Light'), ('btn-outline-dark', 'Outline Dark')], 'label': 'Button Style', 'required': False}), 16: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('btn-sm', 'Small'), ('', 'Default'), ('btn-lg', 'Large')], 'label': 'Button Size', 'required': False}), 17: ('wagtail.blocks.StructBlock', [[('settings', 5), ('page_link', 6), ('doc_link', 7), ('other_link', 8), ('button_title', 9), ('button_style', 15), ('button_size', 16)]], {}), 18: ('wagtail.images.blocks.ImageChooserBlock', (), {'label': 'Image'}), 19: ('wagtail.blocks.StructBlock', [[('settings', 11), ('image', 18)]], {}), 20: ('wagtail.blocks.CharBlock', (), {'help_text': 'Alternate text to show if the image doesn’t load', 'max_length': 255, 'required': True}), 21: ('wagtail.blocks.StructBlock', [[('settings', 5), ('page_link', 6), ('doc_link', 7), ('other_link', 8), ('button_title', 9), ('image', 18), ('alt_text', 20)]], {}), 22: ('wagtail.blocks.RawHTMLBlock', (), {'form_classname': 'monospace', 'icon': 'code', 'label': 'HTML'}), 23: ('wagtail.blocks.StructBlock', [[('settings', 5), ('button_style', 15), ('button_size', 16), ('button_title', 9), ('downloadable_file', 7)]], {}), 24: ('wagtail.embeds.blocks.EmbedBlock', (), {'help_text': 'Link to a YouTube/Vimeo video, tweet, facebook post, etc.', 'label': 'URL', 'required': True}), 25: ('wagtail.blocks.StructBlock', [[('settings', 11), ('url', 24)]], {}), 26: ('wagtail.blocks.TextBlock', (), {'label': 'Quote Text', 'required': True, 'rows': 4}), 27: ('wagtail.blocks.CharBlock', (), {'label': 'Author', 'max_length': 255, 'required': False}), 28: ('wagtail.blocks.StructBlock', [[('settings', 11), ('text', 26), ('author', 27)]], {}), 29: ('wagtail.contrib.table_block.blocks.TableBlock', (), {}), 30: ('wagtail.blocks.StructBlock', [[('settings', 11), ('table', 29)]], {}), 31: ('wagtail.blocks.CharBlock', (), {'help_text': 'Address or search term used to find your location on the map.', 'label': 'Search query', 'max_length': 255, 'required': False}), 32: ('wagtail.blocks.CharBlock', (), {'help_text': 'Map title for screen readers, ex: "Map to Goodale Park"', 'label': 'Map title', 'max_length': 255, 'required': False}), 33: ('wagtail.blocks.CharBlock', (), {'help_text': 'Requires API key to use place ID.', 'label': 'Google place ID', 'max_length': 255, 'required': False}), 34: ('wagtail.blocks.IntegerBlock', (), {'default': 14, 'help_text': 'Requires API key to use zoom. 1: World, 5: Landmass/continent, 10: City, 15: Streets, 20: Buildings', 'label': 'Map zoom level', 'required': False}), 35: ('wagtail.blocks.StructBlock', [[('settings', 11), ('search', 31), ('map_title', 32), ('place_id', 33), ('map_zoom_level', 34)]], {}), 36: ('wagtail.blocks.PageChooserBlock', (), {'help_text': 'Show a preview of pages that are children of the selected page. Uses ordering specified in the page’s LAYOUT tab.', 'label': 'Parent page', 'required': True}), 37: ('coderedcms.blocks.base_blocks.ClassifierTermChooserBlock', (), {'help_text': 'Only show pages that are classified with this term.', 'label': 'Classified as', 'required': False}), 38: ('wagtail.blocks.IntegerBlock', (), {'default': 3, 'label': 'Number of pages to show'}), 39: ('wagtail.blocks.StructBlock', [[('settings', 11), ('indexed_by', 36), ('classified_by', 37), ('num_posts', 38)]], {}), 40: ('wagtail.blocks.PageChooserBlock', (), {'help_text': 'Show a mini preview of the selected page.', 'label': 'Page to preview', 'required': True}), 41: ('wagtail.blocks.StructBlock', [[('settings', 11), ('page', 40)]], {}), 42: ('wagtail.blocks.StreamBlock', [[('text', 14), ('button', 17), ('image', 19), ('image_link', 21), ('html', 22), ('download', 23), ('embed_video', 25), ('quote', 28), ('table', 30), ('google_map', 35), ('page_list', 39), ('page_preview', 41)]], {'label': 'Description', 'required': False}), 43: ('wagtail.blocks.StructBlock', [[('settings', 11), ('title', 12), ('links', 13), ('description', 42)]], {})})), + ('site', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='navbars', to='wagtailcore.site')), ], options={ - 'verbose_name': 'Web Page', + 'verbose_name': 'Navigation Bar', }, - bases=('coderedcms.coderedpage',), ), migrations.CreateModel( name='FormPageField', @@ -185,6 +175,18 @@ class Migration(migrations.Migration): 'abstract': False, }, ), + migrations.CreateModel( + name='Footer', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('content', wagtail.fields.StreamField([('hero', 88), ('row', 82), ('cardgrid', 86), ('html', 29)], blank=True, block_lookup={0: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Default')], 'label': 'Template', 'required': False}), 1: ('wagtail.blocks.CharBlock', (), {'label': 'Custom CSS Class', 'max_length': 255, 'required': False}), 2: ('wagtail.blocks.CharBlock', (), {'label': 'Custom ID', 'max_length': 255, 'required': False}), 3: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2)]], {}), 4: ('wagtail.blocks.BooleanBlock', (), {'default': True, 'label': 'Full width', 'required': False}), 5: ('wagtail.blocks.BooleanBlock', (), {'help_text': 'Background images scroll slower than foreground images, creating an illusion of depth.', 'label': 'Parallax Effect', 'required': False}), 6: ('wagtail.images.blocks.ImageChooserBlock', (), {'required': False}), 7: ('wagtail.blocks.BooleanBlock', (), {'default': False, 'label': 'Tile background image', 'required': False}), 8: ('wagtail.blocks.CharBlock', (), {'help_text': 'Hexadecimal, rgba, or CSS color notation (e.g. #ff0011)', 'label': 'Background color', 'max_length': 255, 'required': False}), 9: ('wagtail.blocks.CharBlock', (), {'help_text': 'Hexadecimal, rgba, or CSS color notation (e.g. #ff0011)', 'label': 'Text color', 'max_length': 255, 'required': False}), 10: ('wagtail.blocks.BooleanBlock', (), {'label': 'Full width', 'required': False}), 11: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Always expanded'), ('sm', 'sm - Expand on small screens (phone, 576px) and larger'), ('md', 'md - Expand on medium screens (tablet, 768px) and larger'), ('lg', 'lg - Expand on large screens (laptop, 992px) and larger'), ('xl', 'xl - Expand on extra large screens (wide monitor, 1200px)')], 'help_text': 'Screen size at which the column will expand horizontally or stack vertically.', 'required': False, 'verbose_name': 'Column Breakpoint'}), 12: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2), ('column_breakpoint', 11)]], {}), 13: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Automatically size'), ('12', 'Full row'), ('6', 'Half - 1/2 column'), ('4', 'Thirds - 1/3 column'), ('8', 'Thirds - 2/3 column'), ('3', 'Quarters - 1/4 column'), ('9', 'Quarters - 3/4 column'), ('2', 'Sixths - 1/6 column'), ('10', 'Sixths - 5/6 column'), ('1', 'Twelfths - 1/12 column'), ('5', 'Twelfths - 5/12 column'), ('7', 'Twelfths - 7/12 column'), ('11', 'Twelfths - 11/12 column')], 'label': 'Column size', 'required': False}), 14: ('coderedcms.blocks.html_blocks.RichTextBlock', (), {'icon': 'cr-font'}), 15: ('wagtail.blocks.CharBlock', (), {'label': 'Tracking Event Category', 'max_length': 255, 'required': False}), 16: ('wagtail.blocks.CharBlock', (), {'label': 'Tracking Event Label', 'max_length': 255, 'required': False}), 17: ('wagtail.blocks.StructBlock', [[('custom_template', 0), ('custom_css_class', 1), ('custom_id', 2), ('ga_tracking_event_category', 15), ('ga_tracking_event_label', 16)]], {}), 18: ('wagtail.blocks.PageChooserBlock', (), {'label': 'Page link', 'required': False}), 19: ('wagtail.documents.blocks.DocumentChooserBlock', (), {'label': 'Document link', 'required': False}), 20: ('wagtail.blocks.CharBlock', (), {'label': 'Other link', 'max_length': 255, 'required': False}), 21: ('wagtail.blocks.CharBlock', (), {'label': 'Title', 'max_length': 255, 'required': False}), 22: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('btn-primary', 'Primary'), ('btn-secondary', 'Secondary'), ('btn-success', 'Success'), ('btn-danger', 'Danger'), ('btn-warning', 'Warning'), ('btn-info', 'Info'), ('btn-link', 'Link'), ('btn-light', 'Light'), ('btn-dark', 'Dark'), ('btn-outline-primary', 'Outline Primary'), ('btn-outline-secondary', 'Outline Secondary'), ('btn-outline-success', 'Outline Success'), ('btn-outline-danger', 'Outline Danger'), ('btn-outline-warning', 'Outline Warning'), ('btn-outline-info', 'Outline Info'), ('btn-outline-light', 'Outline Light'), ('btn-outline-dark', 'Outline Dark')], 'label': 'Button Style', 'required': False}), 23: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('btn-sm', 'Small'), ('', 'Default'), ('btn-lg', 'Large')], 'label': 'Button Size', 'required': False}), 24: ('wagtail.blocks.StructBlock', [[('settings', 17), ('page_link', 18), ('doc_link', 19), ('other_link', 20), ('button_title', 21), ('button_style', 22), ('button_size', 23)]], {}), 25: ('wagtail.images.blocks.ImageChooserBlock', (), {'label': 'Image'}), 26: ('wagtail.blocks.StructBlock', [[('settings', 3), ('image', 25)]], {}), 27: ('wagtail.blocks.CharBlock', (), {'help_text': 'Alternate text to show if the image doesn’t load', 'max_length': 255, 'required': True}), 28: ('wagtail.blocks.StructBlock', [[('settings', 17), ('page_link', 18), ('doc_link', 19), ('other_link', 20), ('button_title', 21), ('image', 25), ('alt_text', 27)]], {}), 29: ('wagtail.blocks.RawHTMLBlock', (), {'form_classname': 'monospace', 'icon': 'code', 'label': 'HTML'}), 30: ('wagtail.blocks.StructBlock', [[('settings', 17), ('button_style', 22), ('button_size', 23), ('button_title', 21), ('downloadable_file', 19)]], {}), 31: ('wagtail.embeds.blocks.EmbedBlock', (), {'help_text': 'Link to a YouTube/Vimeo video, tweet, facebook post, etc.', 'label': 'URL', 'required': True}), 32: ('wagtail.blocks.StructBlock', [[('settings', 3), ('url', 31)]], {}), 33: ('wagtail.blocks.TextBlock', (), {'label': 'Quote Text', 'required': True, 'rows': 4}), 34: ('wagtail.blocks.CharBlock', (), {'label': 'Author', 'max_length': 255, 'required': False}), 35: ('wagtail.blocks.StructBlock', [[('settings', 3), ('text', 33), ('author', 34)]], {}), 36: ('wagtail.contrib.table_block.blocks.TableBlock', (), {}), 37: ('wagtail.blocks.StructBlock', [[('settings', 3), ('table', 36)]], {}), 38: ('wagtail.blocks.CharBlock', (), {'help_text': 'Address or search term used to find your location on the map.', 'label': 'Search query', 'max_length': 255, 'required': False}), 39: ('wagtail.blocks.CharBlock', (), {'help_text': 'Map title for screen readers, ex: "Map to Goodale Park"', 'label': 'Map title', 'max_length': 255, 'required': False}), 40: ('wagtail.blocks.CharBlock', (), {'help_text': 'Requires API key to use place ID.', 'label': 'Google place ID', 'max_length': 255, 'required': False}), 41: ('wagtail.blocks.IntegerBlock', (), {'default': 14, 'help_text': 'Requires API key to use zoom. 1: World, 5: Landmass/continent, 10: City, 15: Streets, 20: Buildings', 'label': 'Map zoom level', 'required': False}), 42: ('wagtail.blocks.StructBlock', [[('settings', 3), ('search', 38), ('map_title', 39), ('place_id', 40), ('map_zoom_level', 41)]], {}), 43: ('wagtail.blocks.PageChooserBlock', (), {'help_text': 'Show a preview of pages that are children of the selected page. Uses ordering specified in the page’s LAYOUT tab.', 'label': 'Parent page', 'required': True}), 44: ('coderedcms.blocks.base_blocks.ClassifierTermChooserBlock', (), {'help_text': 'Only show pages that are classified with this term.', 'label': 'Classified as', 'required': False}), 45: ('wagtail.blocks.IntegerBlock', (), {'default': 3, 'label': 'Number of pages to show'}), 46: ('wagtail.blocks.StructBlock', [[('settings', 3), ('indexed_by', 43), ('classified_by', 44), ('num_posts', 45)]], {}), 47: ('wagtail.blocks.PageChooserBlock', (), {'help_text': 'Show a mini preview of the selected page.', 'label': 'Page to preview', 'required': True}), 48: ('wagtail.blocks.StructBlock', [[('settings', 3), ('page', 47)]], {}), 49: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.Accordion',), {}), 50: ('wagtail.blocks.StructBlock', [[('settings', 3), ('accordion', 49)]], {}), 51: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Default'), ('coderedcms/blocks/card_block.html', 'Card'), ('coderedcms/blocks/card_head.html', 'Card with header'), ('coderedcms/blocks/card_foot.html', 'Card with footer'), ('coderedcms/blocks/card_head_foot.html', 'Card with header and footer'), ('coderedcms/blocks/card_blurb.html', 'Blurb - rounded image and no border'), ('coderedcms/blocks/card_img.html', 'Cover image - use image as background')], 'label': 'Template', 'required': False}), 52: ('wagtail.blocks.StructBlock', [[('custom_template', 51), ('custom_css_class', 1), ('custom_id', 2)]], {}), 53: ('wagtail.images.blocks.ImageChooserBlock', (), {'label': 'Image', 'max_length': 255, 'required': False}), 54: ('wagtail.blocks.CharBlock', (), {'label': 'Subtitle', 'max_length': 255, 'required': False}), 55: ('wagtail.blocks.RichTextBlock', (), {'features': ['bold', 'italic', 'ol', 'ul', 'hr', 'link', 'document-link'], 'label': 'Body'}), 56: ('wagtail.blocks.StreamBlock', [[('Links', 24)]], {'blank': True, 'label': 'Links', 'required': False}), 57: ('wagtail.blocks.StructBlock', [[('settings', 52), ('image', 53), ('title', 21), ('subtitle', 54), ('description', 55), ('links', 56)]], {}), 58: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.Carousel',), {}), 59: ('wagtail.blocks.StructBlock', [[('settings', 3), ('carousel', 58)]], {}), 60: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.FilmStrip',), {}), 61: ('wagtail.blocks.StructBlock', [[('settings', 3), ('film_strip', 60)]], {}), 62: ('coderedcms.blocks.base_blocks.CollectionChooserBlock', (), {'label': 'Image Collection', 'required': True}), 63: ('wagtail.blocks.StructBlock', [[('settings', 3), ('collection', 62)]], {}), 64: ('wagtail.blocks.CharBlock', (), {'label': 'Modal heading', 'max_length': 255, 'required': False}), 65: ('wagtail.blocks.StreamBlock', [[('text', 14), ('button', 24), ('image', 26), ('image_link', 28), ('html', 29), ('download', 30), ('embed_video', 32), ('quote', 35), ('table', 37), ('google_map', 42), ('page_list', 46), ('page_preview', 48)]], {'label': 'Content'}), 66: ('wagtail.blocks.CharBlock', (), {'icon': 'cr-font', 'label': 'Simple Text', 'max_length': 255}), 67: ('wagtail.blocks.StreamBlock', [[('text', 66), ('button', 24)]], {'label': 'Modal footer', 'required': False}), 68: ('wagtail.blocks.StructBlock', [[('settings', 3), ('button_style', 22), ('button_size', 23), ('button_title', 21), ('header', 64), ('content', 65), ('footer', 67)]], {}), 69: ('wagtail.blocks.CharBlock', (), {'label': 'Heading', 'max_length': 255, 'required': False}), 70: ('wagtail.images.blocks.ImageChooserBlock', (), {'label': 'Image', 'required': False}), 71: ('wagtail.blocks.CharBlock', (), {'label': 'Name', 'max_length': 255, 'required': True}), 72: ('wagtail.blocks.TextBlock', (), {'label': 'Description', 'required': False, 'rows': 4}), 73: ('wagtail.blocks.CharBlock', (), {'help_text': 'Any text here. Include currency sign if desired.', 'label': 'Price', 'required': True}), 74: ('wagtail.blocks.StructBlock', [[('settings', 3), ('image', 70), ('name', 71), ('description', 72), ('price', 73)]], {}), 75: ('wagtail.blocks.StreamBlock', [[('item', 74)]], {'label': 'Items'}), 76: ('wagtail.blocks.StructBlock', [[('settings', 3), ('heading', 69), ('items', 75)]], {}), 77: ('wagtail.snippets.blocks.SnippetChooserBlock', ('coderedcms.ReusableContent',), {}), 78: ('wagtail.blocks.StructBlock', [[('settings', 3), ('content', 77)]], {}), 79: ('wagtail.blocks.StreamBlock', [[('text', 14), ('button', 24), ('image', 26), ('image_link', 28), ('html', 29), ('download', 30), ('embed_video', 32), ('quote', 35), ('table', 37), ('google_map', 42), ('page_list', 46), ('page_preview', 48), ('accordion', 50), ('card', 57), ('carousel', 59), ('film_strip', 61), ('image_gallery', 63), ('modal', 68), ('pricelist', 76), ('reusable_content', 78)]], {'label': 'Content'}), 80: ('wagtail.blocks.StructBlock', [[('settings', 12), ('column_size', 13), ('content', 79)]], {}), 81: ('wagtail.blocks.StreamBlock', [[('content', 80)]], {'label': 'Content'}), 82: ('wagtail.blocks.StructBlock', [[('settings', 3), ('fluid', 10), ('content', 81)]], {}), 83: ('wagtail.blocks.ChoiceBlock', [], {'choices': [('', 'Default'), ('coderedcms/blocks/cardgrid_group.html', 'Card group - attached cards of equal size'), ('coderedcms/blocks/cardgrid_deck.html', 'Card deck - separate cards of equal size'), ('coderedcms/blocks/cardgrid_columns.html', 'Card masonry - fluid brick pattern')], 'label': 'Template', 'required': False}), 84: ('wagtail.blocks.StructBlock', [[('custom_template', 83), ('custom_css_class', 1), ('custom_id', 2)]], {}), 85: ('wagtail.blocks.StreamBlock', [[('card', 57)]], {'label': 'Content'}), 86: ('wagtail.blocks.StructBlock', [[('settings', 84), ('fluid', 10), ('content', 85)]], {}), 87: ('wagtail.blocks.StreamBlock', [[('row', 82), ('cardgrid', 86), ('html', 29)]], {'label': 'Content'}), 88: ('wagtail.blocks.StructBlock', [[('settings', 3), ('fluid', 4), ('is_parallax', 5), ('background_image', 6), ('tile_image', 7), ('background_color', 8), ('foreground_color', 9), ('content', 87)]], {})}, verbose_name='Content')), + ('site', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='footers', to='wagtailcore.site')), + ], + options={ + 'verbose_name': 'Footer', + }, + ), migrations.CreateModel( name='EventOccurrence', fields=[ diff --git a/coderedcms/project_template/pro/website/migrations/0002_initial_data.py b/coderedcms/project_template/pro/website/migrations/0002_initial_data.py deleted file mode 100644 index 461d68f1..00000000 --- a/coderedcms/project_template/pro/website/migrations/0002_initial_data.py +++ /dev/null @@ -1,52 +0,0 @@ -from django.db import migrations -from wagtail.models import Locale - - -def initial_data(apps, schema_editor): - ContentType = apps.get_model('contenttypes.ContentType') - Page = apps.get_model('wagtailcore.Page') - Site = apps.get_model('wagtailcore.Site') - WebPage = apps.get_model('website.WebPage') - - # Create page content type - webpage_content_type, created = ContentType.objects.get_or_create( - model='webpage', - app_label='website', - ) - - # Delete the default home page generated by wagtail, - # and replace it with a more useful page type. - curr_homepage = Page.objects.filter(slug='home').delete() - - homepage = WebPage.objects.create( - title = "Home", - slug='home', - custom_template='coderedcms/pages/home_page.html', - content_type=webpage_content_type, - path='00010001', - depth=2, - numchild=0, - url_path='/home/', - locale_id=Locale.get_default().id, - ) - - # Create a new default site - Site.objects.create( - hostname='{{ domain }}', - site_name='{{ sitename }}', - root_page_id=homepage.id, - is_default_site=True - ) - - -class Migration(migrations.Migration): - - dependencies = [ - ('coderedcms', '0001_initial'), - ('wagtailcore', '0057_page_locale_fields_notnull'), - ('website', '0001_initial'), - ] - - operations = [ - migrations.RunPython(initial_data), - ] diff --git a/coderedcms/project_template/pro/website/migrations/0003_footer_site_navbar_site.py b/coderedcms/project_template/pro/website/migrations/0003_footer_site_navbar_site.py deleted file mode 100644 index 8743adf0..00000000 --- a/coderedcms/project_template/pro/website/migrations/0003_footer_site_navbar_site.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 5.1.6 on 2025-02-17 15:16 - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('wagtailcore', '0094_alter_page_locale'), - ('website', '0002_initial_data'), - ] - - operations = [ - migrations.AddField( - model_name='footer', - name='site', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='footers', to='wagtailcore.site'), - ), - migrations.AddField( - model_name='navbar', - name='site', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='navbars', to='wagtailcore.site'), - ), - ] From baf42a5fbfd2254354eb8c6cf61d92d0817b2d50 Mon Sep 17 00:00:00 2001 From: jacklinke Date: Thu, 20 Feb 2025 23:31:41 -0500 Subject: [PATCH 4/6] Remove comments about fallback settings, and correct RST links --- .../pro/website/templatetags/website_tags.py | 10 ++------- docs/how_to/headers_and_footers.rst | 21 +++++++------------ 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/coderedcms/project_template/pro/website/templatetags/website_tags.py b/coderedcms/project_template/pro/website/templatetags/website_tags.py index 4afcdd8e..383cd35b 100644 --- a/coderedcms/project_template/pro/website/templatetags/website_tags.py +++ b/coderedcms/project_template/pro/website/templatetags/website_tags.py @@ -12,9 +12,6 @@ def get_website_navbars(context): """Get the navbars for the current site. - If CRX_NAVBAR_FALLBACK is True and no navbars are associated with the current site, returns all navbars. - If we can't determine the current site, returns all navbars regardless of the fallback setting. - Args: context: The template context which contains the current request @@ -26,7 +23,7 @@ def get_website_navbars(context): request = context['request'] # Get the current site from the request current_site = Site.find_for_request(request) - # Get navbars associated with the current site + # Get navbars associated with the current site, if any site_navbars = Navbar.objects.filter(site=current_site) return site_navbars @@ -40,9 +37,6 @@ def get_website_navbars(context): def get_website_footers(context): """Get the footers for the current site. - If CRX_NO_SITE_FOOTER_FALLBACK is True and no footers are associated with the current site, returns all - footers. If we can't determine the current site, returns all footers regardless of the fallback setting. - Args: context: The template context which contains the current request @@ -54,7 +48,7 @@ def get_website_footers(context): request = context['request'] # Get the current site from the request current_site = Site.find_for_request(request) - # Get footers associated with the current site + # Get footers associated with the current site, if any site_footers = Footer.objects.filter(site=current_site) return site_footers diff --git a/docs/how_to/headers_and_footers.rst b/docs/how_to/headers_and_footers.rst index 2abb1869..671546e2 100644 --- a/docs/how_to/headers_and_footers.rst +++ b/docs/how_to/headers_and_footers.rst @@ -15,10 +15,7 @@ allows you to select specific navbars for your site. For the pro template, create navbars under **Snippets > Navbar** and select the specific site for each navbar within the navbar snippet edit page. Navbars are ordered by the -default model ordering. When no site-specific navbars are configured and -`CRX_NO_SITE_NAVBAR_FALLBACK` is True (default in pro template), all navbars will be -displayed. Set `CRX_NO_SITE_NAVBAR_FALLBACK = False` in your settings to disable this -fallback behavior. +default model ordering. Customizing the design of the stock navbar can be accomplished through Django template overrides. Create a `templates/coderedcms/snippets` directory in your project, @@ -27,8 +24,9 @@ most likely in the `website` directory. In that directory create a file called `navbar.html`. This file will then override the `navbar.html` file included with Wagtail CRX. -It is advisable to initially copy the contents of [Wagtail CRX navbar.html](https://github.com/coderedcorp/coderedcms/blob/main/coderedcms/templates/coderedcms/snippets/navbar.html), but -not necessary. +It is advisable to initially copy the contents of Wagtail CRX navbar.html +See `Wagtail CRX navbar.html `_, +but not necessary. Footer ------ @@ -39,10 +37,7 @@ For the basic template, use **Settings > CRX Settings** to select which footers display and specify their ordering through the Site Footers setting. For the pro template, select the specific site within each footer snippet edit page. -Footers are ordered by the default model ordering. When no site-specific footers are -configured and `CRX_NO_SITE_FOOTER_FALLBACK` is True (default in pro template), all -footers will be displayed. Set `CRX_NO_SITE_FOOTER_FALLBACK = False` in your settings -to disable this fallback behavior. +Footers are ordered by the default model ordering. Customizing the design of the stock footer can be accomplished similarly to the navbar, by overriding the Django template. Create a `templates/coderedcms/snippets/` @@ -51,6 +46,6 @@ directory in your project, most likely in the `website` directory. In that directory create a file named `footer.html`. This file will then override the `footer.html` file included with Wagtail CRX. -Similarly, it is advisable to initially copy the contents of [Wagtail CRX -footer.html](https://github.com/coderedcorp/coderedcms/blob/main/coderedcms/templates/coderedcms/snippets/footer.html), but -not necessary. +Similarly, it is advisable to initially copy the contents of `Wagtail CRX +footer.html `_, +but not necessary. From bf45118d1cccb62a046f93c57d4e3778d7399adc Mon Sep 17 00:00:00 2001 From: jacklinke Date: Thu, 20 Feb 2025 23:37:20 -0500 Subject: [PATCH 5/6] Apply linting --- coderedcms/project_template/pro/project_name/settings/base.py | 2 -- .../project_template/pro/website/templatetags/website_tags.py | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/coderedcms/project_template/pro/project_name/settings/base.py b/coderedcms/project_template/pro/project_name/settings/base.py index 8a413b16..9d51308f 100644 --- a/coderedcms/project_template/pro/project_name/settings/base.py +++ b/coderedcms/project_template/pro/project_name/settings/base.py @@ -12,7 +12,6 @@ from pathlib import Path - # Build paths inside the project like this: BASE_DIR / "subdir". BASE_DIR = Path(__file__).resolve().parent.parent.parent @@ -194,4 +193,3 @@ # custom implementation. CRX_DISABLE_NAVBAR = True CRX_DISABLE_FOOTER = True - diff --git a/coderedcms/project_template/pro/website/templatetags/website_tags.py b/coderedcms/project_template/pro/website/templatetags/website_tags.py index 383cd35b..4e1749e8 100644 --- a/coderedcms/project_template/pro/website/templatetags/website_tags.py +++ b/coderedcms/project_template/pro/website/templatetags/website_tags.py @@ -20,7 +20,7 @@ def get_website_navbars(context): """ try: # Get the current request from context - request = context['request'] + request = context["request"] # Get the current site from the request current_site = Site.find_for_request(request) # Get navbars associated with the current site, if any @@ -45,7 +45,7 @@ def get_website_footers(context): """ try: # Get the current request from context - request = context['request'] + request = context["request"] # Get the current site from the request current_site = Site.find_for_request(request) # Get footers associated with the current site, if any From 43fbc0d5e29a82287242485fd576a4dafb152afe Mon Sep 17 00:00:00 2001 From: jacklinke Date: Thu, 20 Feb 2025 23:47:14 -0500 Subject: [PATCH 6/6] Correct another linting issue --- coderedcms/project_template/pro/project_name/settings/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/coderedcms/project_template/pro/project_name/settings/base.py b/coderedcms/project_template/pro/project_name/settings/base.py index 9d51308f..d0975ea3 100644 --- a/coderedcms/project_template/pro/project_name/settings/base.py +++ b/coderedcms/project_template/pro/project_name/settings/base.py @@ -12,6 +12,7 @@ from pathlib import Path + # Build paths inside the project like this: BASE_DIR / "subdir". BASE_DIR = Path(__file__).resolve().parent.parent.parent