-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Informatics settings now has a place for rich text that will appear in a banner at the top of every page - Home page and site-section page content models now allow rich text and raw HTML blocks
- Loading branch information
1 parent
add52a3
commit 788f50b
Showing
7 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/edrn.theme/src/edrn/theme/templates/includes/site-wide-banner.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{# 🔮 TODO: caching #} | ||
{% load wagtailcore_tags %} | ||
{% if settings.edrnsitecontrols.Informatics.site_wide_banner %} | ||
<div class='container py-3 px-3 mb-3 rounded shadow'> | ||
<div class='row'> | ||
<div class='col-auto'> | ||
{{settings.edrnsitecontrols.Informatics.site_wide_banner|richtext}} | ||
</div> | ||
</div> | ||
</div> | ||
{% endif %} | ||
{# -*- Django HTML -*- #} |
21 changes: 21 additions & 0 deletions
21
src/edrnsite.content/src/edrnsite/content/migrations/0032_alter_sectionpage_body.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 4.1.9 on 2023-10-02 18:23 | ||
|
||
from django.db import migrations | ||
import wagtail.blocks | ||
import wagtail.fields | ||
import wagtail.images.blocks | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('edrnsitecontent', '0031_cdeexplorerobject_stewardship'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='sectionpage', | ||
name='body', | ||
field=wagtail.fields.StreamField([('title', wagtail.blocks.StructBlock([('text', wagtail.blocks.CharBlock(help_text='Title to display', max_length=100, required=True))])), ('section_cards', wagtail.blocks.StructBlock([('cards', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Title of this Site Section Card', max_length=200, required=True)), ('style', wagtail.blocks.ChoiceBlock(choices=[('aqua', 'Aqua'), ('cerulean', 'Cerulean'), ('teal', 'Teal'), ('cyan', 'Cyan'), ('navy', 'Navy')], help_text='Background style for this card', required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Little picture to show in the corner of the card', required=False)), ('page', wagtail.blocks.PageChooserBlock(help_text='Site page to which this card links, optional', required=False)), ('description', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'hr', 'link', 'document-link'], help_text='Short introductory text', required=False)), ('links', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('link_text', wagtail.blocks.CharBlock(help_text="Label for the link; don't use ‘here’", max_length=120, required=False)), ('internal_page', wagtail.blocks.PageChooserBlock(help_text='Page in the site to link to', required=False)), ('external_link', wagtail.blocks.URLBlock(help_text='External URL to link to', required=False)), ('view_name', wagtail.blocks.CharBlock(help_text='Name of a view to link to', max_length=32, required=False))])))])))])), ('raw_html', wagtail.blocks.RawHTMLBlock(help_text='Raw HTML (use with care)')), ('rich_text', wagtail.blocks.RichTextBlock(help_text='Richly formatted text', icon='doc-full', label='Rich Text'))], blank=True, null=True, use_json_field=True), | ||
), | ||
] |
21 changes: 21 additions & 0 deletions
21
src/edrnsite.content/src/edrnsite/content/migrations/0033_alter_homepage_body.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 4.1.9 on 2023-10-02 18:30 | ||
|
||
from django.db import migrations | ||
import wagtail.blocks | ||
import wagtail.fields | ||
import wagtail.images.blocks | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('edrnsitecontent', '0032_alter_sectionpage_body'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='homepage', | ||
name='body', | ||
field=wagtail.fields.StreamField([('title', wagtail.blocks.StructBlock([('text', wagtail.blocks.CharBlock(help_text='Title to display', max_length=100, required=True))])), ('section_cards', wagtail.blocks.StructBlock([('cards', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Title of this Site Section Card', max_length=200, required=True)), ('style', wagtail.blocks.ChoiceBlock(choices=[('aqua', 'Aqua'), ('cerulean', 'Cerulean'), ('teal', 'Teal'), ('cyan', 'Cyan'), ('navy', 'Navy')], help_text='Background style for this card', required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(help_text='Little picture to show in the corner of the card', required=False)), ('page', wagtail.blocks.PageChooserBlock(help_text='Site page to which this card links, optional', required=False)), ('description', wagtail.blocks.RichTextBlock(features=['bold', 'italic', 'hr', 'link', 'document-link'], help_text='Short introductory text', required=False)), ('links', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('link_text', wagtail.blocks.CharBlock(help_text="Label for the link; don't use ‘here’", max_length=120, required=False)), ('internal_page', wagtail.blocks.PageChooserBlock(help_text='Page in the site to link to', required=False)), ('external_link', wagtail.blocks.URLBlock(help_text='External URL to link to', required=False)), ('view_name', wagtail.blocks.CharBlock(help_text='Name of a view to link to', max_length=32, required=False))])))])))])), ('carousel', wagtail.blocks.StructBlock([('media', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock()), ('label', wagtail.blocks.CharBlock(help_text='Overlaid label, if any', max_length=120, required=False)), ('caption', wagtail.blocks.CharBlock(help_text='Overlaid caption, if any', max_length=400, required=False))])))])), ('raw_html', wagtail.blocks.RawHTMLBlock(help_text='Raw HTML (use with care)')), ('rich_text', wagtail.blocks.RichTextBlock(help_text='Richly formatted text', icon='doc-full', label='Rich Text'))], blank=True, null=True, use_json_field=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/edrnsite.controls/src/edrnsite/controls/migrations/0004_informatics_site_wide_banner.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 4.1.9 on 2023-10-02 17:32 | ||
|
||
from django.db import migrations | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('edrnsitecontrols', '0003_informatics_funding_cycle'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='informatics', | ||
name='site_wide_banner', | ||
field=wagtail.fields.RichTextField(blank=True, help_text='Banner to display site-wide at the top of every page'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters