From e84e77bb28d07d64152a75ebf846b9b565aa584a Mon Sep 17 00:00:00 2001 From: Iain Learmonth Date: Sat, 14 May 2022 11:57:16 +0100 Subject: [PATCH] portal: handle zero origins division --- app/portal/templates/home.html.j2 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/portal/templates/home.html.j2 b/app/portal/templates/home.html.j2 index 5ad6c30..325f880 100644 --- a/app/portal/templates/home.html.j2 +++ b/app/portal/templates/home.html.j2 @@ -53,6 +53,7 @@

Onion Services

Onionification progress:
+ {% if total_origins > 0 %}

{{ onionified }}/{{ total_origins }}

{{ (onionified / total_origins * 100) | int }}%
+ {% else %} +

No origins configured.

+ {% endif %}
@@ -70,14 +74,18 @@

OONI

Origins with censorship detected:
+ {% if total_origins > 0 %}

{{ ooni_blocked }}/{{ total_origins }}

-
{{ (ooni_blocked / total_origins * 100) | int }}%
+ {% else %} +

No origins configured.

+ {% endif %}