Permalink
Browse files

post_helper.tmpl(mako) functions take `post` as parameter to allow

being used in contexts with a global `post` variable.
  • Loading branch information...
1 parent c63775d commit 463c03aced53e7bf9d3e0c6453dc5b8001fe066d @schettino72 schettino72 committed Dec 26, 2012
@@ -7,14 +7,14 @@
<hr>
<small>
${messages[lang]["Posted"]}: ${post.date.strftime(date_format)}
- ${helper.html_translations()}
+ ${helper.html_translations(post)}
&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="${post.pagenames[lang]+'.txt'}">${messages[lang]["Source"]}</a>
- ${helper.html_tags()}
+ ${helper.html_tags(post)}
</small>
<hr>
${post.text(lang)}
- ${helper.html_pager()}
- ${helper.html_disqus()}
+ ${helper.html_pager(post)}
+ ${helper.html_disqus(post)}
</div>
</%block>
@@ -6,7 +6,7 @@
</%def>
-<%def name="html_translations()">
+<%def name="html_translations(post)">
%if len(translations) > 1:
%for langname in translations.keys():
%if langname != lang:
@@ -18,7 +18,7 @@
</%def>
-<%def name="html_tags()">
+<%def name="html_tags(post)">
%if post.tags:
&nbsp;&nbsp;|&nbsp;&nbsp;${messages[lang]["More posts about"]}
%for tag in post.tags:
@@ -28,7 +28,7 @@
</%def>
-<%def name="html_disqus()">
+<%def name="html_disqus(post)">
%if disqus_forum:
<div id="disqus_thread"></div>
<script type="text/javascript">var disqus_shortname="${disqus_forum}";var disqus_url="${post.permalink(absolute=True)}";(function(){var a=document.createElement("script");a.type="text/javascript";a.async=true;a.src="http://"+disqus_shortname+".disqus.com/embed.js";(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a)})(); </script>
@@ -38,7 +38,7 @@
</%def>
-<%def name="html_pager()">
+<%def name="html_pager(post)">
<ul class="pager">
%if post.prev_post:
<li class="previous">
@@ -7,13 +7,13 @@
<hr>
<small>
${messages[lang]["Posted"]}: ${post.date.strftime(date_format)}
- ${helper.html_translations()}
- ${helper.html_tags()}
+ ${helper.html_translations(post)}
+ ${helper.html_tags(post)}
</small>
<hr>
${post.text(lang)}
- ${helper.html_pager()}
- ${helper.html_disqus()}
+ ${helper.html_pager(post)}
+ ${helper.html_disqus(post)}
</div>
</%block>

0 comments on commit 463c03a

Please sign in to comment.