set pandora.site.site.version and show on /software, fixes #866

This commit is contained in:
j 2012-06-22 11:38:36 +02:00
parent 9821a579d4
commit 523176ee51
3 changed files with 13 additions and 0 deletions

View file

@ -19,6 +19,16 @@ _win = (sys.platform == "win32")
RUN_RELOADER = True
def get_version():
info = os.path.join(os.path.dirname(__file__), '..', '..', '.bzr/branch/last-revision')
if os.path.exists(info):
f = open(info)
rev = int(f.read().split()[0])
f.close()
if rev:
return u'%s' % rev
return u'unknown'
def load_config():
with open(settings.SITE_CONFIG) as f:
try:
@ -33,6 +43,7 @@ def load_config():
settings.DEFAULT_FROM_EMAIL = config['site']['email']['system']
settings.SERVER_EMAIL = config['site']['email']['system']
config['site']['videoprefix'] = settings.VIDEO_PREFIX
config['site']['version'] = get_version()
config['keys'] = {}
for key in config['itemKeys']:

View file

@ -28,6 +28,7 @@ pandora.ui.siteDialog = function(section) {
+ '<p>To learn more about <b>pan.do/ra</b> and <b>OxJS</b>, '
+ 'please visit <a href="https://pan.do/ra">pan.do/ra</a> '
+ 'and <a href="https://oxjs.org">oxjs.org</a>.</p>'
+ '<b>' + pandora.site.site.name + '</b> is running pan.do/ra r'+ pandora.site.site.version
)
.appendTo($content);
} else {

View file

@ -28,6 +28,7 @@ pandora.ui.siteDialog = function(section) {
+ '<p>To learn more about <b>pan.do/ra</b> and <b>OxJS</b>, '
+ 'please visit <a href="https://pan.do/ra">pan.do/ra</a> '
+ 'and <a href="https://oxjs.org">oxjs.org</a>.</p>'
+ '<b>' + pandora.site.site.name + '</b> is running pan.do/ra r'+ pandora.site.site.version
)
.appendTo($content);
} else {