From: Leonidas Poulopoulos Date: Wed, 16 Oct 2013 12:10:13 +0000 (+0300) Subject: Add current version in footer via context X-Git-Tag: v0.9.9~15 X-Git-Url: https://code.grnet.gr/git/flowspy/commitdiff_plain/8c4143ebcdcc3af4251967ea228577557b053d2c Add current version in footer via context --- diff --git a/_version.py b/_version.py new file mode 100644 index 0000000..a08110b --- /dev/null +++ b/_version.py @@ -0,0 +1,4 @@ +VERSION = '0.9.8' + +if __name__ == "__main__": + print VERSION diff --git a/context/__init__.py b/context/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/context/global_vars.py b/context/global_vars.py new file mode 100644 index 0000000..c2c2ac0 --- /dev/null +++ b/context/global_vars.py @@ -0,0 +1,23 @@ +# +# -*- coding: utf-8 -*- vim:fileencoding=utf-8: +# Copyright © 2010-2012 Greek Research and Technology Network (GRNET S.A.) +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD +# TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +# FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, +# OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. + +from django.conf import settings + +def settings_vars(context): + # return the value you want as a dictionnary. you may add multiple values in there. + return { + 'VERSION': settings.SW_VERSION, + } diff --git a/settings.py.dist b/settings.py.dist index aea257b..79a4b19 100644 --- a/settings.py.dist +++ b/settings.py.dist @@ -193,13 +193,13 @@ CELERY_CONCURRENCY = 1 # List of modules to import when celery starts. CELERY_IMPORTS = ("flowspec.tasks", ) -SERVER_EMAIL = "GRNET FoD Service " +SERVER_EMAIL = "GRNET FoD Service " EMAIL_SUBJECT_PREFIX = "[FoD] " LOG_FILE_LOCATION = here("log") EXPIRATION_NOTIFY_DAYS = 4 -PREFIX_LENGTH = 29 +PREFIX_LENGTH = 29 POLL_SESSION_UPDATE = 60.0 BROKER_URL = "beanstalk://localhost:11300//" @@ -216,7 +216,7 @@ UI_USER_PROTOCOLS = ['icmp', 'tcp', 'udp'] PROTECTED_SUBNETS = ['10.10.0.0/16'] -CELERYBEAT_SCHEDULE = { +CELERYBEAT_SCHEDULE = { "every-day-sync": { "task": "flowspec.tasks.check_sync", "schedule": crontab(minute=01, hour=01), @@ -229,8 +229,8 @@ CELERYBEAT_SCHEDULE = { }, } # whois -PRIMARY_WHOIS = 'whois.grnet.gr' -ALTERNATE_WHOIS = 'whois.ripe.net' +PRIMARY_WHOIS = 'whois.example.com' +ALTERNATE_WHOIS = 'whois.example.net' ACCOUNT_ACTIVATION_DAYS = 7 @@ -249,4 +249,6 @@ TINYMCE_DEFAULT_CONFIG = { 'theme': "advanced", } +import _version +SW_VERSION = _version.VERSION diff --git a/templates/footer.html b/templates/footer.html index 67d2b6e..690aea7 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -5,15 +5,15 @@ {% if user.is_authenticated %}

{% trans "If you have any questions or need help, contact GRNET Helpdesk at helpdesk@grnet.gr or 800-11-47638." %}

{% endif %} -
{% trans "Designed and developed by GRNET NOC" %} +
Vesrion: {{VERSION}} - {% trans "Designed and developed by GRNET NOC" %} GRNET NOC on Facebook GRNET NOC on Twitter
- +
- +
- \ No newline at end of file +