Added check to exclude OpenEdx

Added check to only apply the changes for
edx.org help center pages.
This commit is contained in:
usama sadiq
2019-08-01 18:48:04 +05:00
parent 825c02b4a2
commit aa8003baeb
3 changed files with 20 additions and 13 deletions

View File

@@ -25,6 +25,7 @@ from django.utils.translation import ugettext as _
from branding.models import BrandingApiConfig
from edxmako.shortcuts import marketing_link
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from six.moves.urllib.parse import urljoin # pylint: disable=import-error
log = logging.getLogger("edx.footer")
@@ -223,18 +224,21 @@ def _build_support_form_url(full_path=False):
def _build_help_center_url(language):
"""
Return the help-center URL based on the
language selected on the homepage.
Return the help-center URL based on the language selected on the homepage.
:param language: selected language
:return: help-center URL
"""
support_url = settings.SUPPORT_SITE_LINK
enabled_languages = {
'en': 'hc/en-us',
'es-419': 'hc/es-419'
}
if language in enabled_languages:
support_url += '/' + enabled_languages[language]
# Changing the site url only for the Edx.org and not for OpenEdx.
if support_url and 'support.edx.org' in support_url:
enabled_languages = {
'en': 'hc/en-us',
'es-419': 'hc/es-419'
}
if language in enabled_languages:
support_url = urljoin(support_url, enabled_languages[language])
return support_url

View File

@@ -9,7 +9,6 @@ from django.test.utils import override_settings
from django.urls import reverse
from branding.api import _footer_business_links, get_footer, get_home_url, get_logo_url
from edxmako.shortcuts import marketing_link
from openedx.core.djangoapps.site_configuration.tests.test_util import with_site_configuration
test_config_disabled_contact_us = { # pylint: disable=invalid-name
@@ -95,7 +94,7 @@ class TestFooter(TestCase):
{'url': 'https://business.edx.org', 'name': 'enterprise', 'title': '\xe9dX for Business'},
{'url': 'https://edx.org/edx-blog', 'name': 'blog', 'title': 'Blog'},
{'url': 'https://edx.org/news-announcements', 'name': 'news', 'title': 'News'},
{'url': 'https://support.example.com/hc/en-us', 'name': 'help-center', 'title': 'Help Center'},
{'url': 'https://example.support.edx.org/hc/en-us', 'name': 'help-center', 'title': 'Help Center'},
{'url': '/support/contact_us', 'name': 'contact', 'title': 'Contact'},
{'url': 'https://edx.org/careers', 'name': 'careers', 'title': 'Careers'},
{'url': 'https://edx.org/donate', 'name': 'donate', 'title': 'Donate'}
@@ -125,7 +124,7 @@ class TestFooter(TestCase):
{'url': 'https://edx.org/edx-blog', 'name': 'blog', 'title': 'Blog'},
# pylint: disable=line-too-long
{'url': '{base_url}/support/contact_us'.format(base_url=settings.LMS_ROOT_URL), 'name': 'contact', 'title': 'Contact Us'},
{'url': 'https://support.example.com/hc/en-us', 'name': 'help-center', 'title': 'Help Center'},
{'url': 'https://example.support.edx.org/hc/en-us', 'name': 'help-center', 'title': 'Help Center'},
{'url': 'https://edx.org/media-kit', 'name': 'media_kit', 'title': 'Media Kit'},
{'url': 'https://edx.org/donate', 'name': 'donate', 'title': 'Donate'}
],
@@ -164,7 +163,11 @@ class TestFooter(TestCase):
'title': 'Powered by Open edX'
},
'edx_org_link': {
'url': 'https://www.edx.org/?utm_medium=affiliate_partner&utm_source=opensource-partner&utm_content=open-edx-partner-footer-link&utm_campaign=open-edx-footer',
'url': 'https://www.edx.org/?'
'utm_medium=affiliate_partner'
'&utm_source=opensource-partner'
'&utm_content=open-edx-partner-footer-link'
'&utm_campaign=open-edx-footer',
'text': 'Take free online courses at edX.org',
},
}

View File

@@ -337,7 +337,7 @@ MKTG_URL_LINK_MAP = {
'WHAT_IS_VERIFIED_CERT': 'verified-certificate',
}
SUPPORT_SITE_LINK = 'https://support.example.com'
SUPPORT_SITE_LINK = 'https://example.support.edx.org'
PASSWORD_RESET_SUPPORT_LINK = 'https://support.example.com/password-reset-help.html'
ACTIVATION_EMAIL_SUPPORT_LINK = 'https://support.example.com/activation-email-help.html'
ENTERPRISE_MARKETING_FOOTER_QUERY_PARAMS = OrderedDict([