settings: Extract settings.SHARE_THE_LOVE.

This commit is contained in:
Tim Abbott
2016-07-18 21:31:33 -07:00
parent afaac85dc6
commit 0aaa55fb8f
6 changed files with 5 additions and 6 deletions

View File

@@ -2,9 +2,6 @@ var feature_flags = (function () {
var exports = {}; var exports = {};
// Voyager-related flags
exports.do_not_share_the_love = page_params.voyager;
// Manually-flipped debugging flags // Manually-flipped debugging flags
exports.log_send_times = false; exports.log_send_times = false;
exports.collect_send_times = false; exports.collect_send_times = false;

View File

@@ -20,7 +20,7 @@ exports.update_state = function (granted, used) {
last_granted = granted; last_granted = granted;
last_used = used; last_used = used;
if (granted <= 0 || feature_flags.do_not_share_the_love) { if (granted <= 0 || !page_params.share_the_love) {
$("#share-the-love").hide(); $("#share-the-love").hide();
} else { } else {
$("#referral-form input").attr('placeholder', _.shuffle(placeholder_invitees).pop()); $("#referral-form input").attr('placeholder', _.shuffle(placeholder_invitees).pop());

View File

@@ -1798,6 +1798,7 @@ class HomeTest(AuthedTestCase):
"realm_name", "realm_name",
"realm_restricted_to_domain", "realm_restricted_to_domain",
"referrals", "referrals",
"share_the_love",
"show_digest_email", "show_digest_email",
"sounds_enabled", "sounds_enabled",
"staging", "staging",
@@ -1808,7 +1809,6 @@ class HomeTest(AuthedTestCase):
"twenty_four_hour_time", "twenty_four_hour_time",
"unread_count", "unread_count",
"unsubbed_info", "unsubbed_info",
"voyager",
] ]
email = "hamlet@zulip.com" email = "hamlet@zulip.com"

View File

@@ -924,7 +924,7 @@ def home(request):
# Pass parameters to the client-side JavaScript code. # Pass parameters to the client-side JavaScript code.
# These end up in a global JavaScript Object named 'page_params'. # These end up in a global JavaScript Object named 'page_params'.
page_params = dict( page_params = dict(
voyager = settings.VOYAGER, share_the_love = settings.SHARE_THE_LOVE,
development_environment = settings.DEVELOPMENT, development_environment = settings.DEVELOPMENT,
debug_mode = settings.DEBUG, debug_mode = settings.DEBUG,
test_suite = settings.TEST_SUITE, test_suite = settings.TEST_SUITE,

View File

@@ -28,6 +28,7 @@ if not ZULIP_COM:
raise Exception("You should create your own local settings from local_settings_template.") raise Exception("You should create your own local settings from local_settings_template.")
ZULIP_FRIENDS_LIST_ID = '84b2f3da6b' ZULIP_FRIENDS_LIST_ID = '84b2f3da6b'
SHARE_THE_LOVE = True
# This can be filled in automatically from the database, maybe # This can be filled in automatically from the database, maybe
DEPLOYMENT_ROLE_NAME = 'zulip.com' DEPLOYMENT_ROLE_NAME = 'zulip.com'

View File

@@ -134,6 +134,7 @@ DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '',
'FEEDBACK_BOT': 'feedback@zulip.com', 'FEEDBACK_BOT': 'feedback@zulip.com',
'FEEDBACK_BOT_NAME': 'Zulip Feedback Bot', 'FEEDBACK_BOT_NAME': 'Zulip Feedback Bot',
'ADMINS': '', 'ADMINS': '',
'SHARE_THE_LOVE': False,
'INLINE_IMAGE_PREVIEW': True, 'INLINE_IMAGE_PREVIEW': True,
'CAMO_URI': '', 'CAMO_URI': '',
'ENABLE_FEEDBACK': PRODUCTION, 'ENABLE_FEEDBACK': PRODUCTION,