# HG changeset patch # User ymh # Date 1308735767 -7200 # Node ID 55e5f8a878ae8f78f67611c9c86e83844bc1bf29 # Parent 0bebe36ee79f78c7e4c6f8581d17f6307eb05eb1 add the version context_processor and correct css to display it correctly diff -r 0bebe36ee79f -r 55e5f8a878ae web/hdabo/context_processors.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() } + diff -r 0bebe36ee79f -r 55e5f8a878ae web/hdabo/settings.py --- 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', diff -r 0bebe36ee79f -r 55e5f8a878ae web/hdabo/static/hdabo/css/style.css --- 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; diff -r 0bebe36ee79f -r 55e5f8a878ae web/hdabo/utils.py --- 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]