summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2008-04-05 23:31:53 +0200
committerGuillaume Seguin <guillaume@segu.in>2008-04-05 23:31:53 +0200
commite5f871f82e23f0abf7901273a7067a7027f0decd (patch)
tree5b3d852bfc1dce764e98be5f87f63d8be2195723
parent5ee28f4861b5e7db4634c381a780ada8edb78494 (diff)
downloadmarks-e5f871f82e23f0abf7901273a7067a7027f0decd.tar.gz
marks-e5f871f82e23f0abf7901273a7067a7027f0decd.tar.bz2
* Import templatetags submodule with a helper tag for prettier blocks
-rw-r--r--main/templatetags/__init__.py0
-rw-r--r--main/templatetags/marks_tags.py49
2 files changed, 49 insertions, 0 deletions
diff --git a/main/templatetags/__init__.py b/main/templatetags/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/main/templatetags/__init__.py
diff --git a/main/templatetags/marks_tags.py b/main/templatetags/marks_tags.py
new file mode 100644
index 0000000..c7c931a
--- /dev/null
+++ b/main/templatetags/marks_tags.py
@@ -0,0 +1,49 @@
+# coding=utf-8
+
+'''
+Copyright (C) 2008 Guillaume Seguin <guillaume@segu.in>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+'''
+
+from django import template
+
+register = template.Library ()
+
+@register.simple_tag
+def rounded_block_start (classes, title):
+ return '''<div class="%s">
+ <b class="block-bg">
+ <b class="block-bg1"><b></b></b>
+ <b class="block-bg2"><b></b></b>
+ <b class="block-bg3"></b>
+ <b class="block-bg4"></b>
+ <b class="block-bg5"></b></b>
+
+ <div class="block-bgfg block">
+ <h3>%s</h3>
+''' % (classes, title)
+
+@register.simple_tag
+def rounded_block_end ():
+ return ''' </div>
+
+ <b class="block-bg">
+ <b class="block-bg5"></b>
+ <b class="block-bg4"></b>
+ <b class="block-bg3"></b>
+ <b class="block-bg2"><b></b></b>
+ <b class="block-bg1"><b></b></b></b>
+</div>
+'''