Commit 9b25b9a9 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Configurable cloudbar settings in base.html

parent 8afc06d1
......@@ -31,7 +31,9 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
from astakos.im.settings import IM_MODULES, INVITATIONS_ENABLED, IM_STATIC_URL
from astakos.im.settings import IM_MODULES, INVITATIONS_ENABLED, IM_STATIC_URL, \
COOKIE_NAME
from django.conf import settings
def im_modules(request):
return {'im_modules': IM_MODULES}
......@@ -48,3 +50,15 @@ def invitations(request):
def media(request):
return {'IM_STATIC_URL' : IM_STATIC_URL}
def cloudbar(request):
"""
Cloudbar configuration
"""
CB_LOCATION = getattr(settings, 'CLOUDBAR_LOCATION', IM_STATIC_URL + 'cloudbar/')
CB_COOKIE_NAME = getattr(settings, 'CLOUDBAR_COOKIE_NAME', COOKIE_NAME)
CB_ACTIVE_SERVICE = getattr(settings, 'CLOUDBAR_ACTIVE_SERVICE', 'cloud')
return {'CLOUDBAR_LOC': CB_LOCATION,
'CLOUDBAR_COOKIE_NAME': CB_COOKIE_NAME,
'ACTIVE_SERVICE': CB_ACTIVE_SERVICE}
......@@ -60,11 +60,12 @@
})
</script>
<script>
var CLOUDBAR_LOC = "http://docs.dev.grnet.gr/cloudbar/";
var CLOUDBAR_ACTIVE_SERVICE = 'accounts';
var CLOUDBAR_LOCATION = "{{ CLOUDBAR_LOC }}";
var CLOUDBAR_COOKIE_NAME = "{{ CLOUDBAR_COOKIE_NAME }}";
var CLOUDBAR_ACTIVE_SERVICE = '{{ CLOUDBAR_ACTIVE_SERVICE }}';
$(document).ready(function(){
$.getScript(CLOUDBAR_LOC + 'servicesbar.js');
$.getScript(CLOUDBAR_LOCATION + 'cloudbar.js');
})
</script>
</head>
......
......@@ -90,6 +90,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.media',
'django.core.context_processors.request',
'astakos.im.context_processors.media',
'astakos.im.context_processors.cloudbar',
'astakos.im.context_processors.im_modules',
'astakos.im.context_processors.next',
'astakos.im.context_processors.code',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment