From 6c6338d4b1a0d4d5f4cb373ea63bde92f8fba0d6 Mon Sep 17 00:00:00 2001 From: Sarah Abderemane Date: Tue, 12 Dec 2023 20:01:33 +0100 Subject: [PATCH 01/16] Change breadcrumbs to dynamic values --- indymeet/templates/includes/breadcrumbs.html | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/indymeet/templates/includes/breadcrumbs.html b/indymeet/templates/includes/breadcrumbs.html index 396a4651..d24cb0ad 100644 --- a/indymeet/templates/includes/breadcrumbs.html +++ b/indymeet/templates/includes/breadcrumbs.html @@ -1,8 +1,13 @@ +{% if self.get_ancestors|length > 1 %} + + +{% endif %} From bbb2210f0802f533a197d3bbe146936fee4ad797 Mon Sep 17 00:00:00 2001 From: Sarah Abderemane Date: Wed, 13 Dec 2023 02:05:02 +0100 Subject: [PATCH 02/16] review accessibility on social icons --- .../django_social_share/templatetags/post_to_facebook.html | 3 +++ .../django_social_share/templatetags/post_to_twitter.html | 3 +++ indymeet/templates/puput/tags/post_to_linkedin.html | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 indymeet/templates/django_social_share/templatetags/post_to_facebook.html create mode 100644 indymeet/templates/django_social_share/templatetags/post_to_twitter.html create mode 100644 indymeet/templates/puput/tags/post_to_linkedin.html diff --git a/indymeet/templates/django_social_share/templatetags/post_to_facebook.html b/indymeet/templates/django_social_share/templatetags/post_to_facebook.html new file mode 100644 index 00000000..4e919d69 --- /dev/null +++ b/indymeet/templates/django_social_share/templatetags/post_to_facebook.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/indymeet/templates/django_social_share/templatetags/post_to_twitter.html b/indymeet/templates/django_social_share/templatetags/post_to_twitter.html new file mode 100644 index 00000000..20dd9786 --- /dev/null +++ b/indymeet/templates/django_social_share/templatetags/post_to_twitter.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/indymeet/templates/puput/tags/post_to_linkedin.html b/indymeet/templates/puput/tags/post_to_linkedin.html new file mode 100644 index 00000000..fdc03ea7 --- /dev/null +++ b/indymeet/templates/puput/tags/post_to_linkedin.html @@ -0,0 +1,3 @@ + \ No newline at end of file From 69ca90eb6a60adc96fb9b087a53530fef80d9ef5 Mon Sep 17 00:00:00 2001 From: Sarah Abderemane Date: Wed, 13 Dec 2023 02:05:21 +0100 Subject: [PATCH 03/16] Add blog stylesheet --- home/static/css/blog.css | 36 ++++++++++++++++++++++++++++++++++++ home/static/css/styles.css | 3 ++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 home/static/css/blog.css diff --git a/home/static/css/blog.css b/home/static/css/blog.css new file mode 100644 index 00000000..b3bf42fa --- /dev/null +++ b/home/static/css/blog.css @@ -0,0 +1,36 @@ +.blog_grid .article .social-share:after { + display: none; +} + +.blog_grid .article .social-share li.social-item { + background-color: var(--main-color); +} + +.about .title-header { + padding-bottom: 1rem; +} + +.about .title-header a { + font-size: 2.5rem; +} + +.about .title-header a:hover { + color: grey; +} + +.about .title-section h2 { + letter-spacing: 0.1rem; + font-family: var(--font-family-sans-serif); +} + +.page-content h2.post_title { + font-family: var(--font-family-sans-serif); +} + +ul.sidebar h4, ul.sidebar h5 { + font-family: var(--font-family-sans-serif); +} + +ul.sidebar h4 { + font-weight: 600; +} \ No newline at end of file diff --git a/home/static/css/styles.css b/home/static/css/styles.css index 369afd87..6643649a 100644 --- a/home/static/css/styles.css +++ b/home/static/css/styles.css @@ -1,3 +1,4 @@ @import "base.css"; @import "landing-page.css"; -@import "events.css"; \ No newline at end of file +@import "events.css"; +@import "blog.css"; \ No newline at end of file From f217174210e47815b2852bd4b6573897b473ca25 Mon Sep 17 00:00:00 2001 From: Sarah Abderemane Date: Wed, 20 Dec 2023 00:54:54 +0100 Subject: [PATCH 04/16] Add style blog page and review block template --- home/static/css/blog.css | 46 ++++++++++++++++++- indymeet/templates/blocks/heading.html | 2 +- .../templates/blocks/quote-left-image.html | 6 +-- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/home/static/css/blog.css b/home/static/css/blog.css index b3bf42fa..b12c64a6 100644 --- a/home/static/css/blog.css +++ b/home/static/css/blog.css @@ -1,8 +1,11 @@ -.blog_grid .article .social-share:after { +.blog_grid .article .social-share:after, +.page-content .social-share-all:before +{ display: none; } -.blog_grid .article .social-share li.social-item { +.blog_grid .article .social-share li.social-item, +.page-content .social-share-all li.social-item { background-color: var(--main-color); } @@ -33,4 +36,43 @@ ul.sidebar h4, ul.sidebar h5 { ul.sidebar h4 { font-weight: 600; +} + +/* --------------------------------------------------------------------- + Blocks +----------------------------------------------------------------------*/ + +.block-paragraph { + color: var(--dark); + margin: 1em 0; +} + +.block-html p { + color: var(--dark); + margin: 1em 0; +} + +.block-left_quote_right_image blockquote { + display: flex; + flex-direction: column; + justify-content: center; + height: 100%; +} + +.block-left_quote_right_image img { + border-radius: 50%; + padding-right: 1rem; +} + + +.block-left_quote_right_image blockquote p { + font-size: calc(var(--bs-body-font-size) * 1.5); +} + +@media screen and (min-width: 768px){ + .block-left_quote_right_image blockquote { + flex-direction: column; + justify-content: center; + height: 100%; + } } \ No newline at end of file diff --git a/indymeet/templates/blocks/heading.html b/indymeet/templates/blocks/heading.html index e559d591..ba13edbd 100644 --- a/indymeet/templates/blocks/heading.html +++ b/indymeet/templates/blocks/heading.html @@ -1 +1 @@ -

{{ value.heading|safe }}

\ No newline at end of file +

{{ value.heading|safe }}

\ No newline at end of file diff --git a/indymeet/templates/blocks/quote-left-image.html b/indymeet/templates/blocks/quote-left-image.html index 063040c7..2da6d194 100644 --- a/indymeet/templates/blocks/quote-left-image.html +++ b/indymeet/templates/blocks/quote-left-image.html @@ -1,9 +1,9 @@ {% load wagtailimages_tags %}
-
-
{% image value.image fill-600x600-c50 %}
-
+
+
{% image value.image fill-600x600-c50 %}
+

{{ value.quote|safe }}

—{{ value.byline }}
From 7466bb08b3cb0df195512fadc6d6ded59e74f678 Mon Sep 17 00:00:00 2001 From: dawnwages Date: Mon, 25 Dec 2023 19:18:54 -0500 Subject: [PATCH 05/16] add text with image heading template block --- indymeet/templates/blocks/text-image-heading.html | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 indymeet/templates/blocks/text-image-heading.html diff --git a/indymeet/templates/blocks/text-image-heading.html b/indymeet/templates/blocks/text-image-heading.html new file mode 100644 index 00000000..3de7ab89 --- /dev/null +++ b/indymeet/templates/blocks/text-image-heading.html @@ -0,0 +1,9 @@ +{% load wagtailimages_tags %} + +
+

{{ value.heading|safe }}

+
+
{% image value.image width-1000 %}
+
{{ value.text|safe }}
+
+
From 926c73826ad705609414cc0db7fcc476058950c9 Mon Sep 17 00:00:00 2001 From: dawnwages Date: Thu, 28 Dec 2023 22:47:12 -0500 Subject: [PATCH 06/16] paragraph limit now 10000 and rich text. --- home/blocks.py | 2 +- .../0003_alter_entrypage_body.py | 178 ++++++++++++++++++ .../0004_alter_entrypage_body.py | 178 ++++++++++++++++++ 3 files changed, 357 insertions(+), 1 deletion(-) create mode 100644 home/puput_migrations/0003_alter_entrypage_body.py create mode 100644 home/puput_migrations/0004_alter_entrypage_body.py diff --git a/home/blocks.py b/home/blocks.py index ce55256d..cc1e63d7 100644 --- a/home/blocks.py +++ b/home/blocks.py @@ -171,7 +171,7 @@ class Meta: class BaseStreamBlock(StreamBlock): heading = HeadingBlock() - paragraph = blocks.CharBlock(max_length=255) + paragraph = blocks.RichTextBlock(max_length=10000) html = blocks.RawHTMLBlock(icon="code", label="Raw HTML") image = ImageChooserBlock() text_with_heading = TextHeadingImageBlock() diff --git a/home/puput_migrations/0003_alter_entrypage_body.py b/home/puput_migrations/0003_alter_entrypage_body.py new file mode 100644 index 00000000..713d4f39 --- /dev/null +++ b/home/puput_migrations/0003_alter_entrypage_body.py @@ -0,0 +1,178 @@ +# Generated by Django 4.1.13 on 2023-12-29 02:59 + +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.table_block.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + dependencies = [ + ("puput", "0002_entrypage_markdown_body"), + ] + + operations = [ + migrations.AlterField( + model_name="entrypage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + class_name="heading-blog", max_length=255 + ), + ) + ] + ), + ), + ("paragraph", wagtail.blocks.RichTextBlock()), + ( + "html", + wagtail.blocks.RawHTMLBlock(icon="code", label="Raw HTML"), + ), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "text_with_heading", + wagtail.blocks.StructBlock( + [ + ("heading", wagtail.blocks.CharBlock(max_length=255)), + ("text", wagtail.blocks.TextBlock()), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ] + ), + ), + ( + "text_with_heading_and_right_image", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + class_name="heading-blog", max_length=255 + ), + ), + ("text", wagtail.blocks.TextBlock()), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ] + ), + ), + ( + "text_with_heading_and_left_image", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + class_name="blog", max_length=255 + ), + ), + ("text", wagtail.blocks.TextBlock()), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ] + ), + ), + ( + "right_image_left_text", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ("text", wagtail.blocks.TextBlock()), + ] + ), + ), + ( + "left_image_right_text", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ("text", wagtail.blocks.TextBlock()), + ] + ), + ), + ( + "left_quote_right_image", + wagtail.blocks.StructBlock( + [ + ("quote", wagtail.blocks.TextBlock()), + ("byline", wagtail.blocks.CharBlock(max_length=255)), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ] + ), + ), + ( + "video_embed", + wagtail.blocks.StructBlock( + [ + ("heading", wagtail.blocks.CharBlock(max_length=255)), + ("text", wagtail.blocks.TextBlock()), + ] + ), + ), + ("table", wagtail.contrib.table_block.blocks.TableBlock()), + ( + "code_block", + wagtail.blocks.StructBlock( + [ + ( + "language", + wagtail.blocks.ChoiceBlock( + choices=[ + ("Python", "python"), + ("Markup", "html"), + ("CSS", "css"), + ("Clojure", "clojure"), + ("Bash", "shell"), + ("Django", "django"), + ("Jinja2", "jinja2"), + ("Docker", "dockerfile"), + ("Git", "git"), + ("GraphQL", "graphql"), + ("Handlebars", "handlebars"), + (".ignore", "gitignore"), + ("JSON", "json"), + ("JSON5", "json5"), + ("Markdown", "md"), + ("Markdown", "md"), + ("React JSX", "jsx"), + ("React TSX", "tsx"), + ("SASS", "sass"), + ("SCSS", "scss"), + ("TypeScript", "ts"), + ("vim", "vim"), + ] + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + blank=True, max_length=255 + ), + ), + ( + "page", + wagtail.blocks.CharBlock( + blank=True, max_length=255 + ), + ), + ( + "code", + wagtail.blocks.TextBlock( + blank=True, max_length=1000 + ), + ), + ] + ), + ), + ], + null=True, + use_json_field=True, + verbose_name="StreamField Body", + ), + ), + ] diff --git a/home/puput_migrations/0004_alter_entrypage_body.py b/home/puput_migrations/0004_alter_entrypage_body.py new file mode 100644 index 00000000..6c57a912 --- /dev/null +++ b/home/puput_migrations/0004_alter_entrypage_body.py @@ -0,0 +1,178 @@ +# Generated by Django 4.1.13 on 2023-12-29 03:41 + +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.table_block.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + dependencies = [ + ("puput", "0003_alter_entrypage_body"), + ] + + operations = [ + migrations.AlterField( + model_name="entrypage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + class_name="heading-blog", max_length=255 + ), + ) + ] + ), + ), + ("paragraph", wagtail.blocks.RichTextBlock(max_length=10000)), + ( + "html", + wagtail.blocks.RawHTMLBlock(icon="code", label="Raw HTML"), + ), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "text_with_heading", + wagtail.blocks.StructBlock( + [ + ("heading", wagtail.blocks.CharBlock(max_length=255)), + ("text", wagtail.blocks.TextBlock()), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ] + ), + ), + ( + "text_with_heading_and_right_image", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + class_name="heading-blog", max_length=255 + ), + ), + ("text", wagtail.blocks.TextBlock()), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ] + ), + ), + ( + "text_with_heading_and_left_image", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + class_name="blog", max_length=255 + ), + ), + ("text", wagtail.blocks.TextBlock()), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ] + ), + ), + ( + "right_image_left_text", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ("text", wagtail.blocks.TextBlock()), + ] + ), + ), + ( + "left_image_right_text", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ("text", wagtail.blocks.TextBlock()), + ] + ), + ), + ( + "left_quote_right_image", + wagtail.blocks.StructBlock( + [ + ("quote", wagtail.blocks.TextBlock()), + ("byline", wagtail.blocks.CharBlock(max_length=255)), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ] + ), + ), + ( + "video_embed", + wagtail.blocks.StructBlock( + [ + ("heading", wagtail.blocks.CharBlock(max_length=255)), + ("text", wagtail.blocks.TextBlock()), + ] + ), + ), + ("table", wagtail.contrib.table_block.blocks.TableBlock()), + ( + "code_block", + wagtail.blocks.StructBlock( + [ + ( + "language", + wagtail.blocks.ChoiceBlock( + choices=[ + ("Python", "python"), + ("Markup", "html"), + ("CSS", "css"), + ("Clojure", "clojure"), + ("Bash", "shell"), + ("Django", "django"), + ("Jinja2", "jinja2"), + ("Docker", "dockerfile"), + ("Git", "git"), + ("GraphQL", "graphql"), + ("Handlebars", "handlebars"), + (".ignore", "gitignore"), + ("JSON", "json"), + ("JSON5", "json5"), + ("Markdown", "md"), + ("Markdown", "md"), + ("React JSX", "jsx"), + ("React TSX", "tsx"), + ("SASS", "sass"), + ("SCSS", "scss"), + ("TypeScript", "ts"), + ("vim", "vim"), + ] + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + blank=True, max_length=255 + ), + ), + ( + "page", + wagtail.blocks.CharBlock( + blank=True, max_length=255 + ), + ), + ( + "code", + wagtail.blocks.TextBlock( + blank=True, max_length=1000 + ), + ), + ] + ), + ), + ], + null=True, + use_json_field=True, + verbose_name="StreamField Body", + ), + ), + ] From c088c15eadae016608d7faaded2fabe6ea97525c Mon Sep 17 00:00:00 2001 From: dawnwages Date: Fri, 29 Dec 2023 00:11:16 -0500 Subject: [PATCH 07/16] removed richtext field, add heading with dropdown for h size --- home/blocks.py | 15 +- .../0018_alter_generalpage_content.py} | 130 +++++++++--------- .../0003_alter_entrypage_body.py | 23 +++- indymeet/templates/base.html | 3 +- indymeet/templates/blocks/heading.html | 2 +- 5 files changed, 102 insertions(+), 71 deletions(-) rename home/{puput_migrations/0004_alter_entrypage_body.py => migrations/0018_alter_generalpage_content.py} (64%) diff --git a/home/blocks.py b/home/blocks.py index cc1e63d7..5e01b16a 100644 --- a/home/blocks.py +++ b/home/blocks.py @@ -31,6 +31,17 @@ class HeadingBlock(blocks.StructBlock): + size = blocks.ChoiceBlock( + choices=[ + ("text-5xl", "h1"), + ("text-4xl", "h2"), + ("text-3xl", "h3"), + ("text-2xl", "h4"), + ("text-xl", "h5"), + ("text-lg", "h6"), + ], + icon="title", + ) heading = blocks.CharBlock(max_length=255, class_name="heading-blog") def __str__(self): @@ -170,8 +181,8 @@ class Meta: class BaseStreamBlock(StreamBlock): - heading = HeadingBlock() - paragraph = blocks.RichTextBlock(max_length=10000) + heading = HeadingBlock(label="Heading") + paragraph = blocks.TextBlock(max_length=10000) html = blocks.RawHTMLBlock(icon="code", label="Raw HTML") image = ImageChooserBlock() text_with_heading = TextHeadingImageBlock() diff --git a/home/puput_migrations/0004_alter_entrypage_body.py b/home/migrations/0018_alter_generalpage_content.py similarity index 64% rename from home/puput_migrations/0004_alter_entrypage_body.py rename to home/migrations/0018_alter_generalpage_content.py index 6c57a912..4e5ee28e 100644 --- a/home/puput_migrations/0004_alter_entrypage_body.py +++ b/home/migrations/0018_alter_generalpage_content.py @@ -1,4 +1,4 @@ -# Generated by Django 4.1.13 on 2023-12-29 03:41 +# Generated by Django 4.1.13 on 2023-12-29 05:06 from django.db import migrations import wagtail.blocks @@ -9,100 +9,84 @@ class Migration(migrations.Migration): dependencies = [ - ("puput", "0003_alter_entrypage_body"), + ("home", "0017_generalpage_generaltag_generalpage_tags"), ] operations = [ migrations.AlterField( - model_name="entrypage", - name="body", + model_name="generalpage", + name="content", field=wagtail.fields.StreamField( [ ( "heading", wagtail.blocks.StructBlock( [ + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("text-5xl", "h1"), + ("text-4xl", "h2"), + ("text-3xl", "h3"), + ("text-2xl", "h4"), + ("text-xl", "h5"), + ("text-lg", "h6"), + ], + icon="title", + ), + ), ( "heading", wagtail.blocks.CharBlock( class_name="heading-blog", max_length=255 ), - ) - ] + ), + ], + class_name="full", ), ), - ("paragraph", wagtail.blocks.RichTextBlock(max_length=10000)), - ( - "html", - wagtail.blocks.RawHTMLBlock(icon="code", label="Raw HTML"), - ), + ("subheading", wagtail.blocks.CharBlock(class_name="full")), + ("paragraph", wagtail.blocks.RichTextBlock(class_name="full")), + ("HTML", wagtail.blocks.RawHTMLBlock(class_name="full")), ("image", wagtail.images.blocks.ImageChooserBlock()), ( "text_with_heading", - wagtail.blocks.StructBlock( - [ - ("heading", wagtail.blocks.CharBlock(max_length=255)), - ("text", wagtail.blocks.TextBlock()), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ] - ), - ), - ( - "text_with_heading_and_right_image", wagtail.blocks.StructBlock( [ ( - "heading", - wagtail.blocks.CharBlock( - class_name="heading-blog", max_length=255 + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("text-5xl", "h1"), + ("text-4xl", "h2"), + ("text-3xl", "h3"), + ("text-2xl", "h4"), + ("text-xl", "h5"), + ("text-lg", "h6"), + ], + icon="title", ), ), - ("text", wagtail.blocks.TextBlock()), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ] - ), - ), - ( - "text_with_heading_and_left_image", - wagtail.blocks.StructBlock( - [ ( "heading", wagtail.blocks.CharBlock( - class_name="blog", max_length=255 + class_name="heading-blog", max_length=255 ), ), - ("text", wagtail.blocks.TextBlock()), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ] + ], + class_name="full", ), ), ( - "right_image_left_text", + "text_heading_image", wagtail.blocks.StructBlock( [ - ("image", wagtail.images.blocks.ImageChooserBlock()), + ("heading", wagtail.blocks.CharBlock(max_length=255)), ("text", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "left_image_right_text", - wagtail.blocks.StructBlock( - [ ("image", wagtail.images.blocks.ImageChooserBlock()), - ("text", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "left_quote_right_image", - wagtail.blocks.StructBlock( - [ - ("quote", wagtail.blocks.TextBlock()), - ("byline", wagtail.blocks.CharBlock(max_length=255)), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ] + ], + class_name="full", ), ), ( @@ -111,10 +95,16 @@ class Migration(migrations.Migration): [ ("heading", wagtail.blocks.CharBlock(max_length=255)), ("text", wagtail.blocks.TextBlock()), - ] + ], + class_name="full", + ), + ), + ( + "table", + wagtail.contrib.table_block.blocks.TableBlock( + class_name="full" ), ), - ("table", wagtail.contrib.table_block.blocks.TableBlock()), ( "code_block", wagtail.blocks.StructBlock( @@ -166,13 +156,27 @@ class Migration(migrations.Migration): blank=True, max_length=1000 ), ), - ] + ], + class_name="full", + ), + ), + ( + "quote_block", + wagtail.blocks.StructBlock( + [ + ("text", wagtail.blocks.CharBlock(max_length=255)), + ( + "attribution", + wagtail.blocks.CharBlock(max_length=255), + ), + ], + class_name="full", ), ), ], + blank=True, null=True, - use_json_field=True, - verbose_name="StreamField Body", + use_json_field=None, ), ), ] diff --git a/home/puput_migrations/0003_alter_entrypage_body.py b/home/puput_migrations/0003_alter_entrypage_body.py index 713d4f39..058ff671 100644 --- a/home/puput_migrations/0003_alter_entrypage_body.py +++ b/home/puput_migrations/0003_alter_entrypage_body.py @@ -1,4 +1,4 @@ -# Generated by Django 4.1.13 on 2023-12-29 02:59 +# Generated by Django 4.1.13 on 2023-12-29 05:06 from django.db import migrations import wagtail.blocks @@ -22,16 +22,31 @@ class Migration(migrations.Migration): "heading", wagtail.blocks.StructBlock( [ + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("text-5xl", "h1"), + ("text-4xl", "h2"), + ("text-3xl", "h3"), + ("text-2xl", "h4"), + ("text-xl", "h5"), + ("text-lg", "h6"), + ], + icon="title", + ), + ), ( "heading", wagtail.blocks.CharBlock( class_name="heading-blog", max_length=255 ), - ) - ] + ), + ], + label="Heading", ), ), - ("paragraph", wagtail.blocks.RichTextBlock()), + ("paragraph", wagtail.blocks.TextBlock(max_length=10000)), ( "html", wagtail.blocks.RawHTMLBlock(icon="code", label="Raw HTML"), diff --git a/indymeet/templates/base.html b/indymeet/templates/base.html index cf42ac65..3843b3bf 100644 --- a/indymeet/templates/base.html +++ b/indymeet/templates/base.html @@ -81,7 +81,6 @@ - @@ -90,6 +89,7 @@ {% include 'includes/breadcrumbs.html' %} {% endif %} + {% wagtailuserbar %} {% include 'includes/messages.html' %} {% block content %} @@ -98,4 +98,5 @@ {# Global javascript #} {% include 'includes/footer.html' %} + diff --git a/indymeet/templates/blocks/heading.html b/indymeet/templates/blocks/heading.html index ba13edbd..d0dac9b7 100644 --- a/indymeet/templates/blocks/heading.html +++ b/indymeet/templates/blocks/heading.html @@ -1 +1 @@ -

{{ value.heading|safe }}

\ No newline at end of file +

{{ value.heading|safe }}

\ No newline at end of file From a654844ede3422a6078f27329f51ed4a54a1d777 Mon Sep 17 00:00:00 2001 From: dawnwages Date: Fri, 29 Dec 2023 01:40:59 -0500 Subject: [PATCH 08/16] list styles for numerated, circle and none --- home/blocks.py | 36 ++++++++++++++++ .../0018_alter_generalpage_content.py | 2 +- .../0003_alter_entrypage_body.py | 42 ++++++++++++++++++- indymeet/templates/blocks/list.html | 7 ++++ 4 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 indymeet/templates/blocks/list.html diff --git a/home/blocks.py b/home/blocks.py index 5e01b16a..cbb2ad9e 100644 --- a/home/blocks.py +++ b/home/blocks.py @@ -51,6 +51,23 @@ class Meta: template = "blocks/heading.html" +class ListBlock(blocks.StructBlock): + size = blocks.ChoiceBlock( + choices=[ + ("circle", "unordered list"), + ("decimal", "ordered list"), + ("none", "unstyled"), + ] + ) + text = blocks.RichTextBlock(features=["ul"]) + + def __str__(self): + return self.text + + class Meta: + template = "blocks/list.html" + + class TextWithHeadingBlock(blocks.StructBlock): heading = blocks.CharBlock(max_length=255, class_name="heading-blog") text = blocks.TextBlock() @@ -182,6 +199,25 @@ class Meta: class BaseStreamBlock(StreamBlock): heading = HeadingBlock(label="Heading") + richtext = blocks.RichTextBlock( + max_length=10000, + features=[ + "ol", + "ul", + "embed", + "bold", + "italic", + "link", + "blockquote", + "superscript", + "subscript", + "strikethrough", + "code", + "hr", + ], + label="Rich Text", + ) + list = ListBlock(label="List") paragraph = blocks.TextBlock(max_length=10000) html = blocks.RawHTMLBlock(icon="code", label="Raw HTML") image = ImageChooserBlock() diff --git a/home/migrations/0018_alter_generalpage_content.py b/home/migrations/0018_alter_generalpage_content.py index 4e5ee28e..23932b9f 100644 --- a/home/migrations/0018_alter_generalpage_content.py +++ b/home/migrations/0018_alter_generalpage_content.py @@ -1,4 +1,4 @@ -# Generated by Django 4.1.13 on 2023-12-29 05:06 +# Generated by Django 4.1.13 on 2023-12-29 06:35 from django.db import migrations import wagtail.blocks diff --git a/home/puput_migrations/0003_alter_entrypage_body.py b/home/puput_migrations/0003_alter_entrypage_body.py index 058ff671..14ad032a 100644 --- a/home/puput_migrations/0003_alter_entrypage_body.py +++ b/home/puput_migrations/0003_alter_entrypage_body.py @@ -1,4 +1,4 @@ -# Generated by Django 4.1.13 on 2023-12-29 05:06 +# Generated by Django 4.1.13 on 2023-12-29 06:35 from django.db import migrations import wagtail.blocks @@ -46,6 +46,46 @@ class Migration(migrations.Migration): label="Heading", ), ), + ( + "richtext", + wagtail.blocks.RichTextBlock( + features=[ + "ol", + "ul", + "embed", + "bold", + "italic", + "link", + "blockquote", + "superscript", + "subscript", + "strikethrough", + "code", + "hr", + ], + label="Rich Text", + max_length=10000, + ), + ), + ( + "list", + wagtail.blocks.StructBlock( + [ + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("circle", "unordered list"), + ("decimal", "ordered list"), + ("none", "unstyled"), + ] + ), + ), + ("text", wagtail.blocks.RichTextBlock(features=["ul"])), + ], + label="List", + ), + ), ("paragraph", wagtail.blocks.TextBlock(max_length=10000)), ( "html", diff --git a/indymeet/templates/blocks/list.html b/indymeet/templates/blocks/list.html new file mode 100644 index 00000000..55722312 --- /dev/null +++ b/indymeet/templates/blocks/list.html @@ -0,0 +1,7 @@ +{% load wagtailcore_tags %} + +
    {{ value.text|richtext }}
\ No newline at end of file From 0e3bb9f71495047f4dc37a2d2da13efee2712190 Mon Sep 17 00:00:00 2001 From: dawnwages Date: Fri, 29 Dec 2023 02:26:05 -0500 Subject: [PATCH 09/16] style image, text, header combination blocks --- indymeet/templates/blocks/left-image-right-text.html | 6 +++--- indymeet/templates/blocks/quote-left-image.html | 6 +++--- indymeet/templates/blocks/right-image-left-text.html | 6 +++--- indymeet/templates/blocks/text-image-heading.html | 8 ++++---- .../templates/blocks/text-with-heading-left-image.html | 10 +++++----- .../blocks/text-with-heading-right-image.html | 8 ++++---- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/indymeet/templates/blocks/left-image-right-text.html b/indymeet/templates/blocks/left-image-right-text.html index 62856499..1a95d61b 100644 --- a/indymeet/templates/blocks/left-image-right-text.html +++ b/indymeet/templates/blocks/left-image-right-text.html @@ -1,9 +1,9 @@ {% load wagtailimages_tags %}
-
-
{% image value.image width-1000 %}
-
{{ value.text|safe }}
+
+
{% image value.image width-1000 %}
+
{{ value.text|safe }}
\ No newline at end of file diff --git a/indymeet/templates/blocks/quote-left-image.html b/indymeet/templates/blocks/quote-left-image.html index 2da6d194..1b104b62 100644 --- a/indymeet/templates/blocks/quote-left-image.html +++ b/indymeet/templates/blocks/quote-left-image.html @@ -1,9 +1,9 @@ {% load wagtailimages_tags %}
-
-
{% image value.image fill-600x600-c50 %}
-
+
+
{% image value.image fill-600x600-c50 %}
+

{{ value.quote|safe }}

—{{ value.byline }}
diff --git a/indymeet/templates/blocks/right-image-left-text.html b/indymeet/templates/blocks/right-image-left-text.html index b0e47d4c..6ea5bc57 100644 --- a/indymeet/templates/blocks/right-image-left-text.html +++ b/indymeet/templates/blocks/right-image-left-text.html @@ -1,8 +1,8 @@ {% load wagtailimages_tags %}
-
-
{{ value.text|safe }}
-
{% image value.image width-1000 %}
+
+
{{ value.text|safe }}
+
{% image value.image width-1000 %}
diff --git a/indymeet/templates/blocks/text-image-heading.html b/indymeet/templates/blocks/text-image-heading.html index 3de7ab89..a6b8a966 100644 --- a/indymeet/templates/blocks/text-image-heading.html +++ b/indymeet/templates/blocks/text-image-heading.html @@ -1,9 +1,9 @@ {% load wagtailimages_tags %}
-

{{ value.heading|safe }}

-
-
{% image value.image width-1000 %}
-
{{ value.text|safe }}
+

{{ value.heading|safe }}

+
+
{% image value.image width-1000 %}
+
{{ value.text|safe }}
diff --git a/indymeet/templates/blocks/text-with-heading-left-image.html b/indymeet/templates/blocks/text-with-heading-left-image.html index 3de7ab89..173f1c97 100644 --- a/indymeet/templates/blocks/text-with-heading-left-image.html +++ b/indymeet/templates/blocks/text-with-heading-left-image.html @@ -1,9 +1,9 @@ {% load wagtailimages_tags %}
-

{{ value.heading|safe }}

-
-
{% image value.image width-1000 %}
-
{{ value.text|safe }}
+

{{ value.heading|safe }}

+
+
{% image value.image width-1000 %}
+
{{ value.text|safe }}
-
+
\ No newline at end of file diff --git a/indymeet/templates/blocks/text-with-heading-right-image.html b/indymeet/templates/blocks/text-with-heading-right-image.html index c517f18e..3bc1dd58 100644 --- a/indymeet/templates/blocks/text-with-heading-right-image.html +++ b/indymeet/templates/blocks/text-with-heading-right-image.html @@ -1,9 +1,9 @@ {% load wagtailimages_tags %}
-

{{ value.heading|safe }}

-
-
{{ value.text|safe }}
-
{% image value.image width-1000 %}
+

{{ value.heading|safe }}

+
+
{{ value.text|safe }}
+
{% image value.image width-1000 %}
From e9519091328c802d02146fab2421b02bb900e9fa Mon Sep 17 00:00:00 2001 From: dawnwages Date: Fri, 29 Dec 2023 02:30:28 -0500 Subject: [PATCH 10/16] add icons for blocks --- home/blocks.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/home/blocks.py b/home/blocks.py index cbb2ad9e..1153670b 100644 --- a/home/blocks.py +++ b/home/blocks.py @@ -59,7 +59,7 @@ class ListBlock(blocks.StructBlock): ("none", "unstyled"), ] ) - text = blocks.RichTextBlock(features=["ul"]) + text = blocks.RichTextBlock(features=["ul"], icon="list-ol") def __str__(self): return self.text @@ -198,12 +198,10 @@ class Meta: class BaseStreamBlock(StreamBlock): - heading = HeadingBlock(label="Heading") + heading = HeadingBlock(label="Heading", icon="h1") richtext = blocks.RichTextBlock( max_length=10000, features=[ - "ol", - "ul", "embed", "bold", "italic", @@ -216,8 +214,9 @@ class BaseStreamBlock(StreamBlock): "hr", ], label="Rich Text", + icon="title", ) - list = ListBlock(label="List") + list = ListBlock(label="List", icon="list-ol") paragraph = blocks.TextBlock(max_length=10000) html = blocks.RawHTMLBlock(icon="code", label="Raw HTML") image = ImageChooserBlock() From 3c56eb19e34291de088081dcb2a4356dc151211a Mon Sep 17 00:00:00 2001 From: dawnwages Date: Fri, 29 Dec 2023 03:11:40 -0500 Subject: [PATCH 11/16] eddit padding for blog entry --- .../blocks/left-image-right-text.html | 12 ++- indymeet/templates/blocks/quote-block.html | 3 +- .../templates/blocks/quote-left-image.html | 2 +- .../blocks/right-image-left-text.html | 12 ++- .../templates/blocks/text-image-heading.html | 12 ++- .../blocks/text-with-heading-left-image.html | 12 ++- .../blocks/text-with-heading-right-image.html | 10 ++- .../templates/blocks/text-with-heading.html | 6 +- indymeet/templates/puput/entry_page.html | 78 ++++++++++--------- .../templates/puput/entry_page_header.html | 6 ++ 10 files changed, 101 insertions(+), 52 deletions(-) create mode 100644 indymeet/templates/puput/entry_page_header.html diff --git a/indymeet/templates/blocks/left-image-right-text.html b/indymeet/templates/blocks/left-image-right-text.html index 1a95d61b..091e9a09 100644 --- a/indymeet/templates/blocks/left-image-right-text.html +++ b/indymeet/templates/blocks/left-image-right-text.html @@ -1,9 +1,15 @@ {% load wagtailimages_tags %}
-
-
{% image value.image width-1000 %}
-
{{ value.text|safe }}
+
+
+
{% image value.image width-1000 %}
+
+

+ {{ value.text|safe }} +

+
+
\ No newline at end of file diff --git a/indymeet/templates/blocks/quote-block.html b/indymeet/templates/blocks/quote-block.html index 6465c8e6..5adecdc7 100644 --- a/indymeet/templates/blocks/quote-block.html +++ b/indymeet/templates/blocks/quote-block.html @@ -1,5 +1,6 @@
-
+
+

{{ value.quote|safe }}

—{{ value.byline }}
diff --git a/indymeet/templates/blocks/quote-left-image.html b/indymeet/templates/blocks/quote-left-image.html index 1b104b62..2915ce88 100644 --- a/indymeet/templates/blocks/quote-left-image.html +++ b/indymeet/templates/blocks/quote-left-image.html @@ -5,7 +5,7 @@
{% image value.image fill-600x600-c50 %}
-

{{ value.quote|safe }}

+

{{ value.quote|safe }}

—{{ value.byline }}
diff --git a/indymeet/templates/blocks/right-image-left-text.html b/indymeet/templates/blocks/right-image-left-text.html index 6ea5bc57..98e389b1 100644 --- a/indymeet/templates/blocks/right-image-left-text.html +++ b/indymeet/templates/blocks/right-image-left-text.html @@ -1,8 +1,14 @@ {% load wagtailimages_tags %}
-
-
{{ value.text|safe }}
-
{% image value.image width-1000 %}
+
+
+
+

+ {{ value.text|safe }} +

+
+
{% image value.image width-1000 %}
+
diff --git a/indymeet/templates/blocks/text-image-heading.html b/indymeet/templates/blocks/text-image-heading.html index a6b8a966..5b043cd1 100644 --- a/indymeet/templates/blocks/text-image-heading.html +++ b/indymeet/templates/blocks/text-image-heading.html @@ -2,8 +2,14 @@

{{ value.heading|safe }}

-
-
{% image value.image width-1000 %}
-
{{ value.text|safe }}
+
+
+
{% image value.image width-1000 %}
+
+

+ {{ value.text|safe }} +

+
+
diff --git a/indymeet/templates/blocks/text-with-heading-left-image.html b/indymeet/templates/blocks/text-with-heading-left-image.html index 173f1c97..73ccb6da 100644 --- a/indymeet/templates/blocks/text-with-heading-left-image.html +++ b/indymeet/templates/blocks/text-with-heading-left-image.html @@ -2,8 +2,14 @@

{{ value.heading|safe }}

-
-
{% image value.image width-1000 %}
-
{{ value.text|safe }}
+
+
+
{% image value.image width-1000 %}
+
+

+ {{ value.text|safe }} +

+
+
\ No newline at end of file diff --git a/indymeet/templates/blocks/text-with-heading-right-image.html b/indymeet/templates/blocks/text-with-heading-right-image.html index 3bc1dd58..3929ab53 100644 --- a/indymeet/templates/blocks/text-with-heading-right-image.html +++ b/indymeet/templates/blocks/text-with-heading-right-image.html @@ -2,8 +2,14 @@

{{ value.heading|safe }}

-
-
{{ value.text|safe }}
+
+
+
+

+ {{ value.text|safe }} +

+
{% image value.image width-1000 %}
+
diff --git a/indymeet/templates/blocks/text-with-heading.html b/indymeet/templates/blocks/text-with-heading.html index 0e1fdb6f..024a6514 100644 --- a/indymeet/templates/blocks/text-with-heading.html +++ b/indymeet/templates/blocks/text-with-heading.html @@ -1,6 +1,10 @@

{{ value.heading }}

- {{ value.text|safe }} +
+

+ {{ value.text|safe }} +

+
diff --git a/indymeet/templates/puput/entry_page.html b/indymeet/templates/puput/entry_page.html index adbaeb1d..78df4d71 100644 --- a/indymeet/templates/puput/entry_page.html +++ b/indymeet/templates/puput/entry_page.html @@ -42,43 +42,51 @@ {% endblock social_share %} {% block content %} -
- {% include 'puput/entry_page_header.html' with entry=self %} -
- {% if self.header_image %} - - {% image self.header_image fill-800x450 as header_image %} - {{ self.header_image.title }} - - {% endif %} - {% include 'puput/entry_links.html' with entry=self %} -
-
- {{ self.body }} -
-
- - {% trans 'Return' %} - +
+
+
+
+
+ {% include 'puput/entry_page_header.html' with entry=self %} +
+ {% if self.header_image %} + + {% image self.header_image fill-800x450 as header_image %} + {{ self.header_image.title }} + + {% endif %} + {% include 'puput/entry_links.html' with entry=self %} +
+
+ {{ self.body }} +
+ + {% entry_url self blog_page as post_url %} + +
+ +
+ {% show_comments %} +
- {% entry_url self blog_page as post_url %} -
- -
- {% show_comments %} -
+
+
{% endblock content %} {% block extra_content %} diff --git a/indymeet/templates/puput/entry_page_header.html b/indymeet/templates/puput/entry_page_header.html new file mode 100644 index 00000000..411971fb --- /dev/null +++ b/indymeet/templates/puput/entry_page_header.html @@ -0,0 +1,6 @@ +{% load puput_tags %} +
+

+ {{ entry.title }} +

+
\ No newline at end of file From e699a657c5d9d4e1f73b0a8535e1b578dbfc8964 Mon Sep 17 00:00:00 2001 From: dawnwages Date: Fri, 29 Dec 2023 03:33:44 -0500 Subject: [PATCH 12/16] margin and block quote styles --- indymeet/templates/blocks/heading.html | 2 +- indymeet/templates/blocks/quote-block.html | 2 +- indymeet/templates/blocks/quote-left-image.html | 4 +++- indymeet/templates/blocks/text-image-heading.html | 2 +- indymeet/templates/blocks/text-with-heading-left-image.html | 2 +- indymeet/templates/blocks/text-with-heading-right-image.html | 2 +- indymeet/templates/blocks/text-with-heading.html | 2 +- indymeet/templates/puput/entry_page.html | 2 +- 8 files changed, 10 insertions(+), 8 deletions(-) diff --git a/indymeet/templates/blocks/heading.html b/indymeet/templates/blocks/heading.html index d0dac9b7..615d8bfe 100644 --- a/indymeet/templates/blocks/heading.html +++ b/indymeet/templates/blocks/heading.html @@ -1 +1 @@ -

{{ value.heading|safe }}

\ No newline at end of file +

{{ value.heading|safe }}

\ No newline at end of file diff --git a/indymeet/templates/blocks/quote-block.html b/indymeet/templates/blocks/quote-block.html index 5adecdc7..483ed38c 100644 --- a/indymeet/templates/blocks/quote-block.html +++ b/indymeet/templates/blocks/quote-block.html @@ -1,7 +1,7 @@
-
+

{{ value.quote|safe }}

—{{ value.byline }}
diff --git a/indymeet/templates/blocks/quote-left-image.html b/indymeet/templates/blocks/quote-left-image.html index 2915ce88..d27384c2 100644 --- a/indymeet/templates/blocks/quote-left-image.html +++ b/indymeet/templates/blocks/quote-left-image.html @@ -1,13 +1,15 @@ {% load wagtailimages_tags %}
+
{% image value.image fill-600x600-c50 %}
-
+

{{ value.quote|safe }}

—{{ value.byline }}
+
diff --git a/indymeet/templates/blocks/text-image-heading.html b/indymeet/templates/blocks/text-image-heading.html index 5b043cd1..9e86169e 100644 --- a/indymeet/templates/blocks/text-image-heading.html +++ b/indymeet/templates/blocks/text-image-heading.html @@ -1,7 +1,7 @@ {% load wagtailimages_tags %}
-

{{ value.heading|safe }}

+

{{ value.heading|safe }}

{% image value.image width-1000 %}
diff --git a/indymeet/templates/blocks/text-with-heading-left-image.html b/indymeet/templates/blocks/text-with-heading-left-image.html index 73ccb6da..4589fd9b 100644 --- a/indymeet/templates/blocks/text-with-heading-left-image.html +++ b/indymeet/templates/blocks/text-with-heading-left-image.html @@ -1,7 +1,7 @@ {% load wagtailimages_tags %}
-

{{ value.heading|safe }}

+

{{ value.heading|safe }}

{% image value.image width-1000 %}
diff --git a/indymeet/templates/blocks/text-with-heading-right-image.html b/indymeet/templates/blocks/text-with-heading-right-image.html index 3929ab53..e3c0896f 100644 --- a/indymeet/templates/blocks/text-with-heading-right-image.html +++ b/indymeet/templates/blocks/text-with-heading-right-image.html @@ -1,7 +1,7 @@ {% load wagtailimages_tags %}
-

{{ value.heading|safe }}

+

{{ value.heading|safe }}

diff --git a/indymeet/templates/blocks/text-with-heading.html b/indymeet/templates/blocks/text-with-heading.html index 024a6514..f8a42f9b 100644 --- a/indymeet/templates/blocks/text-with-heading.html +++ b/indymeet/templates/blocks/text-with-heading.html @@ -1,5 +1,5 @@
-

{{ value.heading }}

+

{{ value.heading }}

diff --git a/indymeet/templates/puput/entry_page.html b/indymeet/templates/puput/entry_page.html index 78df4d71..ceebb0f3 100644 --- a/indymeet/templates/puput/entry_page.html +++ b/indymeet/templates/puput/entry_page.html @@ -58,7 +58,7 @@ {% endif %} {% include 'puput/entry_links.html' with entry=self %} -

+
{{ self.body }}
From bad5a4c147f82399548660cd0d34f31f04d45a80 Mon Sep 17 00:00:00 2001 From: dawnwages Date: Fri, 29 Dec 2023 03:39:22 -0500 Subject: [PATCH 13/16] remove quote from richtext options now that it is a styled block --- home/blocks.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/home/blocks.py b/home/blocks.py index 1153670b..3b0adbb1 100644 --- a/home/blocks.py +++ b/home/blocks.py @@ -206,7 +206,6 @@ class BaseStreamBlock(StreamBlock): "bold", "italic", "link", - "blockquote", "superscript", "subscript", "strikethrough", @@ -225,7 +224,7 @@ class BaseStreamBlock(StreamBlock): text_with_heading_and_left_image = TextWithHeadingWithLeftImageBlock() right_image_left_text = RightImageLeftTextBlock() left_image_right_text = LeftImageRightTextBlock() - left_quote_right_image = QuoteLeftImageBlock() + left_quote_right_image = QuoteLeftImageBlock(icon="openquote") video_embed = VideoEmbed() table = TableBlock() code_block = CodeBlock() From a8e2f5848e16c11b0089468f1afa0e1186f52eb1 Mon Sep 17 00:00:00 2001 From: dawnwages Date: Fri, 29 Dec 2023 03:43:01 -0500 Subject: [PATCH 14/16] alter block quote migration --- .../0004_alter_entrypage_body.py | 239 ++++++++++++++++++ 1 file changed, 239 insertions(+) create mode 100644 home/puput_migrations/0004_alter_entrypage_body.py diff --git a/home/puput_migrations/0004_alter_entrypage_body.py b/home/puput_migrations/0004_alter_entrypage_body.py new file mode 100644 index 00000000..d5b5de86 --- /dev/null +++ b/home/puput_migrations/0004_alter_entrypage_body.py @@ -0,0 +1,239 @@ +# Generated by Django 4.1.13 on 2023-12-29 08:39 + +from django.db import migrations +import wagtail.blocks +import wagtail.contrib.table_block.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + dependencies = [ + ("puput", "0003_alter_entrypage_body"), + ] + + operations = [ + migrations.AlterField( + model_name="entrypage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("text-5xl", "h1"), + ("text-4xl", "h2"), + ("text-3xl", "h3"), + ("text-2xl", "h4"), + ("text-xl", "h5"), + ("text-lg", "h6"), + ], + icon="title", + ), + ), + ( + "heading", + wagtail.blocks.CharBlock( + class_name="heading-blog", max_length=255 + ), + ), + ], + icon="h1", + label="Heading", + ), + ), + ( + "richtext", + wagtail.blocks.RichTextBlock( + features=[ + "embed", + "bold", + "italic", + "link", + "superscript", + "subscript", + "strikethrough", + "code", + "hr", + ], + icon="title", + label="Rich Text", + max_length=10000, + ), + ), + ( + "list", + wagtail.blocks.StructBlock( + [ + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("circle", "unordered list"), + ("decimal", "ordered list"), + ("none", "unstyled"), + ] + ), + ), + ( + "text", + wagtail.blocks.RichTextBlock( + features=["ul"], icon="list-ol" + ), + ), + ], + icon="list-ol", + label="List", + ), + ), + ("paragraph", wagtail.blocks.TextBlock(max_length=10000)), + ( + "html", + wagtail.blocks.RawHTMLBlock(icon="code", label="Raw HTML"), + ), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "text_with_heading", + wagtail.blocks.StructBlock( + [ + ("heading", wagtail.blocks.CharBlock(max_length=255)), + ("text", wagtail.blocks.TextBlock()), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ] + ), + ), + ( + "text_with_heading_and_right_image", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + class_name="heading-blog", max_length=255 + ), + ), + ("text", wagtail.blocks.TextBlock()), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ] + ), + ), + ( + "text_with_heading_and_left_image", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + class_name="blog", max_length=255 + ), + ), + ("text", wagtail.blocks.TextBlock()), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ] + ), + ), + ( + "right_image_left_text", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ("text", wagtail.blocks.TextBlock()), + ] + ), + ), + ( + "left_image_right_text", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ("text", wagtail.blocks.TextBlock()), + ] + ), + ), + ( + "left_quote_right_image", + wagtail.blocks.StructBlock( + [ + ("quote", wagtail.blocks.TextBlock()), + ("byline", wagtail.blocks.CharBlock(max_length=255)), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ], + icon="openquote", + ), + ), + ( + "video_embed", + wagtail.blocks.StructBlock( + [ + ("heading", wagtail.blocks.CharBlock(max_length=255)), + ("text", wagtail.blocks.TextBlock()), + ] + ), + ), + ("table", wagtail.contrib.table_block.blocks.TableBlock()), + ( + "code_block", + wagtail.blocks.StructBlock( + [ + ( + "language", + wagtail.blocks.ChoiceBlock( + choices=[ + ("Python", "python"), + ("Markup", "html"), + ("CSS", "css"), + ("Clojure", "clojure"), + ("Bash", "shell"), + ("Django", "django"), + ("Jinja2", "jinja2"), + ("Docker", "dockerfile"), + ("Git", "git"), + ("GraphQL", "graphql"), + ("Handlebars", "handlebars"), + (".ignore", "gitignore"), + ("JSON", "json"), + ("JSON5", "json5"), + ("Markdown", "md"), + ("Markdown", "md"), + ("React JSX", "jsx"), + ("React TSX", "tsx"), + ("SASS", "sass"), + ("SCSS", "scss"), + ("TypeScript", "ts"), + ("vim", "vim"), + ] + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + blank=True, max_length=255 + ), + ), + ( + "page", + wagtail.blocks.CharBlock( + blank=True, max_length=255 + ), + ), + ( + "code", + wagtail.blocks.TextBlock( + blank=True, max_length=1000 + ), + ), + ] + ), + ), + ], + null=True, + use_json_field=True, + verbose_name="StreamField Body", + ), + ), + ] From 386628566fa9a59226fb1120dc22e475278e6ce6 Mon Sep 17 00:00:00 2001 From: dawnwages Date: Fri, 29 Dec 2023 04:36:43 -0500 Subject: [PATCH 15/16] caption an dlist padding --- home/blocks.py | 15 +- .../0005_alter_entrypage_body.py | 245 ++++++++++++++++++ indymeet/templates/blocks/caption.html | 1 + indymeet/templates/blocks/list.html | 2 +- indymeet/templates/blocks/table.html | 62 +++++ 5 files changed, 323 insertions(+), 2 deletions(-) create mode 100644 home/puput_migrations/0005_alter_entrypage_body.py create mode 100644 indymeet/templates/blocks/caption.html create mode 100644 indymeet/templates/blocks/table.html diff --git a/home/blocks.py b/home/blocks.py index 3b0adbb1..f3e49a97 100644 --- a/home/blocks.py +++ b/home/blocks.py @@ -197,6 +197,18 @@ class Meta: template = "blocks/text-image-heading.html" +class CustomTableBlock(TableBlock): + class Meta: + template = "blocks/table.html" + + +class CustomCaption(blocks.StructBlock): + text = blocks.TextBlock() + + class Meta: + template = "blocks/caption.html" + + class BaseStreamBlock(StreamBlock): heading = HeadingBlock(label="Heading", icon="h1") richtext = blocks.RichTextBlock( @@ -219,6 +231,7 @@ class BaseStreamBlock(StreamBlock): paragraph = blocks.TextBlock(max_length=10000) html = blocks.RawHTMLBlock(icon="code", label="Raw HTML") image = ImageChooserBlock() + caption = CustomCaption() text_with_heading = TextHeadingImageBlock() text_with_heading_and_right_image = TextWithHeadingWithRightImageBlock() text_with_heading_and_left_image = TextWithHeadingWithLeftImageBlock() @@ -226,5 +239,5 @@ class BaseStreamBlock(StreamBlock): left_image_right_text = LeftImageRightTextBlock() left_quote_right_image = QuoteLeftImageBlock(icon="openquote") video_embed = VideoEmbed() - table = TableBlock() + table = CustomTableBlock() code_block = CodeBlock() diff --git a/home/puput_migrations/0005_alter_entrypage_body.py b/home/puput_migrations/0005_alter_entrypage_body.py new file mode 100644 index 00000000..0aedca7c --- /dev/null +++ b/home/puput_migrations/0005_alter_entrypage_body.py @@ -0,0 +1,245 @@ +# Generated by Django 4.1.13 on 2023-12-29 09:33 + +from django.db import migrations +import home.blocks +import wagtail.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + dependencies = [ + ("puput", "0004_alter_entrypage_body"), + ] + + operations = [ + migrations.AlterField( + model_name="entrypage", + name="body", + field=wagtail.fields.StreamField( + [ + ( + "heading", + wagtail.blocks.StructBlock( + [ + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("text-5xl", "h1"), + ("text-4xl", "h2"), + ("text-3xl", "h3"), + ("text-2xl", "h4"), + ("text-xl", "h5"), + ("text-lg", "h6"), + ], + icon="title", + ), + ), + ( + "heading", + wagtail.blocks.CharBlock( + class_name="heading-blog", max_length=255 + ), + ), + ], + icon="h1", + label="Heading", + ), + ), + ( + "richtext", + wagtail.blocks.RichTextBlock( + features=[ + "embed", + "bold", + "italic", + "link", + "superscript", + "subscript", + "strikethrough", + "code", + "hr", + ], + icon="title", + label="Rich Text", + max_length=10000, + ), + ), + ( + "list", + wagtail.blocks.StructBlock( + [ + ( + "size", + wagtail.blocks.ChoiceBlock( + choices=[ + ("circle", "unordered list"), + ("decimal", "ordered list"), + ("none", "unstyled"), + ] + ), + ), + ( + "text", + wagtail.blocks.RichTextBlock( + features=["ul"], icon="list-ol" + ), + ), + ], + icon="list-ol", + label="List", + ), + ), + ("paragraph", wagtail.blocks.TextBlock(max_length=10000)), + ( + "html", + wagtail.blocks.RawHTMLBlock(icon="code", label="Raw HTML"), + ), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "caption", + wagtail.blocks.StructBlock( + [("text", wagtail.blocks.TextBlock())] + ), + ), + ( + "text_with_heading", + wagtail.blocks.StructBlock( + [ + ("heading", wagtail.blocks.CharBlock(max_length=255)), + ("text", wagtail.blocks.TextBlock()), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ] + ), + ), + ( + "text_with_heading_and_right_image", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + class_name="heading-blog", max_length=255 + ), + ), + ("text", wagtail.blocks.TextBlock()), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ] + ), + ), + ( + "text_with_heading_and_left_image", + wagtail.blocks.StructBlock( + [ + ( + "heading", + wagtail.blocks.CharBlock( + class_name="blog", max_length=255 + ), + ), + ("text", wagtail.blocks.TextBlock()), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ] + ), + ), + ( + "right_image_left_text", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ("text", wagtail.blocks.TextBlock()), + ] + ), + ), + ( + "left_image_right_text", + wagtail.blocks.StructBlock( + [ + ("image", wagtail.images.blocks.ImageChooserBlock()), + ("text", wagtail.blocks.TextBlock()), + ] + ), + ), + ( + "left_quote_right_image", + wagtail.blocks.StructBlock( + [ + ("quote", wagtail.blocks.TextBlock()), + ("byline", wagtail.blocks.CharBlock(max_length=255)), + ("image", wagtail.images.blocks.ImageChooserBlock()), + ], + icon="openquote", + ), + ), + ( + "video_embed", + wagtail.blocks.StructBlock( + [ + ("heading", wagtail.blocks.CharBlock(max_length=255)), + ("text", wagtail.blocks.TextBlock()), + ] + ), + ), + ("table", home.blocks.CustomTableBlock()), + ( + "code_block", + wagtail.blocks.StructBlock( + [ + ( + "language", + wagtail.blocks.ChoiceBlock( + choices=[ + ("Python", "python"), + ("Markup", "html"), + ("CSS", "css"), + ("Clojure", "clojure"), + ("Bash", "shell"), + ("Django", "django"), + ("Jinja2", "jinja2"), + ("Docker", "dockerfile"), + ("Git", "git"), + ("GraphQL", "graphql"), + ("Handlebars", "handlebars"), + (".ignore", "gitignore"), + ("JSON", "json"), + ("JSON5", "json5"), + ("Markdown", "md"), + ("Markdown", "md"), + ("React JSX", "jsx"), + ("React TSX", "tsx"), + ("SASS", "sass"), + ("SCSS", "scss"), + ("TypeScript", "ts"), + ("vim", "vim"), + ] + ), + ), + ( + "caption", + wagtail.blocks.CharBlock( + blank=True, max_length=255 + ), + ), + ( + "page", + wagtail.blocks.CharBlock( + blank=True, max_length=255 + ), + ), + ( + "code", + wagtail.blocks.TextBlock( + blank=True, max_length=1000 + ), + ), + ] + ), + ), + ], + null=True, + use_json_field=True, + verbose_name="StreamField Body", + ), + ), + ] diff --git a/indymeet/templates/blocks/caption.html b/indymeet/templates/blocks/caption.html new file mode 100644 index 00000000..1be8fb05 --- /dev/null +++ b/indymeet/templates/blocks/caption.html @@ -0,0 +1 @@ +{{value.text|safe}} \ No newline at end of file diff --git a/indymeet/templates/blocks/list.html b/indymeet/templates/blocks/list.html index 55722312..73f1243b 100644 --- a/indymeet/templates/blocks/list.html +++ b/indymeet/templates/blocks/list.html @@ -4,4 +4,4 @@ list-style-type: {{value.size}} !important; } -
    {{ value.text|richtext }}
\ No newline at end of file +
    {{ value.text|richtext }}
\ No newline at end of file diff --git a/indymeet/templates/blocks/table.html b/indymeet/templates/blocks/table.html new file mode 100644 index 00000000..c0057be8 --- /dev/null +++ b/indymeet/templates/blocks/table.html @@ -0,0 +1,62 @@ +{% load table_block_tags %} +
+
+ + {% if table_caption %} + + {% endif %} + {% if table_header %} + + + {% for column in table_header %} + {% with forloop.counter0 as col_index %} + + {% endwith %} + {% endfor %} + + + {% endif %} + + {% for row in data %} + {% with forloop.counter0 as row_index %} + + {% for column in row %} + {% with forloop.counter0 as col_index %} + {% if first_col_is_header and forloop.first %} + + {% else %} + + {% endif %} + {% endwith %} + {% endfor %} + + {% endwith %} + {% endfor %} + +
{{ table_caption }}
+ {% if column.strip %} + {% if html_renderer %} + {{ column.strip|safe|linebreaksbr }} + {% else %} + {{ column.strip|linebreaksbr }} + {% endif %} + {% endif %} +
+ {% if column.strip %} + {% if html_renderer %} + {{ column.strip|safe|linebreaksbr }} + {% else %} + {{ column.strip|linebreaksbr }} + {% endif %} + {% endif %} + + {% if column.strip %} + {% if html_renderer %} + {{ column.strip|safe|linebreaksbr }} + {% else %} + {{ column.strip|linebreaksbr }} + {% endif %} + {% endif %} +
+
+
From abdf56e9513d73bea32eba902927b0b387b1f065 Mon Sep 17 00:00:00 2001 From: dawnwages Date: Fri, 29 Dec 2023 04:41:32 -0500 Subject: [PATCH 16/16] fix migrations for puput --- .../0003_alter_entrypage_body.py | 222 +--------------- .../0004_alter_entrypage_body.py | 12 +- .../0005_alter_entrypage_body.py | 245 ------------------ 3 files changed, 14 insertions(+), 465 deletions(-) delete mode 100644 home/puput_migrations/0005_alter_entrypage_body.py diff --git a/home/puput_migrations/0003_alter_entrypage_body.py b/home/puput_migrations/0003_alter_entrypage_body.py index 14ad032a..39e0d8c4 100644 --- a/home/puput_migrations/0003_alter_entrypage_body.py +++ b/home/puput_migrations/0003_alter_entrypage_body.py @@ -1,4 +1,4 @@ -# Generated by Django 4.1.13 on 2023-12-29 06:35 +# Generated by Django 4.1.5 on 2023-12-27 17:52 from django.db import migrations import wagtail.blocks @@ -9,225 +9,13 @@ class Migration(migrations.Migration): dependencies = [ - ("puput", "0002_entrypage_markdown_body"), + ('puput', '0002_entrypage_markdown_body'), ] operations = [ migrations.AlterField( - model_name="entrypage", - name="body", - field=wagtail.fields.StreamField( - [ - ( - "heading", - wagtail.blocks.StructBlock( - [ - ( - "size", - wagtail.blocks.ChoiceBlock( - choices=[ - ("text-5xl", "h1"), - ("text-4xl", "h2"), - ("text-3xl", "h3"), - ("text-2xl", "h4"), - ("text-xl", "h5"), - ("text-lg", "h6"), - ], - icon="title", - ), - ), - ( - "heading", - wagtail.blocks.CharBlock( - class_name="heading-blog", max_length=255 - ), - ), - ], - label="Heading", - ), - ), - ( - "richtext", - wagtail.blocks.RichTextBlock( - features=[ - "ol", - "ul", - "embed", - "bold", - "italic", - "link", - "blockquote", - "superscript", - "subscript", - "strikethrough", - "code", - "hr", - ], - label="Rich Text", - max_length=10000, - ), - ), - ( - "list", - wagtail.blocks.StructBlock( - [ - ( - "size", - wagtail.blocks.ChoiceBlock( - choices=[ - ("circle", "unordered list"), - ("decimal", "ordered list"), - ("none", "unstyled"), - ] - ), - ), - ("text", wagtail.blocks.RichTextBlock(features=["ul"])), - ], - label="List", - ), - ), - ("paragraph", wagtail.blocks.TextBlock(max_length=10000)), - ( - "html", - wagtail.blocks.RawHTMLBlock(icon="code", label="Raw HTML"), - ), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ( - "text_with_heading", - wagtail.blocks.StructBlock( - [ - ("heading", wagtail.blocks.CharBlock(max_length=255)), - ("text", wagtail.blocks.TextBlock()), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ] - ), - ), - ( - "text_with_heading_and_right_image", - wagtail.blocks.StructBlock( - [ - ( - "heading", - wagtail.blocks.CharBlock( - class_name="heading-blog", max_length=255 - ), - ), - ("text", wagtail.blocks.TextBlock()), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ] - ), - ), - ( - "text_with_heading_and_left_image", - wagtail.blocks.StructBlock( - [ - ( - "heading", - wagtail.blocks.CharBlock( - class_name="blog", max_length=255 - ), - ), - ("text", wagtail.blocks.TextBlock()), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ] - ), - ), - ( - "right_image_left_text", - wagtail.blocks.StructBlock( - [ - ("image", wagtail.images.blocks.ImageChooserBlock()), - ("text", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "left_image_right_text", - wagtail.blocks.StructBlock( - [ - ("image", wagtail.images.blocks.ImageChooserBlock()), - ("text", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "left_quote_right_image", - wagtail.blocks.StructBlock( - [ - ("quote", wagtail.blocks.TextBlock()), - ("byline", wagtail.blocks.CharBlock(max_length=255)), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ] - ), - ), - ( - "video_embed", - wagtail.blocks.StructBlock( - [ - ("heading", wagtail.blocks.CharBlock(max_length=255)), - ("text", wagtail.blocks.TextBlock()), - ] - ), - ), - ("table", wagtail.contrib.table_block.blocks.TableBlock()), - ( - "code_block", - wagtail.blocks.StructBlock( - [ - ( - "language", - wagtail.blocks.ChoiceBlock( - choices=[ - ("Python", "python"), - ("Markup", "html"), - ("CSS", "css"), - ("Clojure", "clojure"), - ("Bash", "shell"), - ("Django", "django"), - ("Jinja2", "jinja2"), - ("Docker", "dockerfile"), - ("Git", "git"), - ("GraphQL", "graphql"), - ("Handlebars", "handlebars"), - (".ignore", "gitignore"), - ("JSON", "json"), - ("JSON5", "json5"), - ("Markdown", "md"), - ("Markdown", "md"), - ("React JSX", "jsx"), - ("React TSX", "tsx"), - ("SASS", "sass"), - ("SCSS", "scss"), - ("TypeScript", "ts"), - ("vim", "vim"), - ] - ), - ), - ( - "caption", - wagtail.blocks.CharBlock( - blank=True, max_length=255 - ), - ), - ( - "page", - wagtail.blocks.CharBlock( - blank=True, max_length=255 - ), - ), - ( - "code", - wagtail.blocks.TextBlock( - blank=True, max_length=1000 - ), - ), - ] - ), - ), - ], - null=True, - use_json_field=True, - verbose_name="StreamField Body", - ), + model_name='entrypage', + name='body', + field=wagtail.fields.StreamField([('heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(class_name='heading-blog', max_length=255))])), ('paragraph', wagtail.blocks.CharBlock(max_length=255)), ('html', wagtail.blocks.RawHTMLBlock(icon='code', label='Raw HTML')), ('image', wagtail.images.blocks.ImageChooserBlock()), ('text_with_heading', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=255)), ('text', wagtail.blocks.TextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock())])), ('text_with_heading_and_right_image', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(class_name='heading-blog', max_length=255)), ('text', wagtail.blocks.TextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock())])), ('text_with_heading_and_left_image', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(class_name='blog', max_length=255)), ('text', wagtail.blocks.TextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock())])), ('right_image_left_text', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock()), ('text', wagtail.blocks.TextBlock())])), ('left_image_right_text', wagtail.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock()), ('text', wagtail.blocks.TextBlock())])), ('left_quote_right_image', wagtail.blocks.StructBlock([('quote', wagtail.blocks.TextBlock()), ('byline', wagtail.blocks.CharBlock(max_length=255)), ('image', wagtail.images.blocks.ImageChooserBlock())])), ('video_embed', wagtail.blocks.StructBlock([('heading', wagtail.blocks.CharBlock(max_length=255)), ('text', wagtail.blocks.TextBlock())])), ('table', wagtail.contrib.table_block.blocks.TableBlock()), ('code_block', wagtail.blocks.StructBlock([('language', wagtail.blocks.ChoiceBlock(choices=[('Python', 'python'), ('Markup', 'html'), ('CSS', 'css'), ('Clojure', 'clojure'), ('Bash', 'shell'), ('Django', 'django'), ('Jinja2', 'jinja2'), ('Docker', 'dockerfile'), ('Git', 'git'), ('GraphQL', 'graphql'), ('Handlebars', 'handlebars'), ('.ignore', 'gitignore'), ('JSON', 'json'), ('JSON5', 'json5'), ('Markdown', 'md'), ('Markdown', 'md'), ('React JSX', 'jsx'), ('React TSX', 'tsx'), ('SASS', 'sass'), ('SCSS', 'scss'), ('TypeScript', 'ts'), ('vim', 'vim')])), ('caption', wagtail.blocks.CharBlock(blank=True, max_length=255)), ('page', wagtail.blocks.CharBlock(blank=True, max_length=255)), ('code', wagtail.blocks.TextBlock(blank=True, max_length=1000))])), ('rich_text', wagtail.blocks.RichTextBlock())], null=True, use_json_field=True, verbose_name='StreamField Body'), ), ] diff --git a/home/puput_migrations/0004_alter_entrypage_body.py b/home/puput_migrations/0004_alter_entrypage_body.py index d5b5de86..46a1e3bd 100644 --- a/home/puput_migrations/0004_alter_entrypage_body.py +++ b/home/puput_migrations/0004_alter_entrypage_body.py @@ -1,8 +1,8 @@ -# Generated by Django 4.1.13 on 2023-12-29 08:39 +# Generated by Django 4.1.13 on 2023-12-29 09:41 from django.db import migrations +import home.blocks import wagtail.blocks -import wagtail.contrib.table_block.blocks import wagtail.fields import wagtail.images.blocks @@ -97,6 +97,12 @@ class Migration(migrations.Migration): wagtail.blocks.RawHTMLBlock(icon="code", label="Raw HTML"), ), ("image", wagtail.images.blocks.ImageChooserBlock()), + ( + "caption", + wagtail.blocks.StructBlock( + [("text", wagtail.blocks.TextBlock())] + ), + ), ( "text_with_heading", wagtail.blocks.StructBlock( @@ -175,7 +181,7 @@ class Migration(migrations.Migration): ] ), ), - ("table", wagtail.contrib.table_block.blocks.TableBlock()), + ("table", home.blocks.CustomTableBlock()), ( "code_block", wagtail.blocks.StructBlock( diff --git a/home/puput_migrations/0005_alter_entrypage_body.py b/home/puput_migrations/0005_alter_entrypage_body.py deleted file mode 100644 index 0aedca7c..00000000 --- a/home/puput_migrations/0005_alter_entrypage_body.py +++ /dev/null @@ -1,245 +0,0 @@ -# Generated by Django 4.1.13 on 2023-12-29 09:33 - -from django.db import migrations -import home.blocks -import wagtail.blocks -import wagtail.fields -import wagtail.images.blocks - - -class Migration(migrations.Migration): - dependencies = [ - ("puput", "0004_alter_entrypage_body"), - ] - - operations = [ - migrations.AlterField( - model_name="entrypage", - name="body", - field=wagtail.fields.StreamField( - [ - ( - "heading", - wagtail.blocks.StructBlock( - [ - ( - "size", - wagtail.blocks.ChoiceBlock( - choices=[ - ("text-5xl", "h1"), - ("text-4xl", "h2"), - ("text-3xl", "h3"), - ("text-2xl", "h4"), - ("text-xl", "h5"), - ("text-lg", "h6"), - ], - icon="title", - ), - ), - ( - "heading", - wagtail.blocks.CharBlock( - class_name="heading-blog", max_length=255 - ), - ), - ], - icon="h1", - label="Heading", - ), - ), - ( - "richtext", - wagtail.blocks.RichTextBlock( - features=[ - "embed", - "bold", - "italic", - "link", - "superscript", - "subscript", - "strikethrough", - "code", - "hr", - ], - icon="title", - label="Rich Text", - max_length=10000, - ), - ), - ( - "list", - wagtail.blocks.StructBlock( - [ - ( - "size", - wagtail.blocks.ChoiceBlock( - choices=[ - ("circle", "unordered list"), - ("decimal", "ordered list"), - ("none", "unstyled"), - ] - ), - ), - ( - "text", - wagtail.blocks.RichTextBlock( - features=["ul"], icon="list-ol" - ), - ), - ], - icon="list-ol", - label="List", - ), - ), - ("paragraph", wagtail.blocks.TextBlock(max_length=10000)), - ( - "html", - wagtail.blocks.RawHTMLBlock(icon="code", label="Raw HTML"), - ), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ( - "caption", - wagtail.blocks.StructBlock( - [("text", wagtail.blocks.TextBlock())] - ), - ), - ( - "text_with_heading", - wagtail.blocks.StructBlock( - [ - ("heading", wagtail.blocks.CharBlock(max_length=255)), - ("text", wagtail.blocks.TextBlock()), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ] - ), - ), - ( - "text_with_heading_and_right_image", - wagtail.blocks.StructBlock( - [ - ( - "heading", - wagtail.blocks.CharBlock( - class_name="heading-blog", max_length=255 - ), - ), - ("text", wagtail.blocks.TextBlock()), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ] - ), - ), - ( - "text_with_heading_and_left_image", - wagtail.blocks.StructBlock( - [ - ( - "heading", - wagtail.blocks.CharBlock( - class_name="blog", max_length=255 - ), - ), - ("text", wagtail.blocks.TextBlock()), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ] - ), - ), - ( - "right_image_left_text", - wagtail.blocks.StructBlock( - [ - ("image", wagtail.images.blocks.ImageChooserBlock()), - ("text", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "left_image_right_text", - wagtail.blocks.StructBlock( - [ - ("image", wagtail.images.blocks.ImageChooserBlock()), - ("text", wagtail.blocks.TextBlock()), - ] - ), - ), - ( - "left_quote_right_image", - wagtail.blocks.StructBlock( - [ - ("quote", wagtail.blocks.TextBlock()), - ("byline", wagtail.blocks.CharBlock(max_length=255)), - ("image", wagtail.images.blocks.ImageChooserBlock()), - ], - icon="openquote", - ), - ), - ( - "video_embed", - wagtail.blocks.StructBlock( - [ - ("heading", wagtail.blocks.CharBlock(max_length=255)), - ("text", wagtail.blocks.TextBlock()), - ] - ), - ), - ("table", home.blocks.CustomTableBlock()), - ( - "code_block", - wagtail.blocks.StructBlock( - [ - ( - "language", - wagtail.blocks.ChoiceBlock( - choices=[ - ("Python", "python"), - ("Markup", "html"), - ("CSS", "css"), - ("Clojure", "clojure"), - ("Bash", "shell"), - ("Django", "django"), - ("Jinja2", "jinja2"), - ("Docker", "dockerfile"), - ("Git", "git"), - ("GraphQL", "graphql"), - ("Handlebars", "handlebars"), - (".ignore", "gitignore"), - ("JSON", "json"), - ("JSON5", "json5"), - ("Markdown", "md"), - ("Markdown", "md"), - ("React JSX", "jsx"), - ("React TSX", "tsx"), - ("SASS", "sass"), - ("SCSS", "scss"), - ("TypeScript", "ts"), - ("vim", "vim"), - ] - ), - ), - ( - "caption", - wagtail.blocks.CharBlock( - blank=True, max_length=255 - ), - ), - ( - "page", - wagtail.blocks.CharBlock( - blank=True, max_length=255 - ), - ), - ( - "code", - wagtail.blocks.TextBlock( - blank=True, max_length=1000 - ), - ), - ] - ), - ), - ], - null=True, - use_json_field=True, - verbose_name="StreamField Body", - ), - ), - ]