From 36b5ef48826f720f8a63f0e598ef4f0ced0b6989 Mon Sep 17 00:00:00 2001 From: Johan Castiblanco Date: Fri, 30 Jun 2023 12:02:04 -0500 Subject: [PATCH] feat: positive logic to the stats view By default the view show all components. Then you can manage or filter which component wouldnt be show setting it to false. --- eox_nelp/stats/templates/tenant_stats.html | 10 ++++----- eox_nelp/stats/views.py | 26 +++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/eox_nelp/stats/templates/tenant_stats.html b/eox_nelp/stats/templates/tenant_stats.html index 33b13edf..486c5427 100644 --- a/eox_nelp/stats/templates/tenant_stats.html +++ b/eox_nelp/stats/templates/tenant_stats.html @@ -8,11 +8,11 @@
diff --git a/eox_nelp/stats/views.py b/eox_nelp/stats/views.py index 429a3e7e..3ec1726b 100644 --- a/eox_nelp/stats/views.py +++ b/eox_nelp/stats/views.py @@ -15,25 +15,25 @@ def get_tenant_stats(request): By default this show nothing since this requires the specific query para to show the content. Examples: - renders just video card /eox-nelp/stats/tenant/?showVideos=true + by default the view render all componets: /eox-nelp/stats/tenant/ - render multiple components - /eox-nelp/stats/tenant/?showVideos=true&showCourses=true&showInstructors=true + filter components: eg dont show videos and courses. + /eox-nelp/stats/tenant/?videos=False&courses=false The available options are: - showVideos - showCourses - showLearners - showInstructors - showProblems + videos + courses + learners + instructors + problems """ context = { - "showCourses": "false", - "showVideos": "false", - "showProblems": "false", - "showLearners": "false", - "showInstructors": "false", + "courses": "true", + "videos": "true", + "problems": "true", + "learners": "true", + "instructors": "true", } context.update(request.GET.dict())