comparison default/blog/articles.html @ 111:e1a0d5678837

blog/articles: don't use super() in title block for now, it crashes if parent is not base/base.html
author Goffi <goffi@goffi.org>
date Wed, 24 Jan 2018 20:24:09 +0100
parents 7108731be0b9
children e96a3e09d4e9
comparison
equal deleted inserted replaced
110:81f4ba3b121b 111:e1a0d5678837
1 {% if not embedded %}{% extends 'base/base.html' %}{% endif %} 1 {% if not embedded %}{% extends 'base/base.html' %}{% endif %}
2 {% set dates_format='relative' %} 2 {% set dates_format='relative' %}
3 {% import 'blog/macros.html' as blog with context %} 3 {% import 'blog/macros.html' as blog with context %}
4 4
5 {% block title -%} 5 {% block title scoped -%}
6 {%- if not embedded -%} 6 {%- if items|length == 1 -%}
7 {%- if items|length == 1 -%} 7 {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}}
8 {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}} 8 {%- else -%}
9 {%- else -%} 9 {{C.APP_NAME}}
10 {{- super() -}} 10 {# {{- super() -}}
11 {%- endif -%} 11 FIXME: super() is failing if blog is embedded (i.e. base/base.html is not its direct parent)
12 not sure what's the best way to avoid that, so just using C.APP_NAME for now #}
12 {%- endif -%} 13 {%- endif -%}
13 {%- endblock title -%} 14 {%- endblock title -%}
14 15
15 {% block body %} 16 {% block body %}
16 <div id="blog_items"> 17 <div id="blog_items">