Commit 56720ed1 by Nate Hardison Committed by Jason Bau

Prepend theme templates to lookup paths

Currently theme templates are appended to the lookup paths, making
it impossible for theme templates to totally override default
templates. Prepend the paths to theme templates instead.
parent 7f116c0b
...@@ -751,9 +751,10 @@ def enable_theme(theme_name): ...@@ -751,9 +751,10 @@ def enable_theme(theme_name):
# Calculate the location of the theme's files # Calculate the location of the theme's files
theme_root = ENV_ROOT / "themes" / theme_name theme_root = ENV_ROOT / "themes" / theme_name
# Include the theme's templates in the template search paths # Prepend the theme's templates to the template search paths so
TEMPLATE_DIRS.append(theme_root / 'templates') # that themes can override templates on an as-needed basis
MAKO_TEMPLATES['main'].append(theme_root / 'templates') TEMPLATE_DIRS.insert(0, theme_root / 'templates')
MAKO_TEMPLATES['main'].insert(0, theme_root / 'templates')
# Namespace the theme's static files to 'themes/<theme_name>' to # Namespace the theme's static files to 'themes/<theme_name>' to
# avoid collisions with default edX static files # avoid collisions with default edX static files
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment