Repository: comic/grand-challenge.org

Issue:
Update statistics_detail.html
The terminology in the stats paged could maybe be improved a bit. 

- [x] Use "private" rather than "hidden"
- [x] Separate reader studies to public/private
- [x] Truncate the microseconds in the duration (maybe add a reusable filter for duration formatting)
- [x] Add algorithm runs in the last 30 days
- [x] Remove Number of



Discussion:

Resolving patch:
diff --git a/app/grandchallenge/core/templatetags/naturaldelta.py b/app/grandchallenge/core/templatetags/naturaldelta.py
new file mode 100644
--- /dev/null
+++ b/app/grandchallenge/core/templatetags/naturaldelta.py
@@ -0,0 +1,11 @@
+import humanize
+from django import template
+from django.template.defaultfilters import stringfilter
+
+register = template.Library()
+
+
+@register.filter
+@stringfilter
+def naturaldelta(value):
+    return humanize.naturaldelta(value, months=False)
diff --git a/app/grandchallenge/statistics/views.py b/app/grandchallenge/statistics/views.py
--- a/app/grandchallenge/statistics/views.py
+++ b/app/grandchallenge/statistics/views.py
@@ -12,7 +12,8 @@
 from rest_framework.views import APIView
 
 from grandchallenge.algorithms.models import Algorithm, Job
-from grandchallenge.cases.models import RawImageUploadSession
+from grandchallenge.archives.models import Archive
+from grandchallenge.cases.models import Image, RawImageUploadSession
 from grandchallenge.challenges.models import Challenge
 from grandchallenge.evaluation.models import (
     Job as EvaluationJob,
@@ -110,20 +111,36 @@ def get_context_data(self, **kwargs):
             "public_algorithms": (
                 Algorithm.objects.filter(public=True).count()
             ),
-            "hidden_algorithms": (
+            "private_algorithms": (
                 Algorithm.objects.filter(public=False).count()
             ),
             "algorithm_jobs": Job.objects.count(),
-            "reader_studies": ReaderStudy.objects.count(),
+            "algorithm_jobs_period": Job.objects.filter(
+                created__gt=time_period
+            ).count(),
+            "public_reader_studies": ReaderStudy.objects.filter(
+                public=True
+            ).count(),
+            "private_reader_studies": ReaderStudy.objects.filter(
+                public=False
+            ).count(),
             "questions": Question.objects.count(),
             "answers": Answer.objects.count(),
-            "workstations": Workstation.objects.count(),
+            "public_workstations": Workstation.objects.filter(
+                public=True
+            ).count(),
+            "private_workstations": Workstation.objects.filter(
+                public=False
+            ).count(),
             "workstation_sessions": Session.objects.count(),
             "total_session_duration": (
                 Session.objects.aggregate(Sum("maximum_duration"))[
                     "maximum_duration__sum"
                 ]
             ),
+            "public_archives": Archive.objects.filter(public=True).count(),
+            "private_archives": Archive.objects.filter(public=False).count(),
+            "images": Image.objects.count(),
         }
 
         context.update(extra)


Test patch: