Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a5fa3c4
add an AnonymTopAndBottomPage to the project
dchukhin Dec 19, 2025
7beb387
add counter to section templates
dchukhin Dec 19, 2025
eafe2a1
only show icon element if icon is set
dchukhin Dec 19, 2025
d93d6b8
add CSS class to sections with 'top glow' theme
dchukhin Dec 20, 2025
5b78ce6
add table block to SectionBlocks
dchukhin Dec 20, 2025
7a1bf18
Merge branch 'WT-514-anonym-homepage-cms' into anonym-index-child-page
dchukhin Dec 20, 2025
5cdfaab
make sure first section heading is an h1 element, and others are h2 e…
dchukhin Dec 20, 2025
0c4e399
add an AnonymContentSubPage to the project
dchukhin Dec 20, 2025
12b618b
add toggleable items component to AnonymContentSubPage
dchukhin Dec 22, 2025
4ed3e28
Merge branch 'WT-514-anonym-homepage-cms' into anonym-index-child-page
dchukhin Dec 22, 2025
8503cb0
update migration, since CardsListBlock.cards is now a StreamBlock, to…
dchukhin Dec 22, 2025
9412913
add logo cards, to allow creating case study cards on AnonymContentSu…
dchukhin Dec 22, 2025
25b1fab
Merge branch 'anonym-index-child-page' into anonym-index-content-subpage
dchukhin Dec 22, 2025
c754b6d
update toggle to handle dark and light icons automatically
dchukhin Dec 22, 2025
b88e8c3
add a configurable navigation to anonym pages
dchukhin Dec 22, 2025
22b27e0
make sure migration has a license
dchukhin Dec 22, 2025
467bd13
Merge branch 'anonym-index-content-subpage' into anonym-navbar
dchukhin Dec 22, 2025
551030e
Merge branch 'WT-514-anonym-homepage-cms' into anonym-index-child-page
dchukhin Dec 22, 2025
dc564b2
update body class to be anonym-specific
dchukhin Dec 22, 2025
e1346c5
Merge branch 'anonym-index-child-page' into anonym-index-content-subpage
dchukhin Dec 22, 2025
fc72654
update body class to be anonym-specific
dchukhin Dec 22, 2025
8dbbefb
add a PersonCard, to allow adding cards with people's photos to the '…
dchukhin Dec 23, 2025
96444bf
add a TwoColumnBlock, to allow adding them to 'About' page
dchukhin Dec 23, 2025
ebc0e53
Merge branch 'WT-514-anonym-homepage-cms' into anonym-index-child-page
dchukhin Dec 23, 2025
110f9df
make sure AnonymTopAndBottomPage can be added in production
dchukhin Dec 23, 2025
51c8b61
make sure AnonymTopAndBottomPage is included in db export script
dchukhin Dec 23, 2025
66b2458
Merge branch 'anonym-index-child-page' into anonym-index-content-subpage
dchukhin Dec 23, 2025
3592fee
make sure AnonymContentSubPage can be added in production
dchukhin Dec 23, 2025
8bd545d
make sure AnonymContentSubPage is included in db export script
dchukhin Dec 23, 2025
a41307c
Merge branch 'anonym-index-content-subpage' into anonym-navbar
dchukhin Dec 23, 2025
8921c77
Merge branch 'anonym-navbar' into anonym-part-5-about-page
dchukhin Dec 23, 2025
9445663
Merge branch 'WT-514-anonym-homepage-cms' into anonym-index-child-page
dchukhin Dec 23, 2025
b623f94
make instances of AnonymTopAndBottomPage more easily identifiable by …
dchukhin Dec 23, 2025
1241373
Merge branch 'anonym-index-child-page' into anonym-index-content-subpage
dchukhin Dec 23, 2025
2cb9951
make instances of AnonymContentSubPage more easily identifiable by se…
dchukhin Dec 23, 2025
e6a380c
Merge branch 'anonym-index-content-subpage' into anonym-navbar
dchukhin Dec 23, 2025
0b7d1d9
Merge branch 'anonym-navbar' into anonym-part-5-about-page
dchukhin Dec 23, 2025
6c47f24
Merge branch 'WT-514-anonym-homepage-cms' into anonym-part-5-about-page
dchukhin Jan 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions bedrock/mozorg/blocks/anonym.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from wagtail import blocks
from wagtail.contrib.table_block.blocks import TableBlock
from wagtail.images.blocks import ImageChooserBlock
from wagtail.snippets.blocks import SnippetChooserBlock
from wagtail_link_block.blocks import LinkBlock
from wagtail_thumbnail_choice_block import ThumbnailChoiceBlock

Expand Down Expand Up @@ -450,12 +451,23 @@ class Meta:
label_format = "Logo Card - {heading}"


class PersonCardBlock(blocks.StructBlock):
person = SnippetChooserBlock("mozorg.Person")
link = blocks.ListBlock(LinkWithTextBlock(), min_num=0, max_num=1, default=[])

class Meta:
template = "mozorg/cms/anonym/blocks/person-card.html"
label = "Person Card"
label_format = "Person Card - {person}"


class CardsListBlock(blocks.StructBlock):
settings = CardListSettings()
cards = blocks.StreamBlock(
[
("icon_card", IconCardBlock()),
("logo_card", LogoCardBlock()),
("person_card", PersonCardBlock()),
],
min_num=1,
max_num=4,
Expand Down Expand Up @@ -507,6 +519,29 @@ class Meta:
value_class = SectionBlockSettingsValue


class ListItemBlock(blocks.StructBlock):
heading_text = blocks.CharBlock(label="Heading")
supporting_text = blocks.RichTextBlock(features=BASIC_TEXT_FEATURES)

class Meta:
label = "List Item"
label_format = "{heading_text}"
template = "mozorg/cms/anonym/blocks/list-item.html"
form_classname = "compact-form struct-block"


class TwoColumnBlock(blocks.StructBlock):
heading_text = blocks.CharBlock(label="Heading")
subheading_text = blocks.RichTextBlock(features=BASIC_TEXT_FEATURES)
second_column = blocks.ListBlock(ListItemBlock(), min_num=0)

class Meta:
label = "Two Column Block"
label_format = "Two Column - {heading_text}"
template = "mozorg/cms/anonym/blocks/two-column.html"
form_classname = "compact-form struct-block"


class SectionBlock(blocks.StructBlock):
is_section_block = True

Expand All @@ -525,6 +560,7 @@ class SectionBlock(blocks.StructBlock):
("stats_list_block", StatsListBlock()),
("people_list", PeopleListBlock()),
("table", TableBlock()),
("two_column", TwoColumnBlock()),
],
required=False,
)
Expand Down
2,112 changes: 2,112 additions & 0 deletions bedrock/mozorg/migrations/0028_alter_anonymcontentsubpage_content_and_more.py

Large diffs are not rendered by default.

2,096 changes: 2,096 additions & 0 deletions bedrock/mozorg/migrations/0029_alter_anonymcontentsubpage_content_and_more.py

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions bedrock/mozorg/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,47 @@ def __str__(self):
return f"{self.notification_text} - Notification Snippet"


@register_snippet
class Person(TranslatableMixin):
image = models.ForeignKey(
"cms.BedrockImage",
null=True,
blank=False,
on_delete=models.SET_NULL,
related_name="+",
)
name = models.CharField(
max_length=255,
blank=False,
)
position = models.CharField(
max_length=255,
blank=False,
)
description = models.TextField(
blank=True,
)

panels = [
MultiFieldPanel(
[
FieldPanel("image", heading="Image"),
FieldPanel("name", heading="Name"),
FieldPanel("position", heading="Position"),
FieldPanel("description", heading="Description"),
],
heading="Person",
),
]

class Meta(TranslatableMixin.Meta):
verbose_name = "Person"
verbose_name_plural = "People"

def __str__(self):
return f"{self.name} - {self.position}"


class LeadershipPage(AbstractBedrockCMSPage):
max_count = 1 # Ensure there's only one instance of this page
subpage_types = [] # This page type cannot have any children
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{#
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

<li>
<h4>{{ value.heading_text|linebreaksbr }}</h4>
<div>{{ value.supporting_text|richtext }}</div>
</li>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{#
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

<li class="mzan-card">
<img src="{{ value.person.image.file.url }}" alt="{{ value.person.image.description }}" width="64" height="64" loading="lazy">
<div>{{ value.person.name }}</div>
<div>{{ value.person.position }}</div>
<div>{{ value.person.description }}</div>
{% if value.link %}
{% for link in value.link %}
<a class=""
href="{{ link.link.get_url() }}"
{% if link.link.new_window %}target="_blank" rel="external noopener"{% endif %}
>{{ link.label }}</a>
{% endfor %}
{% endif %}
</li>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{#
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

<div class="{% if value.second_column %}mzan-half-grid{% endif %}">
<div>
<h3>{{ value.heading_text }}</h3>
<p">{{ value.subheading_text }}</p>
</div>

{% if value.second_column %}
<ul>
{% for item in value.second_column %}
{% include_block item %}
{% endfor %}
</ul>
{% endif %}
</div>