From bf4b4e27704fb7d781caefe05fd5b33890c28f98 Mon Sep 17 00:00:00 2001 From: Benjamin Bach Date: Sun, 2 Apr 2023 23:16:34 +0200 Subject: [PATCH] Display all badges on all services, including the ones that are undefined --- data/badges/da/status.yaml | 7 ++++++- themes/datacoop2020/assets/static/css/style.scss | 5 +++++ themes/datacoop2020/layouts/services/single.html | 8 +++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/data/badges/da/status.yaml b/data/badges/da/status.yaml index 0cd1120..b425a04 100644 --- a/data/badges/da/status.yaml +++ b/data/badges/da/status.yaml @@ -6,7 +6,7 @@ status: css_class: "positive" partial: - name: Delvis + name: delvis description: Tjenesten lever delvist op til det badget dækker over. Dog i en sådan grad at vi mener det er værd at fremhæve. css_class: "partial" @@ -15,3 +15,8 @@ status: description: Tjenesten lever ikke op til det badget dækker over. css_class: "negative" + none: + name: uoplyst + description: Dette badge er udefineret for denne tjeneste. Dette skyldes sansynligvis, at vi mangler en klar redegørelse. + css_class: "none" + diff --git a/themes/datacoop2020/assets/static/css/style.scss b/themes/datacoop2020/assets/static/css/style.scss index c06f291..4901b27 100644 --- a/themes/datacoop2020/assets/static/css/style.scss +++ b/themes/datacoop2020/assets/static/css/style.scss @@ -327,6 +327,11 @@ dl.dl-services, border: 5px solid #cc4; } +.badge-status-none { + @extend .badge-status; + border: 5px solid #888; +} + @media(max-width:1000px) { :root { --base-grid : 40px; diff --git a/themes/datacoop2020/layouts/services/single.html b/themes/datacoop2020/layouts/services/single.html index 14a54fe..baea739 100644 --- a/themes/datacoop2020/layouts/services/single.html +++ b/themes/datacoop2020/layouts/services/single.html @@ -11,15 +11,17 @@ {{ range $translated_badges.badges.active_badges }} {{- $badge := index $translated_badges.badges.badges . }} - {{- $status := index $page_params.service_badges . -}} -
+ {{- $status_name := default "none" (index $page_params.service_badges .) -}} + {{- $status := index $translated_badges.status.status $status_name -}} + +
{{ $svg := printf "static/static/img/badges/%s" $badge.icon }} {{ $svg | readFile | safeHTML }}
{{ title $badge.name }}
- = {{ i18n ($status | printf "service_badges_status_%s") }} + = {{ $status.name }}