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

TabbedInterface strange behavior #255

Closed
itekhi opened this issue Nov 19, 2020 · 0 comments · Fixed by #276
Closed

TabbedInterface strange behavior #255

itekhi opened this issue Nov 19, 2020 · 0 comments · Fixed by #276
Labels
Release blocker type:bug Something isn't working
Milestone

Comments

@itekhi
Copy link

itekhi commented Nov 19, 2020

I have a home page with TabbedInterface which looks like this:

edit_handler = TabbedInterface([
    ObjectList(banner_panels, heading='BANNERS'),
    ObjectList([InlinePanel('home_info_tab_keys')], heading='INFO TABS'),
    ObjectList([InlinePanel('home_achievement_keys', max_num=4)], heading='ACHIEVEMENTS'),
    ObjectList(Page.content_panels, heading="CONTENT"),
    ObjectList(BaseMixin.promote_panels, heading='PROMOTE'),
    ObjectList(Page.settings_panels, heading='SETTINGS'),
])

Now I sync home pages. When I translate them, InlinePanels from second tab shows in first tab("BANNERS")

image

InfoTabs Orderable for InlinePanel('home_info_tab_keys')

class HomeInfoTab(TranslatableMixin, Orderable):
    page = ParentalKey("home.HomePage", related_name="home_info_tab_keys")
    poster = models.ForeignKey(
        "wagtailimages.Image",
        null=False,
        blank=False,
        on_delete=models.CASCADE,
        related_name="+",
    )
    overhead = models.CharField(blank=False, null=False, max_length=50)
    title = models.CharField(blank=False, null=False, max_length=100)
    description = models.TextField(blank=False, null=False)
    more_button = models.ForeignKey(
        'wagtailcore.Page',
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name='+',
    )

    panels = [
        ImageChooserPanel("poster"),
        FieldPanel('overhead'),
        FieldPanel('title'),
        FieldPanel('description'),
        PageChooserPanel('more_button'),
    ]

    class Meta(TranslatableMixin.Meta, Orderable.Meta):
        pass

I think something is happening with InlinePanels, because if I add FieldPanel with text field specified to the second tab, like this: ObjectList([InlinePanel('home_info_tab_keys'), FieldPanel('text')], heading='INFO TABS'),
Now "INFO TABS" tab is showing up only with text field to translate, InlinePanels are still in "BANNERS" tab.

@kaedroho kaedroho added the type:bug Something isn't working label Nov 24, 2020
@kaedroho kaedroho added this to the First release milestone Nov 24, 2020
kaedroho added a commit that referenced this issue Dec 1, 2020
kaedroho added a commit that referenced this issue Dec 4, 2020
kaedroho added a commit that referenced this issue Dec 4, 2020
kaedroho added a commit that referenced this issue Dec 4, 2020
kaedroho added a commit that referenced this issue Dec 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release blocker type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants