From 0d854bd51e989367f2d0dc585bb33bf79d69d927 Mon Sep 17 00:00:00 2001
From: Julia Hansbrough
Date: Wed, 28 May 2014 15:43:13 +0000
Subject: [PATCH] Moved hardcoded defaults into settings
---
cms/envs/test.py | 2 +-
lms/envs/aws.py | 6 ++++++
lms/envs/common.py | 8 ++++++--
lms/envs/test.py | 3 +++
lms/templates/contact.html | 8 ++++----
lms/templates/courseware/course_about.html | 8 ++++----
6 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/cms/envs/test.py b/cms/envs/test.py
index 74b0525388..8b9f7ae73f 100644
--- a/cms/envs/test.py
+++ b/cms/envs/test.py
@@ -18,7 +18,7 @@ from path import path
from warnings import filterwarnings
# import settings from LMS for consistent behavior with CMS
-from lms.envs.test import (WIKI_ENABLED)
+from lms.envs.test import (WIKI_ENABLED, PLATFORM_NAME, SITE_NAME)
# Nose Test Runner
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
diff --git a/lms/envs/aws.py b/lms/envs/aws.py
index 00705c8894..7ef55e5fad 100644
--- a/lms/envs/aws.py
+++ b/lms/envs/aws.py
@@ -127,6 +127,8 @@ if STATIC_URL_BASE:
PLATFORM_NAME = ENV_TOKENS.get('PLATFORM_NAME', PLATFORM_NAME)
# For displaying on the receipt. At Stanford PLATFORM_NAME != MERCHANT_NAME, but PLATFORM_NAME is a fine default
+PLATFORM_TWITTER_ACCOUNT = ENV_TOKENS.get('PLATFORM_TWITTER_ACCOUNT', PLATFORM_TWITTER_ACCOUNT)
+PLATFORM_FACEBOOK_ACCOUNT = ENV_TOKENS.get('PLATFORM_FACEBOOK_ACCOUNT', PLATFORM_FACEBOOK_ACCOUNT)
CC_MERCHANT_NAME = ENV_TOKENS.get('CC_MERCHANT_NAME', PLATFORM_NAME)
EMAIL_BACKEND = ENV_TOKENS.get('EMAIL_BACKEND', EMAIL_BACKEND)
EMAIL_FILE_PATH = ENV_TOKENS.get('EMAIL_FILE_PATH', None)
@@ -170,6 +172,10 @@ TECH_SUPPORT_EMAIL = ENV_TOKENS.get('TECH_SUPPORT_EMAIL', TECH_SUPPORT_EMAIL)
CONTACT_EMAIL = ENV_TOKENS.get('CONTACT_EMAIL', CONTACT_EMAIL)
BUGS_EMAIL = ENV_TOKENS.get('BUGS_EMAIL', BUGS_EMAIL)
PAYMENT_SUPPORT_EMAIL = ENV_TOKENS.get('PAYMENT_SUPPORT_EMAIL', PAYMENT_SUPPORT_EMAIL)
+UNIVERSITY_EMAIL = ENV_TOKENS.get('UNIVERSITY_EMAIL', UNIVERSITY_EMAIL)
+PRESS_EMAIL = ENV_TOKENS.get('PRESS_EMAIL', PRESS_EMAIL)
+
+# Currency
PAID_COURSE_REGISTRATION_CURRENCY = ENV_TOKENS.get('PAID_COURSE_REGISTRATION_CURRENCY',
PAID_COURSE_REGISTRATION_CURRENCY)
diff --git a/lms/envs/common.py b/lms/envs/common.py
index b44851cc0b..8fd7cba988 100644
--- a/lms/envs/common.py
+++ b/lms/envs/common.py
@@ -37,8 +37,10 @@ from lms.lib.xblock.mixin import LmsBlockMixin
################################### FEATURES ###################################
# The display name of the platform to be used in templates/emails/etc.
-PLATFORM_NAME = "edX"
+PLATFORM_NAME = "Your Platform Name Here"
CC_MERCHANT_NAME = PLATFORM_NAME
+PLATFORM_TWITTER_ACCOUNT = "@YourPlatformTwitterAccount"
+PLATFORM_FACEBOOK_ACCOUNT = "http://www.facebook.com/YourPlatformFacebookAccount"
COURSEWARE_ENABLED = True
ENABLE_JASMINE = False
@@ -523,7 +525,7 @@ CMS_BASE = 'localhost:8001'
# Site info
SITE_ID = 1
-SITE_NAME = "edx.org"
+SITE_NAME = "example.com"
HTTPS = 'on'
ROOT_URLCONF = 'lms.urls'
# NOTE: Please set ALLOWED_HOSTS to some sane value, as we do not allow the default '*'
@@ -536,6 +538,8 @@ SERVER_EMAIL = 'devops@example.com'
TECH_SUPPORT_EMAIL = 'technical@example.com'
CONTACT_EMAIL = 'info@example.com'
BUGS_EMAIL = 'bugs@example.com'
+UNIVERSITY_EMAIL = 'university@example.com'
+PRESS_EMAIL = 'press@example.com'
ADMINS = ()
MANAGERS = ADMINS
diff --git a/lms/envs/test.py b/lms/envs/test.py
index 110e7a48f6..6aa6663575 100644
--- a/lms/envs/test.py
+++ b/lms/envs/test.py
@@ -287,6 +287,9 @@ FEATURES['CLASS_DASHBOARD'] = True
import openid.oidutil
openid.oidutil.log = lambda message, level = 0: None
+PLATFORM_NAME = "edX"
+SITE_NAME = "edx.org"
+
# set up some testing for microsites
MICROSITE_CONFIGURATION = {
"test_microsite": {
diff --git a/lms/templates/contact.html b/lms/templates/contact.html
index 6bbfc43daa..2391889fe3 100644
--- a/lms/templates/contact.html
+++ b/lms/templates/contact.html
@@ -28,10 +28,10 @@
'discussion on our {fb_link_start}facebook page{fb_link_end}. Though we may '
'not have a chance to respond to every email, we take all feedback into consideration.').format(
platform_name=settings.PLATFORM_NAME,
- contact_email=u'{0}'.format(settings.CONTACT_EMAIL),
+ contact_email=u'{email}'.format(email=settings.CONTACT_EMAIL),
faq_link_start=u''.format(url=reverse('faq_edx')),
faq_link_end='',
- fb_link_start='',
+ fb_link_start=''.format(url=settings.PLATFORM_FACEBOOK_ACCOUNT),
fb_link_end=''
)}
@@ -54,13 +54,13 @@
${_('Please visit our {link_start}media/press page{link_end} for more information. For any media or press inquiries, please email {email}.').format(
link_start=u''.format(url=reverse('faq_edx')),
link_end='',
- email=u'press@edx.org',
+ email=u'{email}/a>'.format(email=settings.PRESS_EMAIL),
)}
${_("Universities")}
${_('If you are a university wishing to collaborate with or if you have questions about {platform_name}, please email {email}.').format(
- email=u'university@edx.org',
+ email=u'{url}'.format(url=settings.UNIVERSITY_EMAIL),
platform_name=settings.PLATFORM_NAME
)}
diff --git a/lms/templates/courseware/course_about.html b/lms/templates/courseware/course_about.html
index 50da3af97b..4aeded3a34 100644
--- a/lms/templates/courseware/course_about.html
+++ b/lms/templates/courseware/course_about.html
@@ -238,15 +238,15 @@
% else:
<%
- site_domain = microsite.get_value('site_domain', 'www.edx.org')
- platform_name = microsite.get_value('platform_name', 'edX')
+ site_domain = microsite.get_value('site_domain', settings.SITE_NAME)
+ platform_name = microsite.get_value('platform_name', settings.PLATFORM_NAME)
# Translators: This text will be automatically posted to the student's
# Twitter account. {url} should appear at the end of the text.
tweet_text = _("I just registered for {number} {title} through {account}: {url}").format(
number=course.number,
title=get_course_about_section(course, 'title'),
- account=microsite.get_value('course_about_twitter_account', '@edxonline'),
+ account=microsite.get_value('course_about_twitter_account', settings.PLATFORM_TWITTER_ACCOUNT),
url=u"http://{domain}{path}".format(
domain=site_domain,
path=reverse('about_course', args=[course.id.to_deprecated_string()])
@@ -254,7 +254,7 @@
).replace(u" ", u"+")
tweet_action = u"http://twitter.com/intent/tweet?text={tweet_text}".format(tweet_text=tweet_text)
- facebook_link = microsite.get_value('course_about_facebook_link', 'http://www.facebook.com/EdxOnline')
+ facebook_link = microsite.get_value('course_about_facebook_link', settings.PLATFORM_FACEBOOK_ACCOUNT)
email_subject = u"mailto:?subject={subject}&body={body}".format(
subject=_("Take a course with {platform} online").format(platform=platform_name),