Skip to content
Merged
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
6 changes: 5 additions & 1 deletion cms/templates/widgets/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@

<div class="wrapper wrapper-l">
<h1 class="branding"><a href="/">
<img src="${static.url("images/header-logo.png")}" alt="${settings.STUDIO_NAME}" />
% if settings.FEATURES.get('IS_EDX_DOMAIN', False):
<img src="${static.url("images/edx-theme/edx-studio-logo.png")}" alt="${settings.STUDIO_NAME}" />
% else:
<img src="${static.url("images/default-theme/logo.png")}" alt="${settings.STUDIO_NAME}" />
% endif
</a></h1>

% if context_course:
Expand Down
2 changes: 1 addition & 1 deletion common/test/acceptance/pages/lms/learner_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def profile_has_default_image(self):
"""
self.wait_for_field('image')
default_links = self.q(css='.image-frame').attrs('src')
return 'profiles/default' in default_links[0] if default_links else False
return 'default-profile' in default_links[0] if default_links else False

def mouse_hover(self, element):
"""
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/branding/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ def get_logo_url():
elif university:
return staticfiles_storage.url('images/{uni}-on-edx-logo.png'.format(uni=university))
else:
return staticfiles_storage.url('images/logo.png')
return staticfiles_storage.url('images/default-theme/logo.png')
3 changes: 3 additions & 0 deletions lms/djangoapps/courseware/tests/test_comp_theming.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Tests of comprehensive theming."""

import unittest
from django.conf import settings
from django.test import TestCase

Expand All @@ -20,6 +21,7 @@ def setUp(self):
staticfiles.finders._finders.clear() # pylint: disable=protected-access

@with_comp_theme(settings.REPO_ROOT / 'themes/red-theme')
@unittest.skip("Disabled until we can release theming to production")
def test_red_footer(self):
resp = self.client.get('/')
self.assertEqual(resp.status_code, 200)
Expand Down Expand Up @@ -63,6 +65,7 @@ def do_the_test(self):

do_the_test(self)

@unittest.skip("Disabled until we can release theming to production")
def test_default_logo_image(self):
result = staticfiles.finders.find('images/logo.png')
self.assertEqual(result, settings.REPO_ROOT / 'lms/static/images/logo.png')
Expand Down
5 changes: 4 additions & 1 deletion lms/envs/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,10 @@
PROFILE_IMAGE_SECRET_KEY = AUTH_TOKENS.get('PROFILE_IMAGE_SECRET_KEY', PROFILE_IMAGE_SECRET_KEY)
PROFILE_IMAGE_MAX_BYTES = ENV_TOKENS.get('PROFILE_IMAGE_MAX_BYTES', PROFILE_IMAGE_MAX_BYTES)
PROFILE_IMAGE_MIN_BYTES = ENV_TOKENS.get('PROFILE_IMAGE_MIN_BYTES', PROFILE_IMAGE_MIN_BYTES)
PROFILE_IMAGE_DEFAULT_FILENAME = 'images/profiles/default'
if FEATURES['IS_EDX_DOMAIN']:
PROFILE_IMAGE_DEFAULT_FILENAME = 'images/edx-theme/default-profile'
else:
PROFILE_IMAGE_DEFAULT_FILENAME = ENV_TOKENS.get('PROFILE_IMAGE_DEFAULT_FILENAME', PROFILE_IMAGE_DEFAULT_FILENAME)

# EdxNotes config

Expand Down
2 changes: 1 addition & 1 deletion lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2601,7 +2601,7 @@
'base_url': os.path.join(MEDIA_URL, 'profile-images/'),
},
}
PROFILE_IMAGE_DEFAULT_FILENAME = 'images/profiles/default'
PROFILE_IMAGE_DEFAULT_FILENAME = 'images/default-theme/default-profile'
PROFILE_IMAGE_DEFAULT_FILE_EXTENSION = 'png'
# This secret key is used in generating unguessable URLs to users'
# profile images. Once it has been set, changing it will make the
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion lms/templates/courseware/course_about.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
ga=microsite.get_value('google_analytics_file', 'theme-google-analytics.html')
)
else:
google_analytics_file = '../google-analytics.html'
google_analytics_file = '../google_analytics.html'
%>

<%include file="${google_analytics_file}" />
Expand Down
52 changes: 41 additions & 11 deletions lms/templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,7 @@
<link rel="icon" type="image/x-icon" href="${static.url(microsite.get_value('favicon_path', settings.FAVICON_PATH))}" />

<%static:css group='style-vendor'/>
## route around the overwhelmingly complicated static:css nonsense
<%
application_css_path = "css/lms-main{rtl}.css".format(
rtl="-rtl" if get_language_bidi() else "",
)
%>
<link rel="stylesheet" href="${static.url(application_css_path)}" type="text/css" media="all" />
<%static:css group='style-main'/>

% if disable_courseware_js:
<%static:js group='base_vendor'/>
Expand All @@ -90,15 +84,42 @@

<%block name="headextra"/>

<%static:optional_include_mako file="header-extra.html" with_microsite="True" />
<%
if theme_enabled() and not is_microsite():
header_extra_file = 'theme-head-extra.html'
header_file = 'theme-header.html'
google_analytics_file = 'theme-google-analytics.html'

style_overrides_file = None

else:
header_extra_file = microsite.get_template_path('header_extra.html')

if settings.FEATURES['IS_EDX_DOMAIN'] and not is_microsite():
header_file = microsite.get_template_path('navigation-edx.html')
else:
header_file = microsite.get_template_path('navigation.html')

google_analytics_file = microsite.get_template_path('google_analytics.html')

style_overrides_file = microsite.get_value('css_overrides_file')
%>

% if header_extra_file:
<%include file="${header_extra_file}" />
% endif

<%include file="widgets/optimizely.html" />
<%include file="widgets/segment-io.html" />

<meta name="path_prefix" content="${EDX_ROOT_URL}">
<meta name="google-site-verification" content="_mipQ4AtZQDNmbtOkwehQDOgCxUUV2fb_C0b6wbiRHY" />

<%static:optional_include_mako file="google-analytics.html" with_microsite="True" />
<%include file="${google_analytics_file}" />

% if style_overrides_file:
<link rel="stylesheet" type="text/css" href="${static.url(style_overrides_file)}" />
% endif

</head>

Expand All @@ -110,7 +131,7 @@
<a class="nav-skip" href="<%block name="nav_skip">#content</%block>">${_("Skip to main content")}</a>

% if not disable_header:
<%include file="header.html" />
<%include file="${header_file}" />
% endif

<div class="content-wrapper" id="content">
Expand All @@ -119,7 +140,16 @@
</div>

% if not disable_footer:
<%include file="themable-footer.html" />
<%block name="footer">
## Can be overridden by child templates wanting to hide the footer.
% if theme_enabled() and not is_microsite():
<%include file="theme-footer.html" />
% elif settings.FEATURES.get('IS_EDX_DOMAIN', False) and not is_microsite():
<%include file="footer-edx-v3.html" />
% else:
<%include file="${microsite.get_template_path('footer.html')}" />
% endif
</%block>
% endif

% if not disable_window_wrap:
Expand Down
13 changes: 0 additions & 13 deletions lms/templates/themable-footer.html

This file was deleted.

22 changes: 0 additions & 22 deletions themes/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,28 +90,6 @@ in the appropriate place, and making the changes you need. Keep in mind that
in the future if you upgrade the Open edX code, you may have to update the
copied template in your theme also.

Template Names
==============

Here are the list of template names that you *should* use in your comprehensive
theme (so far):

* ``header.html``
* ``footer.html``

You should **not** use the following names in your comprehensive theme:

* ``themable-footer.html``

If you look at the ``main.html`` template file, you will notice that it includes
``header.html`` and ``themable-footer.html``, rather than ``footer.html``.
You might be inclined to override ``themable-footer.html`` as a result. DO NOT
DO THIS. ``themable-footer.html`` is an additional layer of indirection that
is necessary to avoid breaking microsites, which also refers to a file named
``footer.html``. The goal is to eventually make comprehensive theming do
everything that microsites does now, and then deprecate and remove microsites
from the codebase. At that point, the ``themable-footer.html`` file will go
away, since the additional layer of indirection will no longer be necessary.

Installing your theme
---------------------
Expand Down
81 changes: 0 additions & 81 deletions themes/edx.org/lms/templates/footer.html

This file was deleted.

Loading