Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
28 changes: 28 additions & 0 deletions tutorindigo/components/IndigoHeader.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

const IndigoHeader = () => {
const BASE_URL = getConfig().LMS_BASE_URL;
const currentPath = window.location.pathname;

// Read nav links from MFE_CONFIG — defined once in openlms_brand.py
// Falls back to sensible defaults if not configured
const navLinks = getConfig().HEADER_NAV_LINKS ?? [
{ title: 'My Courses', url: '/dashboard' },
{ title: 'Discover', url: '/courses' },
];

return navLinks.map((link) => {
const href = link.url.startsWith('http') ? link.url : `${BASE_URL}${link.url}`;
const isActive = currentPath === link.url || currentPath.startsWith(link.url + '/');

return React.createElement(
'a',
{
key: link.url,
href,
className: `nav-link${isActive ? ' active' : ''}`,
'aria-current': isActive ? 'page' : undefined,
},
link.title,
);
});
};
1 change: 1 addition & 0 deletions tutorindigo/patches/mfe-env-config-runtime-definitions
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
{{- patch("MobileViewHeader.jsx") }}
{{- patch("ThemedLogo.jsx") }}
{{- patch("ToggleThemeButton.jsx") }}
{{- patch("IndigoHeader.jsx") }}
36 changes: 32 additions & 4 deletions tutorindigo/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,20 @@ def _override_openedx_docker_image(

MFE_CONFIG['INDIGO_ENABLE_DARK_TOGGLE'] = {{ INDIGO_ENABLE_DARK_TOGGLE }}
MFE_CONFIG['INDIGO_FOOTER_NAV_LINKS'] = {{ INDIGO_FOOTER_NAV_LINKS }}

# Ensure Mako templates from the theme are found by the comprehensive theming system.
# The env var COMPREHENSIVE_THEME_DIRS=/openedx/themes is set in the Dockerfile but
# may not be picked up by the dev settings chain; set it explicitly here.
COMPREHENSIVE_THEME_DIRS = ['/openedx/themes']
""",
),
(
"openedx-lms-production-settings",
"""
MFE_CONFIG['INDIGO_ENABLE_DARK_TOGGLE'] = {{ INDIGO_ENABLE_DARK_TOGGLE }}
MFE_CONFIG['INDIGO_FOOTER_NAV_LINKS'] = {{ INDIGO_FOOTER_NAV_LINKS }}

COMPREHENSIVE_THEME_DIRS = ['/openedx/themes']
""",
),
]
Expand Down Expand Up @@ -219,6 +226,27 @@ def _override_openedx_docker_image(
""",
),
)
if mfe not in ("learning", "learner-dashboard"):
PLUGIN_SLOTS.add_item(
(
mfe,
"desktop_main_menu_slot",
"""
{
op: PLUGIN_OPERATIONS.Hide,
widgetId: 'default_contents',
},
{
op: PLUGIN_OPERATIONS.Insert,
widget: {
id: 'indigo_header_nav',
type: DIRECT_PLUGIN,
RenderWidget: IndigoHeader,
},
},
""",
)
)
if mfe != "learning":
PLUGIN_SLOTS.add_item(
(
Expand Down Expand Up @@ -300,14 +328,14 @@ def _override_openedx_docker_image(
"variants": {
"light": {
"urls": {
"default": "https://raw.githubusercontent.com/edly-io/brand-openedx/refs/heads/ulmo/indigo/dist/light.min.css",
"brandOverride": "https://raw.githubusercontent.com/edly-io/brand-openedx/refs/heads/ulmo/indigo/dist/light.min.css",
"default": "https://{{ LMS_HOST }}/static/indigo/css/light.min.css",
"brandOverride": "https://{{ LMS_HOST }}/static/indigo/css/light.min.css",
},
},
"dark": {
"urls": {
"default": "https://raw.githubusercontent.com/edly-io/brand-openedx/refs/heads/ulmo/indigo/dist/dark.min.css",
"brandOverride": "https://raw.githubusercontent.com/edly-io/brand-openedx/refs/heads/ulmo/indigo/dist/dark.min.css",
"default": "https://{{ LMS_HOST }}/static/indigo/css/dark.min.css",
"brandOverride": "https://{{ LMS_HOST }}/static/indigo/css/dark.min.css",
}
},
}
Expand Down
Binary file modified tutorindigo/templates/indigo/cms/static/images/favicon.ico
Binary file not shown.
Binary file modified tutorindigo/templates/indigo/cms/static/images/studio-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading