From 6c8c67cad59c8a57272f65cdeab73704c78138ad Mon Sep 17 00:00:00 2001 From: Saleem Latif Date: Mon, 18 Jan 2016 15:12:50 +0500 Subject: [PATCH] Remove microsite_configuration/templatetags/microsite.py references from individual templates. --- .../templates/static_content.html | 10 ++++++++++ .../courseware/courseware-chromeless.html | 5 ++--- lms/templates/courseware/courseware.html | 5 ++--- .../_dashboard_status_verification.html | 3 +-- lms/templates/help_modal.html | 11 +++++------ lms/templates/main.html | 3 +-- lms/templates/navigation-edx.html | 3 +-- lms/templates/navigation.html | 3 +-- lms/templates/ux/reference/teams-base.html | 1 - lms/templates/ux/reference/teams-create.html | 1 - openedx/core/djangoapps/theming/helpers.py | 19 +++++++++++++++++++ themes/edx.org/lms/templates/header.html | 3 +-- themes/red-theme/lms/templates/footer.html | 1 - themes/red-theme/lms/templates/header.html | 3 +-- 14 files changed, 44 insertions(+), 27 deletions(-) create mode 100644 openedx/core/djangoapps/theming/helpers.py diff --git a/common/djangoapps/pipeline_mako/templates/static_content.html b/common/djangoapps/pipeline_mako/templates/static_content.html index f3c5ee4a51..ccfab07845 100644 --- a/common/djangoapps/pipeline_mako/templates/static_content.html +++ b/common/djangoapps/pipeline_mako/templates/static_content.html @@ -5,6 +5,7 @@ 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 certificates.api import get_asset_url_by_slug %> @@ -99,3 +100,12 @@ except TemplateLookupException: else: tmpl.render_context(context) %> + + +<%def name="get_page_title_breadcrumbs(*args)"><% + return get_page_title_breadcrumbs(*args) +%> + +<%def name="get_platform_name()"><% + return get_value('platform_name', settings.PLATFORM_NAME) +%> diff --git a/lms/templates/courseware/courseware-chromeless.html b/lms/templates/courseware/courseware-chromeless.html index fec184af07..745a87ecfa 100644 --- a/lms/templates/courseware/courseware-chromeless.html +++ b/lms/templates/courseware/courseware-chromeless.html @@ -3,7 +3,6 @@ <%! from django.utils.translation import ugettext as _ from django.template.defaultfilters import escapejs -from microsite_configuration import page_title_breadcrumbs from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled %> <%def name="course_name()"> @@ -13,9 +12,9 @@ from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled <%block name="bodyclass">view-in-course view-courseware courseware ${course.css_class or ''} <%block name="title"> % if section_title: -${page_title_breadcrumbs(section_title, course_name())} +${static.get_page_title_breadcrumbs(section_title, course_name())} % else: -${page_title_breadcrumbs(course_name())} +${static.get_page_title_breadcrumbs(course_name())} %endif diff --git a/lms/templates/courseware/courseware.html b/lms/templates/courseware/courseware.html index 2b64753d47..ed890e1eb1 100644 --- a/lms/templates/courseware/courseware.html +++ b/lms/templates/courseware/courseware.html @@ -3,7 +3,6 @@ <%! from django.utils.translation import ugettext as _ from django.template.defaultfilters import escapejs -from microsite_configuration import page_title_breadcrumbs from django.conf import settings from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled %> @@ -17,9 +16,9 @@ from edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled <%block name="bodyclass">view-in-course view-courseware courseware ${course.css_class or ''} <%block name="title"> % if section_title: -${page_title_breadcrumbs(section_title, course_name())} +${static.get_page_title_breadcrumbs(section_title, course_name())} % else: -${page_title_breadcrumbs(course_name())} +${static.get_page_title_breadcrumbs(course_name())} %endif diff --git a/lms/templates/dashboard/_dashboard_status_verification.html b/lms/templates/dashboard/_dashboard_status_verification.html index 029474f10c..3b4db661f0 100644 --- a/lms/templates/dashboard/_dashboard_status_verification.html +++ b/lms/templates/dashboard/_dashboard_status_verification.html @@ -2,7 +2,6 @@ <%! from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse -from microsite_configuration.templatetags.microsite import platform_name %> %if verification_status == 'approved': @@ -40,7 +39,7 @@ from microsite_configuration.templatetags.microsite import platform_name %if verification_status in ['must_reverify', 'expired']:
  • -${_("{platform_name} Verification Status").format(platform_name=platform_name())} +${_("{platform_name} Verification Status").format(platform_name=static.get_platform_name())}
    ${verification_msg} diff --git a/lms/templates/help_modal.html b/lms/templates/help_modal.html index 6731986621..85fc3ab3ab 100644 --- a/lms/templates/help_modal.html +++ b/lms/templates/help_modal.html @@ -8,7 +8,6 @@ from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse from xmodule.tabs import CourseTabList from microsite_configuration import microsite -from microsite_configuration.templatetags.microsite import platform_name %> % if settings.FEATURES.get('ENABLE_FEEDBACK_SUBMISSION', False): @@ -17,7 +16,7 @@ from microsite_configuration.templatetags.microsite import platform_name ${_("Help")}
    -