From 001a545fceaf0511a5df90b8d0d4cdd9cea70007 Mon Sep 17 00:00:00 2001 From: Jan Ainali Date: Fri, 10 Jan 2025 18:08:37 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20orgs=20and=20contact=20points?= =?UTF-8?q?=20per=20country=20to=20stats?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #254 --- jargon.txt | 1 + templates/statistics.html | 43 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/jargon.txt b/jargon.txt index 17e7f61d51..706e85800e 100644 --- a/jargon.txt +++ b/jargon.txt @@ -38,6 +38,7 @@ contactPage countryID countryLabel countryURI +cp cron crowdsourced csv diff --git a/templates/statistics.html b/templates/statistics.html index e8b57f85f5..2aa3c09e98 100644 --- a/templates/statistics.html +++ b/templates/statistics.html @@ -79,12 +79,49 @@

Coverage overview

In the table below we have listed the types of organizations that are covered for each country. The amount of information about those organizations and contact points for them varies and is also improved over time.

- {{- range . -}} - + + + + + + {{- range . -}} + {{- $social_cp_count := 0 -}} + {{- $other_cp := 0 -}} + {{- $country_org_count := 0 -}} + {{- $country := .safeName.String -}} + {{- $orgs := query (join "" "generators/" $country ".rq") -}} + {{- $country_org_count = add (len $orgs) $country_org_count -}} + {{- range $orgs -}} + {{ $social_cp_count = add (len (query "account-data.rq" .qid.String)) $social_cp_count }} + {{- $org_details := index (query "organization-optional.rq" .qid.String) 0 -}} + + {{- if $org_details.email -}} + {{- $other_cp = add1 $other_cp -}} + {{- end -}} + + {{- if $org_details.website -}} + {{- $other_cp = add1 $other_cp -}} + {{- end -}} + + {{- if $org_details.phone -}} + {{- $other_cp = add1 $other_cp -}} + {{- end -}} + + {{- if $org_details.contactPage -}} + {{- $other_cp = add1 $other_cp -}} + {{- end -}} + + {{- if $org_details.citizensInitiatives -}} + {{- $other_cp = add1 $other_cp -}} + {{- end -}} + {{- end -}} + - + + {{- end -}} +
{{ .name }}CountryContainsOrganizationsContact points
{{ .name }} {{ .description }}
{{ $country_org_count }}{{ add $social_cp_count $other_cp }}