changeset 107:8f548b03648a

footers should work with legacy personas now.
author Atul Varma <varmaa@toolness.com>
date Fri, 28 Mar 2008 15:27:08 -0700
parents 5ecef2f8ce69
children 50e8877f3025
files PersonasBackend/personas/views.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/PersonasBackend/personas/views.py	Fri Mar 28 14:50:39 2008 -0700
+++ b/PersonasBackend/personas/views.py	Fri Mar 28 15:27:08 2008 -0700
@@ -18,13 +18,15 @@
 
     if action == "footer":
         img_src = FOOTER_URL % urldict
+        html = '<html><head><style type="text/css">body { margin-top:0; margin-bottom:0; margin-left:0; margin-right:0; background-image: url(%s); background-position: bottom left }</style></head><body></body></html>' % img_src
     elif action == "header":
         img_src = HEADER_URL % urldict
+        html = '<html><head><style type="text/css">body { margin-top:0; margin-bottom:0; margin-left:0; margin-right:0 }</style></head><body><img src="%s" /></body></html>' % img_src
     else:
         return HttpResponseBadRequest( "Invalid or unsupported action: %s" %
                                        action )
 
-    return HttpResponse( '<html><head><style type="text/css">body { margin-top:0; margin-bottom:0; margin-left:0; margin-right:0 }</style></head><body><img src="%s" /></body></html>' % img_src )
+    return HttpResponse( html )
 
 def list_view( request ):
     personas = models.Persona.objects.filter( status="published" )