diff 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
line wrap: on
line diff
--- a/sat_templates/templates/default/blog/articles.html	Fri Jun 14 12:43:47 2019 +0200
+++ b/sat_templates/templates/default/blog/articles.html	Fri Jun 14 12:49:04 2019 +0200
@@ -1,4 +1,5 @@
-{% if not embedded %}{% extends 'base/base.html' %}{% endif %}
+{# blog_page indicate if blog is included in an other page or if it is the main one #}
+{% if not embedded %}{% extends 'base/base.html' %}{% set blog_page = True %}{% endif %}
 {% set single = items|length == 1 %}
 {% set dates_format='relative' if single else 'short' %}
 {% import 'components/avatar.html' as avatar with context %}
@@ -6,7 +7,7 @@
 {% import 'input/navigation.html' as navigation with context %}
 
 {%- block title scoped -%}
-    {%- if not embedded -%}
+    {%- if blog_page -%}
         {%- if single -%}
             {{- items[0].title|default(items[0].content, true)|truncate(60, True, '…') + ' - ' + C.APP_NAME -}}
         {%- else -%}