Commit cfb1ec11 by David Baumgold

Define TENDER_SUBDOMAIN to that we can still use vanity URLs

parent f473c474
......@@ -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:
......
......@@ -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 ######################################
......
......@@ -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(
......
......@@ -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"
......
......@@ -52,7 +52,7 @@ import json
<script type="text/javascript">
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};
</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">
window.Tender = {
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