Add current version in footer via context
authorLeonidas Poulopoulos <leopoul@noc.grnet.gr>
Wed, 16 Oct 2013 12:10:13 +0000 (15:10 +0300)
committerLeonidas Poulopoulos <leopoul@noc.grnet.gr>
Wed, 16 Oct 2013 12:10:13 +0000 (15:10 +0300)
_version.py [new file with mode: 0644]
context/__init__.py [new file with mode: 0644]
context/global_vars.py [new file with mode: 0644]
settings.py.dist
templates/footer.html

diff --git a/_version.py b/_version.py
new file mode 100644 (file)
index 0000000..a08110b
--- /dev/null
@@ -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 (file)
index 0000000..e69de29
diff --git a/context/global_vars.py b/context/global_vars.py
new file mode 100644 (file)
index 0000000..c2c2ac0
--- /dev/null
@@ -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,
+            }
index aea257b..79a4b19 100644 (file)
@@ -193,13 +193,13 @@ CELERY_CONCURRENCY = 1
 # List of modules to import when celery starts.
 CELERY_IMPORTS = ("flowspec.tasks", )
 
-SERVER_EMAIL = "GRNET FoD Service <noreply@grnet.gr>"
+SERVER_EMAIL = "GRNET FoD Service <noreply@example.com>"
 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
 
index 67d2b6e..690aea7 100644 (file)
@@ -5,15 +5,15 @@
         {% if user.is_authenticated %}
        <p>{% trans "If you have any questions or need help, contact GRNET Helpdesk at <a href='mailto:helpdesk@grnet.gr'>helpdesk@grnet.gr</a> or 800-11-47638." %}</p>
        {% endif %}
-       <div style="padding-top: 10px;">{% trans "Designed and developed by GRNET NOC" %}
+       <div style="padding-top: 10px;">Vesrion: <strong>{{VERSION}}</strong> - {% trans "Designed and developed by GRNET NOC" %}
        <a href="//facebook.com/noc.grnet.gr" target="_blank"><img src="/fodstatic/img/facebook_img.png" alt="GRNET NOC on Facebook" title="GRNET NOC on Facebook"/></a>  <a href="//twitter.com/grnetnoc"  target="_blank"><img src="/fodstatic/img/twitter_img.png" alt="GRNET NOC on Twitter" title="GRNET NOC on Twitter"/></a>
        </div>
         <div class="row"><a href="http://noc.grnet.gr">{% trans "GRNET" %} NOC</a> | <a href="/fod/info/{{LANGUAGE_CODE}}/">{% trans "Info" %}</a> | <a href="/fod/tos/{{LANGUAGE_CODE}}/">{% trans "Service Terms" %}</a></div>
         <div style="padding-top: 10px;">
-        
+
         </div>
 <div style="padding-top: 10px;">
-       <iframe width="500" scrolling="no" height="40" frameborder="0" align="middle" src="https://dido.grnet.gr/logos/index.html" marginwidth="0" marginheight="0"></iframe>
+       <iframe width="500" scrolling="no" height="50" frameborder="0" align="middle" src="https://dido.grnet.gr/logos/index.html" marginwidth="0" marginheight="0"></iframe>
        </div>
       </div>
-    </footer>
\ No newline at end of file
+    </footer>