Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions jargon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ lang
Larsson
Latvia
latvia
lcase
leadBy
Lectorate
len
Expand Down Expand Up @@ -193,6 +194,7 @@ pathlib
pdf
PDFs
pe
peertube
PeerTube
peru
ph
Expand Down
24 changes: 18 additions & 6 deletions templates/fediverse-statistics.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{{ template "layout" . }}

{{ define "title" }}Fediverse Statistics - Govdirectory{{ end }}
Expand Down Expand Up @@ -129,18 +128,20 @@ <h2>Platform popularity</h2>
</table>

<h2>Coverage by country</h2>
<p>The table below shows which countries have government organizations using the Fediverse, along with the number of organizations and Fediverse accounts per country.</p>
<p>The table below shows which countries have government organizations using the Fediverse, along with the number of organizations and Fediverse accounts per country. The numbers link to the country in question filtered down to its organizations on the Fediverse.</p>

<table class="statistics-table">
<tr>
<th class="js-sort-none">Country</th>
<th class="js-sort-none">Contains</th>
<th class="js-sort-none">Organizations</th>
<th class="js-sort-none">Accounts</th>
<tr>
</tr>
{{- range . -}}
{{- $country_fediverse_count := 0 -}}
{{- $country_org_count := 0 -}}
{{- /* the Fediverse platforms of the country as a comma separated list for the platform keyword of the country page search */ -}}
{{- $country_platforms := "" -}}
{{- $country := .safeName.String -}}
{{- $orgs := query (join "" "generators/" $country ".rq") -}}
{{- range $orgs -}}
Expand All @@ -150,17 +151,28 @@ <h2>Coverage by country</h2>
{{- if eq .isFediverse.String "true" -}}
{{- $has_fediverse = true -}}
{{- $country_fediverse_count = add1 $country_fediverse_count -}}
{{- /* platform names are normalized the way the search does it, "PeerTube" becomes "peertube" */ -}}
{{- $platform := lcase (re_replace .platformLabel.String "[^A-Za-z0-9]" "") -}}
{{- if not (contains (printf ",%s," $country_platforms) (printf ",%s," $platform)) -}}
{{- if $country_platforms -}}
{{- $country_platforms = printf "%s,%s" $country_platforms $platform -}}
{{- else -}}
{{- $country_platforms = $platform -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if $has_fediverse -}}
{{- $country_org_count = add1 $country_org_count -}}
{{- end -}}
{{- end -}}
{{- if gt $country_org_count 0 -}}
<td lang="{{ .description.Lang }}"><a href="../../{{ .safeName }}/">{{ .name }}</a></td>
{{- $filtered_country_url := printf "../../%s/?query=platform:%s" $country $country_platforms -}}
<tr>
<td lang="{{ .name.Lang }}"><a href="../../{{ .safeName }}/">{{ .name }}</a></td>
<td lang="{{ .description.Lang }}">{{ .description }}</td>
<td>{{ $country_org_count }}</td>
<td>{{ $country_fediverse_count }}</td>
<td><a title="Organizations in {{ .name }} using the Fediverse" href="{{ $filtered_country_url }}">{{ $country_org_count }}</a></td>
<td><a title="Fediverse accounts in {{ .name }}" href="{{ $filtered_country_url }}">{{ $country_fediverse_count }}</a></td>
</tr>
{{- end -}}
{{- end -}}
Expand Down
Loading