Commit c6992688 by David Baumgold

Merge pull request #7314 from edx/load-tender-js-from-tenderapp-subdomain

Define TENDER_SUBDOMAIN so that we can still use vanity URLs
parents 0a385c04 cfb1ec11
...@@ -200,6 +200,7 @@ LOGGING = get_logger_config(LOG_DIR, ...@@ -200,6 +200,7 @@ LOGGING = get_logger_config(LOG_DIR,
PLATFORM_NAME = ENV_TOKENS.get('PLATFORM_NAME', 'edX') PLATFORM_NAME = ENV_TOKENS.get('PLATFORM_NAME', 'edX')
STUDIO_NAME = ENV_TOKENS.get('STUDIO_NAME', 'edX Studio') STUDIO_NAME = ENV_TOKENS.get('STUDIO_NAME', 'edX Studio')
TENDER_DOMAIN = ENV_TOKENS.get('TENDER_DOMAIN', TENDER_DOMAIN) TENDER_DOMAIN = ENV_TOKENS.get('TENDER_DOMAIN', TENDER_DOMAIN)
TENDER_SUBDOMAIN = ENV_TOKENS.get('TENDER_SUBDOMAIN', TENDER_SUBDOMAIN)
# Event Tracking # Event Tracking
if "TRACKING_IGNORE_URL_PATTERNS" in ENV_TOKENS: if "TRACKING_IGNORE_URL_PATTERNS" in ENV_TOKENS:
......
...@@ -574,8 +574,13 @@ REQUIRE_EXCLUDE = ("build.txt",) ...@@ -574,8 +574,13 @@ REQUIRE_EXCLUDE = ("build.txt",)
REQUIRE_ENVIRONMENT = "node" REQUIRE_ENVIRONMENT = "node"
# If you want to enable Tender integration (http://tenderapp.com/), # If you want to enable Tender integration (http://tenderapp.com/),
# put in the domain where Tender hosts tender_widget.js. For example, # put in the subdomain where Tender hosts tender_widget.js. For example,
# TENDER_DOMAIN = "example.tenderapp.com" # 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 TENDER_DOMAIN = None
################################# CELERY ###################################### ################################# CELERY ######################################
......
...@@ -91,6 +91,7 @@ STATIC_URL = "/static/" ...@@ -91,6 +91,7 @@ STATIC_URL = "/static/"
PIPELINE_ENABLED = False PIPELINE_ENABLED = False
TENDER_DOMAIN = "help.edge.edx.org" TENDER_DOMAIN = "help.edge.edx.org"
TENDER_SUBDOMAIN = "edxedge"
# Update module store settings per defaults for tests # Update module store settings per defaults for tests
update_module_store_settings( update_module_store_settings(
......
...@@ -67,9 +67,9 @@ require.config({ ...@@ -67,9 +67,9 @@ require.config({
// externally hosted files // externally hosted files
"tender": [ "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) // (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 // if tender fails to load, fallback on a local file
// so that require doesn't fall over // so that require doesn't fall over
"js/src/tender_fallback" "js/src/tender_fallback"
......
...@@ -52,7 +52,7 @@ import json ...@@ -52,7 +52,7 @@ import json
<script type="text/javascript"> <script type="text/javascript">
window.baseUrl = ${json.dumps(settings.STATIC_URL)}; window.baseUrl = ${json.dumps(settings.STATIC_URL)};
window.TENDER_DOMAIN = ${json.dumps(settings.TENDER_DOMAIN)}; window.TENDER_SUBDOMAIN = ${json.dumps(settings.TENDER_SUBDOMAIN)};
var require = {baseUrl: window.baseUrl}; var require = {baseUrl: window.baseUrl};
</script> </script>
<script type="text/javascript" src="${static.url("js/vendor/require.js")}"></script> <script type="text/javascript" src="${static.url("js/vendor/require.js")}"></script>
......
% if settings.TENDER_DOMAIN and user.is_authenticated(): % if settings.TENDER_SUBDOMAIN and user.is_authenticated():
<script type="text/javascript"> <script type="text/javascript">
window.Tender = { window.Tender = {
hideToggle: true, hideToggle: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment