Commit f2c40a71 by Nate Hardison

Enable theming in base LMS template

Provide the appropriate switches to adjust based on whether or not a
theme (in particular, the Stanford theme) is enabled in the settings.
For now, these changes are very specific to Stanford. This is because
the template architecture needs some reworking to generalize nicely.
parent 468dfe34
<%namespace name='static' file='static_content.html'/> <%namespace name='static' file='static_content.html'/>
<%! from django.utils import html %> <%! from django.utils import html %>
## Define a couple of helper functions to make life easier when
## embedding theme conditionals into templates. All inheriting
## templates have access to these functions, and we can import these
## into non-inheriting templates via the %namespace tag.
<%def name="theme_enabled()">
<% return settings.MITX_FEATURES["USE_CUSTOM_THEME"] %>
</%def>
<%def name="stanford_theme_enabled()">
<% return theme_enabled() and getattr(settings, "THEME_NAME") == "stanford" %>
</%def>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<%block name="title"><title>edX</title></%block> <%block name="title">
% if stanford_theme_enabled():
<title>Home | class.stanford.edu</title>
% else:
<title>edX</title>
% endif
</%block>
<script type="text/javascript"> <script type="text/javascript">
/* immediately break out of an iframe if coming /* immediately break out of an iframe if coming
from the marketing website */ from the marketing website */
...@@ -20,6 +39,9 @@ ...@@ -20,6 +39,9 @@
<%static:js group='main_vendor'/> <%static:js group='main_vendor'/>
<%block name="headextra"/> <%block name="headextra"/>
% if theme_enabled():
<%include file="theme-head-extra.html" />
% endif
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="${static.url('js/html5shiv.js')}"></script> <script src="${static.url('js/html5shiv.js')}"></script>
...@@ -32,14 +54,20 @@ ...@@ -32,14 +54,20 @@
<meta name="google-site-verification" content="_mipQ4AtZQDNmbtOkwehQDOgCxUUV2fb_C0b6wbiRHY" /> <meta name="google-site-verification" content="_mipQ4AtZQDNmbtOkwehQDOgCxUUV2fb_C0b6wbiRHY" />
% if not course: % if not course:
<%include file="google_analytics.html" /> % if theme_enabled():
<%include file="theme-google-analytics.html" />
% else:
<%include file="google_analytics.html" />
% endif
% endif % endif
</head> </head>
<body class="<%block name='bodyclass'/>"> <body class="<%block name='bodyclass'/>">
% if not suppress_toplevel_navigation: % if theme_enabled():
<%include file="theme-header.html" />
% elif not suppress_toplevel_navigation:
<%include file="navigation.html" /> <%include file="navigation.html" />
% endif % endif
...@@ -48,7 +76,9 @@ ...@@ -48,7 +76,9 @@
<%block name="bodyextra"/> <%block name="bodyextra"/>
</section> </section>
% if not suppress_toplevel_navigation: % if theme_enabled():
<%include file="theme-footer.html" />
% elif not suppress_toplevel_navigation:
<%include file="footer.html" /> <%include file="footer.html" />
% endif % endif
......
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