mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
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)
This commit is contained in:
@@ -20,6 +20,13 @@
|
||||
to use <a href="https://zephyr.zulip.com">the web interface</a></span>
|
||||
</div>
|
||||
<div class="alert alert_sidebar alert-error home-error-bar" id="home-error"></div>
|
||||
{% if send_to_staging %}
|
||||
<div id="staging-warning"class="alert alert_sidebar alert-error">
|
||||
<p>This realm uses staging. Please login into
|
||||
<a href="https://staging.zulip.com/">staging.zulip.com</a>
|
||||
to be part of the conversation.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="alert alert_sidebar alert-error home-error-bar" id="reloading-application"></div>
|
||||
{% if enable_feedback %}
|
||||
<div id="feedback_section">
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user