diff --git a/lms/djangoapps/branding/__init__.py b/lms/djangoapps/branding/__init__.py index e2d97f211b..17244fbe13 100644 --- a/lms/djangoapps/branding/__init__.py +++ b/lms/djangoapps/branding/__init__.py @@ -64,28 +64,3 @@ def get_university_for_request(): if no university was specified """ return microsite.get_value('university') - - -def get_logo_url(): - """ - Return the url for the branded logo image to be used - """ - - # if the MicrositeConfiguration has a value for the logo_image_url - # let's use that - image_url = microsite.get_value('logo_image_url') - if image_url: - return '{static_url}{image_url}'.format( - static_url=settings.STATIC_URL, - image_url=image_url - ) - - # otherwise, use the legacy means to configure this - university = microsite.get_value('university') - - if university is None and settings.FEATURES.get('IS_EDX_DOMAIN', False): - return staticfiles_storage.url('images/edx-theme/edx-logo-77x36.png') - elif university: - return staticfiles_storage.url('images/{uni}-on-edx-logo.png'.format(uni=university)) - else: - return staticfiles_storage.url('images/logo.png') diff --git a/lms/djangoapps/branding/api.py b/lms/djangoapps/branding/api.py index d590ffc264..336126d5f6 100644 --- a/lms/djangoapps/branding/api.py +++ b/lms/djangoapps/branding/api.py @@ -372,6 +372,31 @@ def get_base_url(is_secure): return _absolute_url(is_secure=is_secure, url_path="") +def get_logo_url(): + """ + Return the url for the branded logo image to be used + """ + + # if the MicrositeConfiguration has a value for the logo_image_url + # let's use that + image_url = microsite.get_value('logo_image_url') + if image_url: + return '{static_url}{image_url}'.format( + static_url=settings.STATIC_URL, + image_url=image_url + ) + + # otherwise, use the legacy means to configure this + university = microsite.get_value('university') + + if university is None and settings.FEATURES.get('IS_EDX_DOMAIN', False): + return staticfiles_storage.url('images/edx-theme/edx-logo-77x36.png') + elif university: + return staticfiles_storage.url('images/{uni}-on-edx-logo.png'.format(uni=university)) + else: + return staticfiles_storage.url('images/logo.png') + + def get_tos_and_honor_code_url(): """ Lookup and return terms of services page url diff --git a/lms/djangoapps/certificates/api.py b/lms/djangoapps/certificates/api.py index 3ea089c690..1a54ac2f44 100644 --- a/lms/djangoapps/certificates/api.py +++ b/lms/djangoapps/certificates/api.py @@ -29,7 +29,7 @@ from certificates.models import ( CertificateTemplateAsset, ) from certificates.queue import XQueueCertInterface -from branding import api as branding_api, get_logo_url +from branding import api as branding_api log = logging.getLogger("edx.certificate") @@ -499,7 +499,7 @@ def get_certificate_header_context(is_secure=True): data returned should be customized according to the microsite settings """ data = dict( - logo_src=get_logo_url(), + logo_src=branding_api.get_logo_url(), logo_url=branding_api.get_base_url(is_secure), ) diff --git a/lms/templates/navigation-edx.html b/lms/templates/navigation-edx.html index 326ce236d4..9cf013f017 100644 --- a/lms/templates/navigation-edx.html +++ b/lms/templates/navigation-edx.html @@ -9,7 +9,7 @@ from microsite_configuration import microsite from microsite_configuration.templatetags.microsite import platform_name # App that handles subdomain specific branding -import branding +from branding import api as branding_api # app that handles site status messages from status.status import get_site_status_msg %> @@ -41,7 +41,7 @@ site_status_msg = get_site_status_msg(course_id)

diff --git a/lms/templates/navigation.html b/lms/templates/navigation.html index 8afaca52e2..871fa0da7c 100644 --- a/lms/templates/navigation.html +++ b/lms/templates/navigation.html @@ -10,7 +10,7 @@ from microsite_configuration.templatetags.microsite import platform_name from lms.djangoapps.ccx.overrides import get_current_ccx # App that handles subdomain specific branding -import branding +from branding import api as branding_api # app that handles site status messages from status.status import get_site_status_msg %> @@ -42,7 +42,7 @@ site_status_msg = get_site_status_msg(course_id)

<%block name="navigation_logo"> - ${_( + ${_(