Merge pull request 'Display all badges on all services, including the ones that are undefined' (#73) from benjaoming/website:badge-undefined into new

Reviewed-on: data.coop/website#73
This commit is contained in:
benjaoming 2023-04-02 21:28:53 +00:00
commit 2f40c9c518
3 changed files with 16 additions and 4 deletions

View file

@ -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"

View file

@ -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;

View file

@ -11,15 +11,17 @@
{{ range $translated_badges.badges.active_badges }}
{{- $badge := index $translated_badges.badges.badges . }}
{{- $status := index $page_params.service_badges . -}}
<div class="badge-icon badge-status-{{ $status }}">
{{- $status_name := default "none" (index $page_params.service_badges .) -}}
{{- $status := index $translated_badges.status.status $status_name -}}
<div class="badge-icon badge-status-{{ $status_name }}">
{{ $svg := printf "static/static/img/badges/%s" $badge.icon }}
{{ $svg | readFile | safeHTML }}
</div>
<div class="badge-name">
{{ title $badge.name }}<br>
= {{ i18n ($status | printf "service_badges_status_%s") }}
= {{ $status.name }}
</div>