app/soc/views/helper/responses.py
changeset 1357 3dd1507aa723
parent 1308 35b75ffcbb37
child 1398 e6a11f0dba68
equal deleted inserted replaced
1356:32d8d83678cd 1357:3dd1507aa723
   118 
   118 
   119   context['soc_release'] = release.RELEASE_TAG
   119   context['soc_release'] = release.RELEASE_TAG
   120   context['gae_version'] = system.getAppVersion()
   120   context['gae_version'] = system.getAppVersion()
   121 
   121 
   122   settings = site.logic.getSingleton()
   122   settings = site.logic.getSingleton()
   123   
   123 
   124   if settings:
   124   if settings:
   125     context['ga_tracking_num'] = settings.ga_tracking_num
   125     context['ga_tracking_num'] = settings.ga_tracking_num
   126     context['gmaps_api_key'] = settings.gmaps_api_key
   126     context['gmaps_api_key'] = settings.gmaps_api_key
   127   context['tos_link'] = redirects.getToSRedirect(settings)
   127   context['tos_link'] = redirects.getToSRedirect(settings)
   128  
   128  
   129   return context
   129   return context
   130 
   130 
       
   131 def useJavaScript(context, uses):
       
   132   """Updates the context for JavaScript usage.
       
   133   """
       
   134 
       
   135   for use in uses:
       
   136     context['uses_%s' % use] = True
   131 
   137 
   132 def redirectToChangedSuffix(
   138 def redirectToChangedSuffix(
   133     request, old_suffix, new_suffix=None, params=None):
   139     request, old_suffix, new_suffix=None, params=None):
   134   """Changes suffix of URL path and returns an HTTP redirect response.
   140   """Changes suffix of URL path and returns an HTTP redirect response.
   135   
   141