Skip to content

Commit

Permalink
Merge pull request #61 from molgen/move-toc-setting
Browse files Browse the repository at this point in the history
Move "Show Table of Content" to Settings tab and default to off.
  • Loading branch information
donald authored Jan 18, 2020
2 parents c0c298a + 5b6326b commit 7edc8ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mpicms/base/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,16 @@ class Meta: # noqa

class BodyMixin(Page):
body = StreamField(ContentBlock(), blank=True, verbose_name=_('content'))
show_toc = models.BooleanField(_('Show table of content'), default=True)
show_toc = models.BooleanField(_('Show table of content'), default=False)

content_panels = [
StreamFieldPanel('body'),
]

promote_panels = [
]

settings_panels = [
FieldPanel('show_toc')
]

Expand Down
2 changes: 2 additions & 0 deletions mpicms/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class Meta: # noqa
class HomePage(NewsMixin, SideBarMixin, BodyMixin, BasePage):
content_panels = Page.content_panels + BodyMixin.content_panels + SideBarMixin.content_panels
promote_panels = Page.promote_panels + BodyMixin.promote_panels
settings_panels = Page.settings_panels + BodyMixin.settings_panels
search_fields = Page.search_fields + BodyMixin.search_fields + SideBarMixin.search_fields
api_fields = BodyMixin.api_fields

Expand All @@ -112,6 +113,7 @@ class Meta: # noqa
class WikiPage(CategoryMixin, SideBarMixin, BodyMixin, BasePage):
content_panels = Page.content_panels + BodyMixin.content_panels + SideBarMixin.content_panels
promote_panels = Page.promote_panels + BodyMixin.promote_panels
settings_panels = Page.settings_panels + BodyMixin.settings_panels
search_fields = Page.search_fields + BodyMixin.search_fields + SideBarMixin.search_fields
api_fields = BodyMixin.api_fields

Expand Down

0 comments on commit 7edc8ab

Please sign in to comment.