From d9cdbafc73e91ff4574a01aba7dab151a21ec32c Mon Sep 17 00:00:00 2001 From: alexisben <alex@noesya.coop> Date: Thu, 30 Mar 2023 12:48:56 +0200 Subject: [PATCH] hotfix: handle empty key figures --- .../blocks/templates/key_figures.html | 30 ++++++++++--------- layouts/partials/footer/debug.html | 2 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/layouts/partials/blocks/templates/key_figures.html b/layouts/partials/blocks/templates/key_figures.html index c4efe36b..8e43c02f 100644 --- a/layouts/partials/blocks/templates/key_figures.html +++ b/layouts/partials/blocks/templates/key_figures.html @@ -21,20 +21,22 @@ </div> {{ end -}} - {{ $list_class := "odd-items" }} - {{ if (modBool (len $figures) 2) }} - {{ $list_class = "even-items" }} - {{ end }} - <ul class="{{ $list_class }}"> - {{- range .figures }} - <li> - <dl> - <dt><strong>{{ .number }}</strong>{{ partial "PrepareHTML" .unit }}</dt> - <dd>{{ partial "PrepareHTML" .description }}</dd> - </dl> - </li> - {{ end -}} - </ul> + {{ if $figures }} + {{ $list_class := "odd-items" }} + {{ if (modBool (len $figures) 2) }} + {{ $list_class = "even-items" }} + {{ end }} + <ul class="{{ $list_class }}"> + {{- range .figures }} + <li> + <dl> + <dt><strong>{{ .number }}</strong>{{ partial "PrepareHTML" .unit }}</dt> + <dd>{{ partial "PrepareHTML" .description }}</dd> + </dl> + </li> + {{ end -}} + </ul> + {{ end -}} </div> </div> </section> diff --git a/layouts/partials/footer/debug.html b/layouts/partials/footer/debug.html index ea1cd83f..bb2359ce 100644 --- a/layouts/partials/footer/debug.html +++ b/layouts/partials/footer/debug.html @@ -42,7 +42,7 @@ top: 0; left: 50%; transform: translateX(-50%); - width: calc(1920px + var(--d-grid-margin)); + width: calc(1680px + var(--d-grid-margin)); z-index: 9999; font-family: sans-serif; font-size: 12px; -- GitLab