diff --git a/cms/templates/course_outline.html b/cms/templates/course_outline.html index bf360056c5..c7a5f2582c 100644 --- a/cms/templates/course_outline.html +++ b/cms/templates/course_outline.html @@ -6,7 +6,6 @@ from util.date_utils import get_default_time_display from django.utils.translation import ugettext as _ from openedx.core.lib.js_utils import escape_json_dumps from contentstore.utils import reverse_usage_url -from microsite_configuration import microsite from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration %> <%block name="title">${_("Course Outline")}%block> @@ -54,9 +53,6 @@ from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration %endif %if deprecated_blocks_info.get('blocks') or deprecated_blocks_info.get('block_types_enabled'): - <% - platform_name = microsite.get_value('platform_name', settings.PLATFORM_NAME) - %>
${_("To avoid errors, {platform_name} strongly recommends that you remove unsupported features from the course advanced settings. To do this, go to the {link_start}Advanced Settings page{link_end}, locate the \"Advanced Module List\" setting, and then delete the following modules from the list.").format( - platform_name=platform_name, + platform_name=static.get_platform_name(), link_start=''.format(advance_settings_url=deprecated_blocks_info['advance_settings_url']), link_end="" )}
diff --git a/common/djangoapps/pipeline_mako/templates/static_content.html b/common/djangoapps/pipeline_mako/templates/static_content.html index ccfab07845..97f433e100 100644 --- a/common/djangoapps/pipeline_mako/templates/static_content.html +++ b/common/djangoapps/pipeline_mako/templates/static_content.html @@ -4,8 +4,7 @@ from pipeline_mako import compressed_css, compressed_js from django.utils.translation import get_language_bidi from mako.exceptions import TemplateLookupException -from microsite_configuration import microsite -from openedx.core.djangoapps.theming.helpers import get_page_title_breadcrumbs, get_value +from openedx.core.djangoapps.theming.helpers import get_page_title_breadcrumbs, get_value, get_template_path, get_themed_template_path, is_request_in_themed_site from certificates.api import get_asset_url_by_slug %> @@ -89,10 +88,10 @@ source, template_path = Loader(engine).load_template_source(path) %def> -<%def name="optional_include_mako(file, with_microsite=False)"><% +<%def name="optional_include_mako(file, is_theming_enabled=False)"><% # http://stackoverflow.com/q/21219531 -if with_microsite: - file = microsite.get_template_path(file) +if is_theming_enabled: + file = get_template_path(file) try: tmpl = self.get_template(file) except TemplateLookupException: @@ -109,3 +108,19 @@ else: <%def name="get_platform_name()"><% return get_value('platform_name', settings.PLATFORM_NAME) %>%def> + +<%def name="get_value(val_name, default=None, **kwargs)"><% + return get_value(val_name, default=default, **kwargs) +%>%def> + +<%def name="get_template_path(relative_path, **kwargs)"><% + return get_template_path(relative_path, **kwargs) +%>%def> + +<%def name="get_themed_template_path(relative_path, default_path, **kwargs)"><% + return get_themed_template_path(relative_path, default_path, **kwargs) +%>%def> + +<%def name="is_request_in_themed_site()"><% + return is_request_in_themed_site() +%>%def> diff --git a/common/test/test_microsites/test_microsite/templates/footer.html b/common/test/test_microsites/test_microsite/templates/footer.html index 66ea6e5551..a7044c0e35 100644 --- a/common/test/test_microsites/test_microsite/templates/footer.html +++ b/common/test/test_microsites/test_microsite/templates/footer.html @@ -3,7 +3,6 @@ <%! from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ -from microsite_configuration import microsite %> diff --git a/common/test/test_microsites/test_microsite/templates/head-extra.html b/common/test/test_microsites/test_microsite/templates/head-extra.html index 82d60e754c..197662ceab 100644 --- a/common/test/test_microsites/test_microsite/templates/head-extra.html +++ b/common/test/test_microsites/test_microsite/templates/head-extra.html @@ -1,6 +1,5 @@ <%namespace name='static' file='../../static_content.html'/> -<%! from microsite_configuration import microsite %> -<% style_overrides_file = microsite.get_value('css_overrides_file') %> +<% style_overrides_file = static.get_value('css_overrides_file') %> % if style_overrides_file: diff --git a/lms/templates/courseware/course_about.html b/lms/templates/courseware/course_about.html index dbddd8a5c1..d376099e85 100644 --- a/lms/templates/courseware/course_about.html +++ b/lms/templates/courseware/course_about.html @@ -1,6 +1,5 @@ <%namespace name='static' file='../static_content.html'/> <%! -from microsite_configuration import microsite from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse from courseware.courses import get_course_about_section @@ -213,7 +212,7 @@ from openedx.core.lib.courses import course_image_url