comparison default/blog/articles.html @ 115:5d9e2270ceb4

blog/articles, input/navigation: moved navigation template in a dedicated macro
author Goffi <goffi@goffi.org>
date Tue, 30 Jan 2018 07:47:21 +0100
parents 1d0ddeb79903
children c70f405f9b86
comparison
equal deleted inserted replaced
114:1d0ddeb79903 115:5d9e2270ceb4
1 {% if not embedded %}{% extends 'base/base.html' %}{% endif %} 1 {% if not embedded %}{% extends 'base/base.html' %}{% endif %}
2 {% set single = items|length == 1 %} 2 {% set single = items|length == 1 %}
3 {% set dates_format='relative' if single else 'short' %} 3 {% set dates_format='relative' if single else 'short' %}
4 {% import 'blog/macros.html' as blog with context %} 4 {% import 'blog/macros.html' as blog with context %}
5 {% import 'input/navigation.html' as navigation with context %}
5 6
6 {% block title scoped -%} 7 {% block title scoped -%}
7 {%- if single -%} 8 {%- if single -%}
8 {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}} 9 {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}}
9 {%- else -%} 10 {%- else -%}
16 17
17 {% block body %} 18 {% block body %}
18 <div id="blog_items"> 19 <div id="blog_items">
19 {{ blog.show_items(items, expanded=single) }} 20 {{ blog.show_items(items, expanded=single) }}
20 </div> 21 </div>
21 <nav class="bottom_links"> 22
22 <ul> 23 {{ navigation.prev_next(_("newer articles"), _("older articles")) }}
23 {% if newer_url is defined %}
24 <li class="newer_items">
25 <a href="{{newer_url}}">
26 <img src="{{media_path}}icons/tango/actions/32/go-previous.png">
27 {% trans %}newer articles{% endtrans %}
28 </a>
29 </li>
30 {% endif %}
31 {% if older_url is defined %}
32 <li class="older_items">
33 <a href="{{older_url}}">
34 <img src="{{media_path}}icons/tango/actions/32/go-next.png">
35 {% trans %}older articles{% endtrans %}
36 </a>
37 </li>
38 {% endif %}
39 </ul>
40 </nav>
41 {% endblock body %} 24 {% endblock body %}