add the version context_processor and correct css to display it correctly
authorymh <ymh.work@gmail.com>
Wed, 22 Jun 2011 11:42:47 +0200
changeset 49 55e5f8a878ae
parent 48 0bebe36ee79f
child 50 dca0c476617b
add the version context_processor and correct css to display it correctly
web/hdabo/context_processors.py
web/hdabo/settings.py
web/hdabo/static/hdabo/css/style.css
web/hdabo/utils.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/hdabo/context_processors.py	Wed Jun 22 11:42:47 2011 +0200
@@ -0,0 +1,5 @@
+import hdabo
+
+def version(request):
+    return { 'VERSION': hdabo.get_version() }
+
--- a/web/hdabo/settings.py	Wed Jun 22 06:50:51 2011 +0200
+++ b/web/hdabo/settings.py	Wed Jun 22 11:42:47 2011 +0200
@@ -92,6 +92,19 @@
 #     'django.template.loaders.eggs.Loader',
 )
 
+# List of processors used by RequestContext to populate the context.
+# Each one should be a callable that takes the request object as its
+# only parameter and returns a dictionary to add to the context.
+TEMPLATE_CONTEXT_PROCESSORS = (
+    'django.contrib.auth.context_processors.auth',
+    'django.core.context_processors.debug',
+    'django.core.context_processors.i18n',
+    'django.core.context_processors.media',
+    'django.core.context_processors.static',
+    'django.contrib.messages.context_processors.messages',
+    'hdabo.context_processors.version',
+)
+
 MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
--- a/web/hdabo/static/hdabo/css/style.css	Wed Jun 22 06:50:51 2011 +0200
+++ b/web/hdabo/static/hdabo/css/style.css	Wed Jun 22 11:42:47 2011 +0200
@@ -124,16 +124,7 @@
     font-size:9px;
 }
 
-.version a:link
-{
-    text-decoration: none;
-    color: white;
-    text-decoration: bold;
-    font-weight: bold;
-    border-bottom-style: none;
-}
-
-.version a:hover
+.version:hover
 {
     color: #2c8084;
     text-decoration: none;
@@ -142,21 +133,6 @@
     border-bottom-style: none;
 }
 
-.version a:active
-{
-    color: white;
-    text-decoration: none;
-    font-weight: bold;
-    border-bottom-style: none;
-}
-
-.version a:visited
-{
-    color: white;
-    font-weight: bold;
-    border-bottom-style: none;
-}
-
 .small
 {
     font-size:9px;
--- a/web/hdabo/utils.py	Wed Jun 22 06:50:51 2011 +0200
+++ b/web/hdabo/utils.py	Wed Jun 22 11:42:47 2011 +0200
@@ -219,7 +219,7 @@
         for k in self:
             yield (k, self[k])
 
-    def update(*args, **kwds):
+    def update(*args, **kwds): #@NoSelf
         '''od.update(E, **F) -> None.  Update od from dict/iterable E and F.
 
         If E is a dict instance, does:           for k in E: od[k] = E[k]