# HG changeset patch # User Tero Marttila # Date 1233975442 -7200 # Node ID 9d3beac1b196ac9ce3398091373ea91f56164d72 # Parent 8f143b1ce0d167f5ab99414a6699d8811a416e0c remove foo.html page, and rice up the footer a bit diff -r 8f143b1ce0d1 -r 9d3beac1b196 lib/config.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/config.py Sat Feb 07 04:57:22 2009 +0200 @@ -0,0 +1,7 @@ +""" + Configuration settings, preferences +""" + +# datetime format for time.strftime +DATETIME_FMT = "%Y/%m/%d %H:%M %Z" + diff -r 8f143b1ce0d1 -r 9d3beac1b196 lib/helpers.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/helpers.py Sat Feb 07 04:57:22 2009 +0200 @@ -0,0 +1,15 @@ +""" + Helper functions for use in templates +""" + +import time + +import config + +def now () : + """ + Returns the current date/time + """ + + return time.strftime(config.DATETIME_FMT) + diff -r 8f143b1ce0d1 -r 9d3beac1b196 lib/page.py --- a/lib/page.py Sat Feb 07 04:44:00 2009 +0200 +++ b/lib/page.py Sat Feb 07 04:57:22 2009 +0200 @@ -14,6 +14,7 @@ import template from page_tree import page_tree +import config # path to directory containing the page heirarcy PAGE_DIR = "pages" @@ -106,7 +107,7 @@ # stat timestamp = os.stat(self.path).st_mtime - return time.strftime("%Y/%m/%d %H:%M %Z", time.gmtime(timestamp)) + return time.strftime(config.DATETIME_FMT, time.gmtime(timestamp)) class HTMLPage (Page) : """ diff -r 8f143b1ce0d1 -r 9d3beac1b196 lib/template.py --- a/lib/template.py Sat Feb 07 04:44:00 2009 +0200 +++ b/lib/template.py Sat Feb 07 04:57:22 2009 +0200 @@ -10,6 +10,8 @@ # for http.ResponseError import http +import helpers + # path to template files TEMPLATE_DIR = "templates" @@ -59,7 +61,13 @@ """ try : - return tpl.render_unicode(**params) + return tpl.render_unicode( + # global helper stuff + h = helpers, + + # render-specific params + **params + ) # a template may render other templates except TemplateError : diff -r 8f143b1ce0d1 -r 9d3beac1b196 pages/foo.html --- a/pages/foo.html Sat Feb 07 04:44:00 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ - -HTML foo! - diff -r 8f143b1ce0d1 -r 9d3beac1b196 pages/list --- a/pages/list Sat Feb 07 04:44:00 2009 +0200 +++ b/pages/list Sat Feb 07 04:57:22 2009 +0200 @@ -1,6 +1,5 @@ : Index -foo : Foo projects : Projects qmsk.net : qmsk.net nr-ttd : Nr-TTD diff -r 8f143b1ce0d1 -r 9d3beac1b196 static/style.css --- a/static/style.css Sat Feb 07 04:44:00 2009 +0200 +++ b/static/style.css Sat Feb 07 04:57:22 2009 +0200 @@ -111,8 +111,17 @@ font-style: italic; } +div#footer-left { + float: left; +} + div#footer-right { float: right; + text-align: right; +} + +div#footer-center { + text-align: center; } /* diff -r 8f143b1ce0d1 -r 9d3beac1b196 templates/layout.tmpl --- a/templates/layout.tmpl Sat Feb 07 04:44:00 2009 +0200 +++ b/templates/layout.tmpl Sat Feb 07 04:57:22 2009 +0200 @@ -36,10 +36,17 @@