Support for generating blocks.

portnov [2008-06-05 15:59:12]
Support for generating blocks.
Filename
modules/blocks.py
diff --git a/modules/blocks.py b/modules/blocks.py
index e2dc5ac..78d7033 100644
--- a/modules/blocks.py
+++ b/modules/blocks.py
@@ -1,4 +1,23 @@

 def init():

+  print "Blocks module loaded."

+  block = generates('block')
+  export_as(block,'block')
+
+  @themeable
+  def block(blk):
+    return """<div class='block'>
+    <h3>%s</h3>
+    <div class='content'>
+    %s
+    </div>
+    </div>""" % (blk.title,blk.content)
+
+  class Block(Generated):
+    name = "Block"
+    title = "<none>"
+    content = "<empty>"
+    def show(self):
+      return theme('block', self)
ViewGit