diff --git a/base/context_processors.py b/base/context_processors.py new file mode 100644 index 0000000000..02fae3b00b --- /dev/null +++ b/base/context_processors.py @@ -0,0 +1,16 @@ +""" +A set of request processors that return dictionaries to be merged into a +template context. Each function takes the request object as its only parameter +and returns a dictionary to add to the context. + +These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by +RequestContext. +""" +import settings + +def version(request): + """ + Adds seafile version to the context + + """ + return {'seafile_version': settings.SEAFILE_VERSION} diff --git a/media/css/seahub.css b/media/css/seahub.css index e5d6e33213..7d741abc3b 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -48,6 +48,7 @@ div.logo { margin-top: 0px; } #user-info { float: right; font-size: 12px; color: #808; font-style:normal; margin-bottom:10px; } #user-info span { color: #888; display:inline-block; width:60px; text-align:right; margin-right:5px; } #logo-info { float:right; font-size: 14px; color: #ccc; font-style:italic; } +#version-info { float:right; font-size: 12px; color: #ccc; } #header #ident { margin-top: 8px; float: right; font-size: 12px; } #header #ident p { color: #808; } #header #ident label { color: #888; } diff --git a/settings.py b/settings.py index a871b94312..5529449e00 100644 --- a/settings.py +++ b/settings.py @@ -74,7 +74,6 @@ ROOT_URLCONF = 'djblets.util.rooturl' SITE_ROOT = '/' - TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. @@ -89,6 +88,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.media', 'djblets.util.context_processors.siteRoot', 'django.core.context_processors.request', + 'seahub.base.context_processors.version', ) @@ -127,6 +127,8 @@ HTTP_SERVER_ROOT = "http://localhost:8082" # ccnet-applet address and port, used in repo download CCNET_APPLET_ROOT = "http://localhost:8081" +SEAFILE_VERSION = '0.9.2' + try: import local_settings except ImportError: diff --git a/templates/base.html b/templates/base.html index 046decf1ab..2888457f0e 100644 --- a/templates/base.html +++ b/templates/base.html @@ -40,6 +40,11 @@ Hope our efforts will bring you benefits. +
+
+ Seafile 版本: {{ seafile_version }} +
+