2013-04-23 18:51:17 +02:00
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2012-10-15 22:52:08 +02:00
|
|
|
from django.conf import settings
|
2013-06-18 23:55:55 +02:00
|
|
|
import ujson
|
2013-11-04 23:42:31 +01:00
|
|
|
from zproject.backends import password_auth_enabled
|
2012-10-15 22:52:08 +02:00
|
|
|
|
2012-10-30 21:20:52 +01:00
|
|
|
def add_settings(request):
|
2012-10-17 20:34:38 +02:00
|
|
|
return {
|
|
|
|
'full_navbar': settings.FULL_NAVBAR,
|
2013-11-13 22:08:58 +01:00
|
|
|
# We use the not_enterprise variable name so that templates
|
|
|
|
# will render even if the appropriate context is not provided
|
|
|
|
# to the template
|
|
|
|
'not_enterprise': not settings.ENTERPRISE,
|
2013-11-04 19:37:05 +01:00
|
|
|
'zulip_admin': settings.ZULIP_ADMINISTRATOR,
|
2013-11-04 23:42:31 +01:00
|
|
|
'password_auth_enabled': password_auth_enabled(),
|
2013-11-13 23:31:59 +01:00
|
|
|
'login_url': settings.HOME_NOT_LOGGED_IN,
|
2013-11-14 16:56:07 +01:00
|
|
|
'only_sso': settings.ONLY_SSO,
|
2012-10-17 20:34:38 +02:00
|
|
|
}
|
2013-06-17 18:01:22 +02:00
|
|
|
|
|
|
|
def add_metrics(request):
|
|
|
|
return {
|
|
|
|
'mixpanel_token': settings.MIXPANEL_TOKEN,
|
2013-06-18 23:55:55 +02:00
|
|
|
'enable_metrics': ujson.dumps(settings.DEPLOYED),
|
2013-10-29 22:21:17 +01:00
|
|
|
'dropboxAppKey': settings.DROPBOX_APP_KEY
|
2013-06-17 18:01:22 +02:00
|
|
|
}
|