diff --git a/src/richie/apps/demo/defaults.py b/src/richie/apps/demo/defaults.py index e435a556b2..c52fb8bb05 100644 --- a/src/richie/apps/demo/defaults.py +++ b/src/richie/apps/demo/defaults.py @@ -340,6 +340,46 @@ } SINGLECOLUMN_CONTENT.update(getattr(settings, "RICHIE_DEMO_SINGLECOLUMN_CONTENT", {})) +FOOTER_CONTENT = { + "en": [ + { + "items": [ + {"name": "About", "internal_link": "annex__about"}, + {"name": "Sitemap", "internal_link": "annex__sitemap"}, + ] + }, + { + "title": "Richie community", + "items": [ + {"name": "Website", "external_link": "https://richie.education"}, + { + "name": "Github", + "external_link": "https://github.com/openfun/richie", + }, + ], + }, + ], + "fr": [ + { + "items": [ + {"name": "A propos", "internal_link": "annex__about"}, + {"name": "Plan du site", "internal_link": "annex__sitemap"}, + ] + }, + { + "title": "Communauté Richie", + "items": [ + {"name": "Site web", "external_link": "https://richie.education"}, + { + "name": "Github", + "external_link": "https://github.com/openfun/richie", + }, + ], + }, + ], +} +FOOTER_CONTENT.update(getattr(settings, "FOOTER_CONTENT", {})) + SITEMAP_PAGE_PARAMS = { "blogposts": {"max_depth": 1}, "courses": {"max_depth": 1}, diff --git a/src/richie/apps/demo/management/commands/create_demo_site.py b/src/richie/apps/demo/management/commands/create_demo_site.py index 0fc892de25..3a5996995d 100755 --- a/src/richie/apps/demo/management/commands/create_demo_site.py +++ b/src/richie/apps/demo/management/commands/create_demo_site.py @@ -10,6 +10,7 @@ import factory from cms.api import add_plugin +from cms.models import StaticPlaceholder from richie.apps.core.factories import create_text_plugin, image_getter from richie.apps.core.helpers import recursive_page_creation @@ -25,6 +26,7 @@ ) from ...defaults import ( + FOOTER_CONTENT, HOMEPAGE_CONTENT, ICONS_INFO, LEVELS_INFO, @@ -81,6 +83,42 @@ def create_demo_site(): # Create pages as described in PAGES_INFOS pages_created = recursive_page_creation(site, PAGES_INFO) + # Create the footer links + footer_static_ph = StaticPlaceholder.objects.get_or_create(code="footer")[0] + for footer_placeholder in [footer_static_ph.draft, footer_static_ph.public]: + for language, content in FOOTER_CONTENT.items(): + # Create the