externalize footer contents from template into config
authorTero Marttila <terom@fixme.fi>
Wed, 01 Jul 2009 20:46:27 +0300
changeset 142 2b8dfacc6d2d
parent 141 9387da0dc183
child 143 a6e53a20fccb
externalize footer contents from template into config
degal/config.py
degal/static/style.css
degal/templates.py
--- a/degal/config.py	Wed Jul 01 20:40:00 2009 +0300
+++ b/degal/config.py	Wed Jul 01 20:46:27 2009 +0300
@@ -3,6 +3,7 @@
 """
 
 import copy, logging
+import templates
 
 class InstanceContext (object) :
     """
@@ -147,6 +148,9 @@
         ("FocalLength",             "Focal length"              ),
     )
 
+    # footer text HTML element, must use html.raw if this includes formatting
+    footer              = templates.footer
+
     # XXX: move elsewhere?
     def is_image (self, file) :
         """
--- a/degal/static/style.css	Wed Jul 01 20:40:00 2009 +0300
+++ b/degal/static/style.css	Wed Jul 01 20:46:27 2009 +0300
@@ -48,7 +48,7 @@
     margin: 0px;
 }
 
-p#about {
+p#footer {
     padding-top: 40px;
     font-size: xx-small;
     text-align: center;
--- a/degal/templates.py	Wed Jul 01 20:40:00 2009 +0300
+++ b/degal/templates.py	Wed Jul 01 20:46:27 2009 +0300
@@ -194,12 +194,14 @@
             body,
             
             # footer
-            tags.p(id='about')(
-                "Generated using",
-                tags.a(href='http://projects.qmsk.net/degal')('Degal'), 
-                "version",
-                tags.a(href=version.VERSION_URL)(version.VERSION_STRING),
-            )
+            tags.p(id='about')(page.config.footer),
         ],
     )
 
+# default footer used
+footer = (
+    "Generated using",
+    tags.a(href='http://projects.qmsk.net/degal')('Degal'), 
+    "version",
+    tags.a(href=version.VERSION_URL)(version.VERSION_STRING),
+)