commit 49044e6967138444209033f3691d3c6a4aaaab6c
Author: Christos Stavrakakis <cstavr@grnet.gr>
Date:   Fri Aug 30 11:41:16 2013 +0300

    Move context_processors from common to middleware

diff --git a/snf-astakos-app/astakos/synnefo_settings.py b/snf-astakos-app/astakos/synnefo_settings.py
index f62d76e..16ed693 100644
--- a/snf-astakos-app/astakos/synnefo_settings.py
+++ b/snf-astakos-app/astakos/synnefo_settings.py
@@ -64,7 +64,7 @@ context_processors = [
     'astakos.im.context_processors.custom_messages',
     'astakos.im.context_processors.last_login_method',
     'astakos.im.context_processors.membership_policies',
-    'synnefo.lib.context_processors.cloudbar'
+    'synnefo.webproject.context_processors.cloudbar'
 ]
 
 middlware_classes = [
diff --git a/snf-common/synnefo/lib/context_processors.py b/snf-common/synnefo/lib/context_processors.py
deleted file mode 100644
index d18da8f..0000000
--- a/snf-common/synnefo/lib/context_processors.py
+++ /dev/null
@@ -1,80 +0,0 @@
-from django.utils.safestring import mark_safe
-from django.conf import settings
-
-
-def cloudbar(request):
-    """
-    Django context processor that applies all cloudbar settings in response
-    context plus a ready to use pre rendered script html tag containing valid
-    javascript code for cloudbar to display.
-
-    To use it add ``synnefo.lib.context_processors.cloudbar`` in your project's
-    ``TEMPLATE_CONTEXT_PROCESSORS setting`` (snf-webproject already does).
-
-    Then in your base html template::
-
-        <html>
-        ....
-        <head>
-        ...
-        {% if CLOUDBAR_ACTIVE %}
-            {{ CLOUDBAR_CODE }}
-        {% endif %}
-        </head>
-        <body>
-        ....
-        </body>
-        </html>
-
-
-    """
-
-    CB_ACTIVE = getattr(settings, 'CLOUDBAR_ACTIVE', True)
-    CB_LOCATION = getattr(settings, 'CLOUDBAR_LOCATION')
-    CB_COOKIE_NAME = getattr(settings, 'CLOUDBAR_COOKIE_NAME',
-            'okeanos_account')
-    CB_SERVICES_URL = getattr(settings, 'CLOUDBAR_SERVICES_URL')
-    CB_MENU_URL = getattr(settings, 'CLOUDBAR_MENU_URL')
-    CB_HEIGHT = getattr(settings, 'CLOUDBAR_HEIGHT',
-            '35')
-    CB_BGCOLOR = getattr(settings, 'CLOUDBAR_BACKGROUND_COLOR',
-            '#000000')
-
-    CB_CODE = """
-    <script type="text/javascript">
-        var CLOUDBAR_LOCATION = "%(location)s";
-        var CLOUDBAR_COOKIE_NAME = "%(cookie_name)s";
-        var GET_SERVICES_URL = "%(services_url)s";
-        var GET_MENU_URL = "%(menu_url)s";
-        var CLOUDBAR_HEIGHT = '%(height)s';
-
-        $(document).ready(function(){
-            $.getScript(CLOUDBAR_LOCATION + 'cloudbar.js');
-        });
-
-    </script>
-    <style>
-        body {
-            border-top: %(height)spx solid %(bg_color)s;
-        }
-        body .cloudbar {
-            height: %(height)spx;
-        }
-    </style>
-""" % {'location': CB_LOCATION,
-       'cookie_name': CB_COOKIE_NAME,
-       'services_url': CB_SERVICES_URL,
-       'menu_url': CB_MENU_URL,
-       'height': str(CB_HEIGHT),
-       'bg_color': CB_BGCOLOR}
-
-    CB_CODE = mark_safe(CB_CODE)
-
-    return {
-        'CLOUDBAR_ACTIVE': CB_ACTIVE,
-        'CLOUDBAR_LOCATION': CB_LOCATION,
-        'CLOUDBAR_COOKIE_NAME': CB_COOKIE_NAME,
-        'CLOUDBAR_SERVICES_URL': CB_SERVICES_URL,
-        'CLOUDBAR_MENU_URL': CB_MENU_URL,
-        'CLOUDBAR_CODE': CB_CODE
-    }
diff --git a/snf-cyclades-app/synnefo/app_settings/__init__.py b/snf-cyclades-app/synnefo/app_settings/__init__.py
index d2ea8f4..8d26ca0 100644
--- a/snf-cyclades-app/synnefo/app_settings/__init__.py
+++ b/snf-cyclades-app/synnefo/app_settings/__init__.py
@@ -11,7 +11,8 @@ synnefo_web_apps = [
 ]
 
 synnefo_web_middleware = []
-synnefo_web_context_processors = ['synnefo.lib.context_processors.cloudbar']
+synnefo_web_context_processors = \
+    ['synnefo.webproject.context_processors.cloudbar']
 
 synnefo_static_files = {
     'synnefo.ui': 'ui/static',
diff --git a/snf-webproject/synnefo/webproject/context_processors.py b/snf-webproject/synnefo/webproject/context_processors.py
new file mode 100644
index 0000000..9082a14
--- /dev/null
+++ b/snf-webproject/synnefo/webproject/context_processors.py
@@ -0,0 +1,81 @@
+from django.utils.safestring import mark_safe
+from django.conf import settings
+
+
+def cloudbar(request):
+    """
+    Django context processor that applies all cloudbar settings in response
+    context plus a ready to use pre rendered script html tag containing valid
+    javascript code for cloudbar to display.
+
+    To use it add ``synnefo.webproject.context_processors.cloudbar`` in your
+    project's ``TEMPLATE_CONTEXT_PROCESSORS setting`` (snf-webproject already
+    does).
+
+    Then in your base html template::
+
+        <html>
+        ....
+        <head>
+        ...
+        {% if CLOUDBAR_ACTIVE %}
+            {{ CLOUDBAR_CODE }}
+        {% endif %}
+        </head>
+        <body>
+        ....
+        </body>
+        </html>
+
+
+    """
+
+    CB_ACTIVE = getattr(settings, 'CLOUDBAR_ACTIVE', True)
+    CB_LOCATION = getattr(settings, 'CLOUDBAR_LOCATION')
+    CB_COOKIE_NAME = getattr(settings, 'CLOUDBAR_COOKIE_NAME',
+            'okeanos_account')
+    CB_SERVICES_URL = getattr(settings, 'CLOUDBAR_SERVICES_URL')
+    CB_MENU_URL = getattr(settings, 'CLOUDBAR_MENU_URL')
+    CB_HEIGHT = getattr(settings, 'CLOUDBAR_HEIGHT',
+            '35')
+    CB_BGCOLOR = getattr(settings, 'CLOUDBAR_BACKGROUND_COLOR',
+            '#000000')
+
+    CB_CODE = """
+    <script type="text/javascript">
+        var CLOUDBAR_LOCATION = "%(location)s";
+        var CLOUDBAR_COOKIE_NAME = "%(cookie_name)s";
+        var GET_SERVICES_URL = "%(services_url)s";
+        var GET_MENU_URL = "%(menu_url)s";
+        var CLOUDBAR_HEIGHT = '%(height)s';
+
+        $(document).ready(function(){
+            $.getScript(CLOUDBAR_LOCATION + 'cloudbar.js');
+        });
+
+    </script>
+    <style>
+        body {
+            border-top: %(height)spx solid %(bg_color)s;
+        }
+        body .cloudbar {
+            height: %(height)spx;
+        }
+    </style>
+""" % {'location': CB_LOCATION,
+       'cookie_name': CB_COOKIE_NAME,
+       'services_url': CB_SERVICES_URL,
+       'menu_url': CB_MENU_URL,
+       'height': str(CB_HEIGHT),
+       'bg_color': CB_BGCOLOR}
+
+    CB_CODE = mark_safe(CB_CODE)
+
+    return {
+        'CLOUDBAR_ACTIVE': CB_ACTIVE,
+        'CLOUDBAR_LOCATION': CB_LOCATION,
+        'CLOUDBAR_COOKIE_NAME': CB_COOKIE_NAME,
+        'CLOUDBAR_SERVICES_URL': CB_SERVICES_URL,
+        'CLOUDBAR_MENU_URL': CB_MENU_URL,
+        'CLOUDBAR_CODE': CB_CODE
+    }
