Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronize inlinePanel fields with translations #7518

Merged
merged 3 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
5 changes: 5 additions & 0 deletions network-api/networkapi/wagtailpages/pagemodels/blog/blog.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ class BlogPage(FoundationMetadataPageMixin, Page):
# Content tab fields
TranslatableField('body'),
TranslatableField('title'),
SynchronizedField('authors'),
SynchronizedField('hero_video'),
SynchronizedField('hero_image'),
SynchronizedField('related_posts'),
SynchronizedField('first_published_at'),
]

subpage_types = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from wagtail.admin.edit_handlers import PageChooserPanel, InlinePanel
from wagtail.contrib.routable_page.models import route
from wagtail.core.models import Orderable as WagtailOrderable, Locale
from wagtail_localize.fields import SynchronizedField

from modelcluster.fields import ParentalKey
from networkapi.wagtailpages.utils import titlecase, get_locale_from_request
Expand Down Expand Up @@ -59,8 +60,9 @@ class BlogIndexPage(IndexPage):
)
]

# Empty translatable fields
translatable_fields = IndexPage.translatable_fields
translatable_fields = IndexPage.translatable_fields + [
SynchronizedField('featured_pages'),
]

template = 'wagtailpages/blog_index_page.html'

Expand Down
5 changes: 5 additions & 0 deletions network-api/networkapi/wagtailpages/pagemodels/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ def get_voting_json(self):
TranslatableField('price'),
SynchronizedField('image'),
TranslatableField('worst_case'),
SynchronizedField('product_categories'),
SynchronizedField('signup_requires_email'),
SynchronizedField('signup_requires_phone'),
SynchronizedField('signup_requires_third_party_account'),
Expand All @@ -799,6 +800,7 @@ def get_voting_json(self):
SynchronizedField('data_collection_policy_is_bad'),
SynchronizedField('user_friendly_privacy_policy'),
TranslatableField('user_friendly_privacy_policy_helptext'),
SynchronizedField('privacy_policy_links'),
SynchronizedField('show_ding_for_minimum_security_standards'),
SynchronizedField('meets_minimum_security_standards'),
SynchronizedField('uses_encryption'),
Expand All @@ -815,6 +817,8 @@ def get_voting_json(self):
SynchronizedField('live_chat'),
SynchronizedField('email'),
SynchronizedField('twitter'),
SynchronizedField('updates'),
SynchronizedField('related_product_pages'),
]

@property
Expand Down Expand Up @@ -1408,6 +1412,7 @@ def get_banner(self):
TranslatableField('header'),
TranslatableField('intro_text'),
SynchronizedField('dark_theme'),
SynchronizedField('excluded_categories'),
# Promote tab fields
TranslatableField('seo_title'),
TranslatableField('search_description'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class ArticlePage(FoundationMetadataPageMixin, Page):
SynchronizedField('search_image'),
# Content tab fields
TranslatableField('title'),
SynchronizedField('authors'),
SynchronizedField('toc_thumbnail_image'),
SynchronizedField('hero_image'),
TranslatableField('subtitle'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ class PublicationPage(FoundationMetadataPageMixin, Page):
SynchronizedField('hero_image'),
SynchronizedField('publication_date'),
SynchronizedField('publication_file'),
SynchronizedField('authors'),
TranslatableField('additional_author_copy'),
TranslatableField('intro_notes'),
TranslatableField('contents_title'),
Expand Down