Permalink
Browse files

Merge branch 'master' of github.com:ralsina/nikola

  • Loading branch information...
2 parents d772c7e + 3a13a86 commit aeb6d44b64b1d02e5d381fe006d40ec8f961069a @ralsina committed Dec 27, 2012
View
@@ -1 +1,2 @@
Roberto Alsina <ralsina@kde.org>
+Eduardo Schettino <https://github.com/schettino72>
@@ -1,4 +1,5 @@
## -*- coding: utf-8 -*-
+<%namespace name="helper" file="index_helper.tmpl"/>
<%inherit file="base.tmpl"/>
<%block name="content">
% for post in posts:
@@ -9,28 +10,9 @@
</small></h1>
<hr>
${post.text(lang, index_teasers)}
- <p>
- %if disqus_forum:
- <a href="${post.permalink()}#disqus_thread">Comments</a>
- %endif
+ ${helper.html_disqus_link(post)}
</div>
% endfor
- <div>
-<ul class="pager">
- %if prevlink:
- <li class="previous">
- <a href="${prevlink}">&larr; ${messages[lang]["Newer posts"]}</a>
- </li>
- %endif
- %if nextlink:
- <li class="next">
- <a href="${nextlink}">${messages[lang]["Older posts"]} &rarr;</a>
- </li>
- %endif
-</ul>
-
- </div>
- %if disqus_forum:
- <script type="text/javascript">var disqus_shortname="${disqus_forum}";(function(){var a=document.createElement("script");a.async=true;a.type="text/javascript";a.src="http://"+disqus_shortname+".disqus.com/count.js";(document.getElementsByTagName("HEAD")[0]||document.getElementsByTagName("BODY")[0]).appendChild(a)}());</script>
- %endif
+ ${helper.html_pager()}
+ ${helper.html_disqus_script()}
</%block>
@@ -0,0 +1,31 @@
+<%def name="html_pager()">
+<div>
+<ul class="pager">
+ %if prevlink:
+ <li class="previous">
+ <a href="${prevlink}">&larr; ${messages[lang]["Newer posts"]}</a>
+ </li>
+ %endif
+ %if nextlink:
+ <li class="next">
+ <a href="${nextlink}">${messages[lang]["Older posts"]} &rarr;</a>
+ </li>
+ %endif
+</ul>
+</div>
+</%def>
+
+
+<%def name="html_disqus_link(post)">
+ <p>
+ %if disqus_forum:
+ <a href="${post.permalink()}#disqus_thread">Comments</a>
+ %endif
+</%def>
+
+
+<%def name="html_disqus_script()">
+ %if disqus_forum:
+ <script type="text/javascript">var disqus_shortname="${disqus_forum}";(function(){var a=document.createElement("script");a.async=true;a.type="text/javascript";a.src="http://"+disqus_shortname+".disqus.com/count.js";(document.getElementsByTagName("HEAD")[0]||document.getElementsByTagName("BODY")[0]).appendChild(a)}());</script>
+ %endif
+</%def>
@@ -3,34 +3,18 @@
<%inherit file="base.tmpl"/>
<%block name="content">
<div class="postbox">
- <h1><a href='${permalink}'>${title}</a></h1>
- % if link:
- <p><a href='${link}'>${messages[lang]["Original site"]}</a></p>
- % endif
+ ${helper.html_title()}
<hr>
<small>
- ${messages[lang]["Posted"]}: ${post.date.strftime(date_format)}&nbsp;&nbsp;|&nbsp;&nbsp;
-
- %if len(translations) > 1:
- %for langname in translations.keys():
- %if langname != lang:
- <a href="${post.permalink(langname)}">${messages[langname][u"Read in English"]}</a>
- &nbsp;&nbsp;|&nbsp;&nbsp;
- %endif
- %endfor
- %endif
-
- <a href="${post.pagenames[lang]+".txt"}">${messages[lang]["Source"]}</a>
- %if post.tags:
- &nbsp;&nbsp;|&nbsp;&nbsp;${messages[lang]["More posts about"]}
- %for tag in post.tags:
- <a href="${_link("tag", tag, lang)}"><span class="badge badge-info">${tag}</span></a>
- %endfor
- %endif
+ ${messages[lang]["Posted"]}: ${post.date.strftime(date_format)}
+ ${helper.html_translations(post)}
+ &nbsp;&nbsp;|&nbsp;&nbsp;
+ <a href="${post.pagenames[lang]+'.txt'}">${messages[lang]["Source"]}</a>
+ ${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>
@@ -1,5 +1,34 @@
+<%def name="html_title()">
+ <h1>${title}</h1>
+ % if link:
+ <p><a href='${link}'>${messages[lang]["Original site"]}</a></p>
+ % endif
+</%def>
+
+
+<%def name="html_translations(post)">
+ %if len(translations) > 1:
+ %for langname in translations.keys():
+ %if langname != lang:
+ &nbsp;&nbsp;|&nbsp;&nbsp;
+ <a href="${post.permalink(langname)}">${messages[langname]["Read in English"]}</a>
+ %endif
+ %endfor
+ %endif
+</%def>
+
-<%def name="html_disqus()">
+<%def name="html_tags(post)">
+ %if post.tags:
+ &nbsp;&nbsp;|&nbsp;&nbsp;${messages[lang]["More posts about"]}
+ %for tag in post.tags:
+ <a class="tag" href="${_link('tag', tag, lang)}"><span class="badge badge-info">${tag}</span></a>
+ %endfor
+ %endif
+</%def>
+
+
+<%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>
@@ -8,7 +37,8 @@
%endif
</%def>
-<%def name="html_pager()">
+
+<%def name="html_pager(post)">
<ul class="pager">
%if post.prev_post:
<li class="previous">
@@ -6,7 +6,7 @@
<h1>${title}</h1>
<ul class="unstyled">
% for text, link in items:
- <li><a href="${link}"><span class="badge badge-info">${text}</span></a>
+ <li><a class="tag" href="${link}"><span class="badge badge-info">${text}</span></a>
% endfor
</ul>
<!--End of body content-->
@@ -3,33 +3,17 @@
<%inherit file="base.tmpl"/>
<%block name="content">
<div class="postbox">
- <h1>${title}</h1>
- % if link:
- <p><a href='${link}'>${messages[lang]["Original site"]}</a></p>
- % endif
+ ${helper.html_title()}
<hr>
<small>
${messages[lang]["Posted"]}: ${post.date.strftime(date_format)}
-
- %if len(translations) > 1:
- %for langname in translations.keys():
- %if langname != lang:
- &nbsp;&nbsp;|&nbsp;&nbsp;
- <a href="${post.permalink(langname)}">${messages[langname]["Read in English"]}</a>
- %endif
- %endfor
- %endif
- %if post.tags:
- &nbsp;&nbsp;|&nbsp;&nbsp;${messages[lang]["More posts about"]}
- %for tag in post.tags:
- <a href="${_link("tag", tag, lang)}"><span class="badge badge-info">${tag}</span></a>
- %endfor
- %endif
+ ${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 aeb6d44

Please sign in to comment.