diff --git a/cms/envs/aws.py b/cms/envs/aws.py index dc46ada0ad..eed4aeb6e7 100644 --- a/cms/envs/aws.py +++ b/cms/envs/aws.py @@ -200,6 +200,7 @@ LOGGING = get_logger_config(LOG_DIR, PLATFORM_NAME = ENV_TOKENS.get('PLATFORM_NAME', 'edX') STUDIO_NAME = ENV_TOKENS.get('STUDIO_NAME', 'edX Studio') TENDER_DOMAIN = ENV_TOKENS.get('TENDER_DOMAIN', TENDER_DOMAIN) +TENDER_SUBDOMAIN = ENV_TOKENS.get('TENDER_SUBDOMAIN', TENDER_SUBDOMAIN) # Event Tracking if "TRACKING_IGNORE_URL_PATTERNS" in ENV_TOKENS: diff --git a/cms/envs/common.py b/cms/envs/common.py index 646c8b9f07..104a355f37 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -577,8 +577,13 @@ REQUIRE_EXCLUDE = ("build.txt",) REQUIRE_ENVIRONMENT = "node" # If you want to enable Tender integration (http://tenderapp.com/), -# put in the domain where Tender hosts tender_widget.js. For example, -# TENDER_DOMAIN = "example.tenderapp.com" +# put in the subdomain where Tender hosts tender_widget.js. For example, +# if you want to use the URL https://example.tenderapp.com/tender_widget.js, +# you should use "example". +TENDER_SUBDOMAIN = None +# If you want to have a vanity domain that points to Tender, put that here. +# For example, "help.myapp.com". Otherwise, should should be your full +# tenderapp domain name: for example, "example.tenderapp.com". TENDER_DOMAIN = None ################################# CELERY ###################################### diff --git a/cms/envs/test.py b/cms/envs/test.py index d16355de26..a5e330953d 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -91,6 +91,7 @@ STATIC_URL = "/static/" PIPELINE_ENABLED = False TENDER_DOMAIN = "help.edge.edx.org" +TENDER_SUBDOMAIN = "edxedge" # Update module store settings per defaults for tests update_module_store_settings( diff --git a/cms/static/require-config.js b/cms/static/require-config.js index dfd996072e..52ff9b7840 100644 --- a/cms/static/require-config.js +++ b/cms/static/require-config.js @@ -67,9 +67,9 @@ require.config({ // externally hosted files "tender": [ - // if TENDER_DOMAIN is defined, use that; otherwise, use a dummy value + // if TENDER_SUBDOMAIN is defined, use that; otherwise, use a dummy value // (the application JS will never `require(['tender'])` if it's not defined) - "//" + (typeof TENDER_DOMAIN === "string" ? TENDER_DOMAIN : "api.tenderapp.com") + "/tender_widget", + "//" + (typeof TENDER_SUBDOMAIN === "string" ? TENDER_SUBDOMAIN : "example") + ".tenderapp.com/tender_widget", // if tender fails to load, fallback on a local file // so that require doesn't fall over "js/src/tender_fallback" diff --git a/cms/templates/base.html b/cms/templates/base.html index a640c07dd9..607aa2024c 100644 --- a/cms/templates/base.html +++ b/cms/templates/base.html @@ -52,7 +52,7 @@ import json diff --git a/cms/templates/widgets/tender.html b/cms/templates/widgets/tender.html index 97fde3c5ab..bf8b9e20de 100644 --- a/cms/templates/widgets/tender.html +++ b/cms/templates/widgets/tender.html @@ -1,4 +1,4 @@ -% if settings.TENDER_DOMAIN and user.is_authenticated(): +% if settings.TENDER_SUBDOMAIN and user.is_authenticated():