2015-05-10 04:51:32 -06:00
|
|
|
from django.conf import settings
|
|
|
|
from django.template.loader import render_to_string
|
|
|
|
|
|
|
|
|
|
|
|
def analytics(request):
|
|
|
|
"""Returns analytics code."""
|
|
|
|
if settings.ENVIRONMENT == 'production':
|
2017-02-22 08:39:26 -07:00
|
|
|
return {'analytics_code': render_to_string('includes/analytics.html')}
|
2015-05-10 04:51:32 -06:00
|
|
|
else:
|
|
|
|
return {'analytics_code': ''}
|
|
|
|
|
|
|
|
|
|
|
|
def stage_notice(request):
|
|
|
|
"""Displays stage notice."""
|
|
|
|
if settings.ENVIRONMENT == 'stage':
|
|
|
|
return {'stage_notice': render_to_string('includes/stage_notice.html')}
|
|
|
|
else:
|
|
|
|
return {'stage_notice': ''}
|
2018-11-17 13:11:35 -07:00
|
|
|
|
|
|
|
|
|
|
|
def auth_block(request):
|
|
|
|
"""Displays auth links local vs auth0."""
|
|
|
|
if settings.AUTH0:
|
|
|
|
return {'auth_block': render_to_string('includes/auth_auth0.html')}
|
|
|
|
else:
|
|
|
|
return {'auth_block': render_to_string('includes/auth_local.html')}
|