Mercurial > libervia-templates
comparison sat_templates/templates/default/blog/articles.html @ 209:d586ea13cfed
blog: fixed setting of title:
title was not show when embedded was True, but this is always the case (articles.html
template is always shown in base.html). A new "blog_page" boolean is set when
articles.html is the main page displayed (i.e. blog posts are not embedded in an other
page like events), and use to display the title, fixing the originally intented behaviour.
fix 298
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 14 Jun 2019 12:49:04 +0200 |
parents | 178f55b825b7 |
children | 40fccd3b7cf0 |
comparison
equal
deleted
inserted
replaced
208:89f940763b02 | 209:d586ea13cfed |
---|---|
1 {% if not embedded %}{% extends 'base/base.html' %}{% endif %} | 1 {# blog_page indicate if blog is included in an other page or if it is the main one #} |
2 {% if not embedded %}{% extends 'base/base.html' %}{% set blog_page = True %}{% endif %} | |
2 {% set single = items|length == 1 %} | 3 {% set single = items|length == 1 %} |
3 {% set dates_format='relative' if single else 'short' %} | 4 {% set dates_format='relative' if single else 'short' %} |
4 {% import 'components/avatar.html' as avatar with context %} | 5 {% import 'components/avatar.html' as avatar with context %} |
5 {% import 'blog/macros.html' as blog with context %} | 6 {% import 'blog/macros.html' as blog with context %} |
6 {% import 'input/navigation.html' as navigation with context %} | 7 {% import 'input/navigation.html' as navigation with context %} |
7 | 8 |
8 {%- block title scoped -%} | 9 {%- block title scoped -%} |
9 {%- if not embedded -%} | 10 {%- if blog_page -%} |
10 {%- if single -%} | 11 {%- if single -%} |
11 {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}} | 12 {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}} |
12 {%- else -%} | 13 {%- else -%} |
13 {{C.APP_NAME}} | 14 {{C.APP_NAME}} |
14 {# {{- super() -}} | 15 {# {{- super() -}} |