-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 6527-forms
- Loading branch information
Showing
12 changed files
with
311 additions
and
3 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
network-api/networkapi/mozfest/migrations/0014_auto_20210803_2124.py
Large diffs are not rendered by default.
Oops, something went wrong.
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
108 changes: 108 additions & 0 deletions
108
network-api/networkapi/wagtailpages/migrations/0016_auto_20210803_2124.py
Large diffs are not rendered by default.
Oops, something went wrong.
64 changes: 64 additions & 0 deletions
64
network-api/networkapi/wagtailpages/migrations/0017_auto_20210804_1724.py
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
41 changes: 41 additions & 0 deletions
41
network-api/networkapi/wagtailpages/pagemodels/customblocks/blog_set_block.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,41 @@ | ||
from wagtail.core import blocks | ||
from wagtail.core.blocks import PageChooserBlock | ||
|
||
|
||
class BlogSetBlock(blocks.StructBlock): | ||
title = blocks.CharBlock() | ||
|
||
top_divider = blocks.BooleanBlock( | ||
required=False, | ||
help_text='Optional divider above content block.', | ||
) | ||
|
||
bottom_divider = blocks.BooleanBlock( | ||
required=False, | ||
help_text='Optional divider below content block.', | ||
) | ||
|
||
blog_pages = blocks.ListBlock(PageChooserBlock( | ||
target_model='wagtailpages.BlogPage' | ||
)) | ||
|
||
def get_context(self, value, parent_context=None): | ||
context = super().get_context(value, parent_context=parent_context) | ||
|
||
context['entries'] = value.get("blog_pages", list()) | ||
context['more_entries'] = False | ||
context['root'] = None | ||
|
||
# Optional dividers | ||
divider_styles = [] | ||
if value.get("top_divider"): | ||
divider_styles.append('div-top-thick pt-4') | ||
if value.get("bottom_divider"): | ||
divider_styles.append('div-bottom-thick pb-4') | ||
context['divider_styles'] = ' '.join(divider_styles) | ||
|
||
return context | ||
|
||
class Meta: | ||
icon = 'grip' | ||
template = 'wagtailpages/blocks/blog_set_block.html' |
12 changes: 12 additions & 0 deletions
12
network-api/networkapi/wagtailpages/pagemodels/customblocks/single_quote_block.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,12 @@ | ||
from wagtail.core import blocks | ||
|
||
|
||
class SingleQuoteBlock(blocks.StructBlock): | ||
|
||
quote = blocks.CharBlock() | ||
attribution = blocks.CharBlock(required=False) | ||
|
||
class Meta: | ||
template = 'wagtailpages/blocks/single_quote_block.html' | ||
icon = 'openquote' | ||
help_text = 'A single quote block' |
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
1 change: 1 addition & 0 deletions
1
network-api/networkapi/wagtailpages/templates/wagtailpages/blocks/blog_set_block.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 @@ | ||
{% extends "./recent_blog_entries.html" %} |
11 changes: 11 additions & 0 deletions
11
network-api/networkapi/wagtailpages/templates/wagtailpages/blocks/single_quote_block.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,11 @@ | ||
{% extends "./base_streamfield_block.html" %} | ||
{% load wagtailcore_tags %} | ||
|
||
{% block block_content %} | ||
<div class="my-2"> | ||
<div class="feature-quote"> | ||
<h3>{{value.quote}}</h3> | ||
<p class="h6-heading">{{value.attribution}}</p> | ||
</div> | ||
</div> | ||
{% endblock %} |