From 8c72eddb72550621106e7f68cc3aba42294040bc Mon Sep 17 00:00:00 2001 From: Jason Michalski Date: Wed, 21 May 2014 13:13:27 -0700 Subject: [PATCH] Add a warning when in the zulip.com realm on production Display a red warning box to get users to direct users to staging for the zulip.com (dropbox) realm. (imported from commit 01ad4209d9247406bc82f5dedaf21371101a1d84) --- templates/zerver/right-sidebar.html | 7 +++++++ zerver/views/__init__.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/templates/zerver/right-sidebar.html b/templates/zerver/right-sidebar.html index 17a3045d30..b513c3f17b 100644 --- a/templates/zerver/right-sidebar.html +++ b/templates/zerver/right-sidebar.html @@ -20,6 +20,13 @@ to use the web interface
+ {% if send_to_staging %} +
+

This realm uses staging. Please login into + staging.zulip.com + to be part of the conversation.

+
+ {% endif %}
{% if enable_feedback %}
diff --git a/zerver/views/__init__.py b/zerver/views/__init__.py index 797c023a4b..b837d7f67d 100644 --- a/zerver/views/__init__.py +++ b/zerver/views/__init__.py @@ -1000,6 +1000,11 @@ def home(request): (not user_profile.email.lower().endswith("@customer4.invalid"))): show_invites = False + # Warn users on the zulip.com realm to use staging. + send_to_staging = False + if page_params['domain'] == "zulip.com" and not page_params['staging']: + send_to_staging = True + request._log_data['extra'] = "[%s]" % (register_ret["queue_id"],) response = render_to_response('zerver/index.html', {'user_profile': user_profile, @@ -1013,6 +1018,7 @@ def home(request): 'show_webathena': user_profile.realm.domain == "mit.edu", 'enable_feedback': settings.ENABLE_FEEDBACK, 'embedded': narrow_stream is not None, + 'send_to_staging': send_to_staging, }, context_instance=RequestContext(request)) patch_cache_control(response, no_cache=True, no_store=True, must_revalidate=True)