Skip to content

Commit af5ad22

Browse files
author
Dmytro Trotsko
committed
Removed indicators table, added chart mockup
1 parent 13a6a5a commit af5ad22

File tree

4 files changed

+296
-506
lines changed

4 files changed

+296
-506
lines changed

src/alternative_interface/views.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from django.shortcuts import render
22
from indicators.models import Indicator
3-
from base.models import Pathogen
3+
from base.models import Pathogen, Geography
44

55

66
HEADER_DESCRIPTION = "Discover, display and download real-time infectious disease indicators (time series) that track a variety of pathogens, diseases and syndromes in a variety of locations (primarily within the USA). Browse the list, or filter it first by locations and pathogens of interest, by surveillance categories, and more. Expand any row to expose and select from a set of related indicators, then hit 'Show Selected Indicators' at bottom to plot or export your selected indicators, or to generate code snippets to retrieve them from the Delphi Epidata API. Most indicators are served from the Delphi Epidata real-time repository, but some may be available only from third parties or may require prior approval."
@@ -18,16 +18,28 @@ def alternative_interface_view(request):
1818
)
1919
)
2020

21-
# Get pathogen filter from URL parameters
21+
# Fetch geographies for dropdown
22+
ctx["geographies"] = list(
23+
Geography.objects.filter(used_in="indicatorsets").order_by(
24+
"display_order_number"
25+
)
26+
)
27+
28+
# Get filters from URL parameters
2229
pathogen_filter = request.GET.get("pathogen", "")
30+
geography_filter = request.GET.get("geography", "")
2331
ctx["selected_pathogen"] = pathogen_filter
32+
ctx["selected_geography"] = geography_filter
2433

25-
# Build queryset with optional pathogen filtering
26-
indicators_qs = Indicator.objects.prefetch_related("pathogens").all()
34+
# Build queryset with optional filtering
35+
indicators_qs = Indicator.objects.prefetch_related("pathogens", "available_geographies").all()
2736

2837
if pathogen_filter:
2938
indicators_qs = indicators_qs.filter(pathogens__id=pathogen_filter)
3039

40+
if geography_filter:
41+
indicators_qs = indicators_qs.filter(available_geographies__id=geography_filter)
42+
3143
# Convert to list of dictionaries
3244
ctx["indicators"] = [
3345
{

0 commit comments

Comments
 (0)