# HG changeset patch # User Goffi # Date 1560509344 -7200 # Node ID d586ea13cfedf34cfc54bc18d0b69f92ae3f6c38 # Parent 89f940763b022396ccf9157e6f9c031faceaeea3 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 diff -r 89f940763b02 -r d586ea13cfed sat_templates/templates/default/base/base.html --- a/sat_templates/templates/default/base/base.html Fri Jun 14 12:43:47 2019 +0200 +++ b/sat_templates/templates/default/base/base.html Fri Jun 14 12:49:04 2019 +0200 @@ -1,4 +1,5 @@ -{% set embedded = True %} {# embedded is set to avoid including base.html several times if a generic page is included (e.g. blog/articles.html) #} + {# embedded is set to avoid including base.html several times if a generic page is included (e.g. blog/articles.html) #} +{% set embedded = True %} {% import 'components/common.html' as component with context %} {{ script.include('common', '') }} {# common.js is, as its name state, a common script, so it's useful to import it here #} {{ script.include('dom_update') }} {# will check page for dom element to modify when javascript is enabled #} diff -r 89f940763b02 -r d586ea13cfed sat_templates/templates/default/blog/articles.html --- 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 -%}