+
{% if page.signup != None %}
- {# Use a two-colum layout #}
-
- {% include "partials/streamfield.html" with twocolumn=True %}
+ {# Use a two-column layout #}
+
+
+
+ {% include "partials/streamfield.html" with twocolumn=True %}
+
+ {% block cta %}{% include "partials/signup.html" %}{% endblock %}
+
- {% block cta %}{% include "partials/signup.html" %}{% endblock %}
-
{% else %}
{# Single column layout #}
-
+
{% include "partials/streamfield.html" %}
{% endif %}
-
-
+
{% endblock %}
diff --git a/network-api/networkapi/mozfest/templates/partials/streamfield.html b/network-api/networkapi/mozfest/templates/partials/streamfield.html
index 749f53e43a9..658775f1f84 100644
--- a/network-api/networkapi/mozfest/templates/partials/streamfield.html
+++ b/network-api/networkapi/mozfest/templates/partials/streamfield.html
@@ -1,9 +1,19 @@
{% load wagtailcore_tags %}
{% for block in page.body %}
- {% if block.block_type == 'heading' %}
-
{{ block.value }}
- {% else %}
- {% include_block block %}
- {% endif %}
+{% if block.block_type == 'paragraph'%}
+
+
+
+ {% if block.block_type == 'heading' %}
+
{{ block.value }}
+ {% else %}
+ {% include_block block with parent_page=page page_type="blog"%}
+ {% endif %}
+
+
+
+{% else %}
+{% include_block block with parent_page=page page_type="blog" %}
+{% endif %}
{% endfor %}
diff --git a/network-api/networkapi/wagtailpages/migrations/0010_blogpage_hero_image.py b/network-api/networkapi/wagtailpages/migrations/0010_blogpage_hero_image.py
new file mode 100644
index 00000000000..6493d6735b3
--- /dev/null
+++ b/network-api/networkapi/wagtailpages/migrations/0010_blogpage_hero_image.py
@@ -0,0 +1,20 @@
+# Generated by Django 3.0.14 on 2021-06-18 20:58
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('wagtailimages', '0023_add_choose_permissions'),
+ ('wagtailpages', '0009_auto_20210603_1034'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='blogpage',
+ name='hero_image',
+ field=models.ForeignKey(blank=True, help_text='Image for the blog page hero section.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='hero_banner_image', to='wagtailimages.Image', verbose_name='Hero Image'),
+ ),
+ ]
diff --git a/network-api/networkapi/wagtailpages/pagemodels/blog/blog.py b/network-api/networkapi/wagtailpages/pagemodels/blog/blog.py
index de431c73549..059fb68f703 100644
--- a/network-api/networkapi/wagtailpages/pagemodels/blog/blog.py
+++ b/network-api/networkapi/wagtailpages/pagemodels/blog/blog.py
@@ -13,6 +13,7 @@
from wagtail.core.models import Orderable, Page
from wagtail.core.fields import StreamField
from wagtail.snippets.edit_handlers import SnippetChooserPanel
+from wagtail.images.edit_handlers import ImageChooserPanel
from taggit.models import TaggedItemBase
from modelcluster.fields import ParentalKey, ParentalManyToManyField
@@ -88,6 +89,22 @@ class BlogPage(FoundationMetadataPageMixin, Page):
zen_nav = True
+ hero_image = models.ForeignKey(
+ 'wagtailimages.Image',
+ null=True,
+ blank=True,
+ on_delete=models.SET_NULL,
+ related_name='hero_banner_image',
+ verbose_name='Hero Image',
+ help_text='Image for the blog page hero section.',
+ )
+ hero_video = models.CharField(
+ blank=True,
+ max_length=500,
+ help_text='URL to video for blog page hero section. (Will take priority over hero image if both entered)',
+
+ )
+
feature_comments = models.BooleanField(
default=False,
help_text='Check this box to add a comment section for this blog post.',
@@ -101,6 +118,8 @@ class BlogPage(FoundationMetadataPageMixin, Page):
heading="Author(s)"
),
FieldPanel('category'),
+ FieldPanel('hero_video'),
+ ImageChooserPanel('hero_image'),
StreamFieldPanel('body'),
FieldPanel('feature_comments'),
]
diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/article_page.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/article_page.html
index 48d78e81aee..662d1c8ba19 100644
--- a/network-api/networkapi/wagtailpages/templates/wagtailpages/article_page.html
+++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/article_page.html
@@ -15,7 +15,7 @@
-
+
{% if page.show_side_share_buttons %}
{% endif %}
-
-
- {% for block in page.body %}
- {% comment %}
- `is_last` is used to determine if a streamfield should close
- after breaking out of its parent container
- {% endcomment %}
- {% include_block block with is_last=forloop.last page_type="article" %}
- {% endfor %}
+
+ {% for block in page.body %}
+ {% if block.block_type == 'content'%}
+
+
+
+ {% if block.block_type == 'heading' %}
+
{{ block.value }}
+ {% else %}
+ {% include_block block with page_type="article" %}
+ {% endif %}
+
+
+
+ {% else %}
+ {% include_block block with parent_page=page page_type="article" %}
+ {% endif %}
+ {% endfor %}
+
+
{% if page.footnotes_list %}
{% include "fragments/footnotes.html" %}
{% endif %}
diff --git a/network-api/networkapi/wagtailpages/templates/wagtailpages/blocks/advanced_table_block.html b/network-api/networkapi/wagtailpages/templates/wagtailpages/blocks/advanced_table_block.html
index 97b98f9d45b..c02666c29b4 100644
--- a/network-api/networkapi/wagtailpages/templates/wagtailpages/blocks/advanced_table_block.html
+++ b/network-api/networkapi/wagtailpages/templates/wagtailpages/blocks/advanced_table_block.html
@@ -1,52 +1,59 @@
{% load wagtailcore_tags %}
-
-
- {% if self.caption %}
- {{ self.caption }}
- {% endif %}
- {# Loop through every row #}
- {% for row in self.table %}
- {# If the "header" is checked, the first row will be a with a highlighted background #}
- {% if self.header and forloop.first %}
-
-
- {% for cell in row.value %}
- |
- {{ cell.value.content|richtext }}
- |
- {% endfor %}
-
-
- {% else %}
- {# For every other row that's not a header... #}
-
- {% for cell in row.value %}
- {# If the first cell is supposed to be highlighted; when "column" is checked #}
- {% if self.column %}
- |
- {{ cell.value.content|richtext }}
- |
+
+
+
+
+
+ {% if self.caption %}
+ {{ self.caption }}
+ {% endif %}
+
+ {# Loop through every row #}
+ {% for row in self.table %}
+ {# If the "header" is checked, the first row will be a with a highlighted background #}
+ {% if self.header and forloop.first %}
+
+
+ {% for cell in row.value %}
+ |
+ {{ cell.value.content|richtext }}
+ |
+ {% endfor %}
+
+
{% else %}
- {# For every other cell; when "column" is not checked #}
-
- {{ cell.value.content|richtext }}
- |
+ {# For every other row that's not a header... #}
+
+ {% for cell in row.value %}
+ {# If the first cell is supposed to be highlighted; when "column" is checked #}
+ {% if self.column %}
+ |
+ {{ cell.value.content|richtext }}
+ |
+ {% else %}
+ {# For every other cell; when "column" is not checked #}
+
+ {{ cell.value.content|richtext }}
+ |
+ {% endif %}
+ {% endfor %}
+
{% endif %}
{% endfor %}
-
- {% endif %}
- {% endfor %}
-
+
+
+
{{ page.title }}
+ {% include "./fragments/blog_authors.html" with blog_page=page show_full_info=True %} + +