Link to merge request: https://gitlab.com/sflcin/internetshutdowns.in/-/merge_requests/1
The current internetshutdowns.in website features a report of year-wise shutdowns with the map showing the total count for these shutdowns. The issue I picked up was titled- "Clicking on the number In the “India’s Shutdown Numbers” box does not provide a separate map of all the instances occurring in that year (Issue #5)."
My goal was to make the years interactive- on clicking the years, only the data of that particular map was to be fetched on the map. I spent some time understanding the MVT (Model View Template) structure of this project. After figuring out which functions links to fetching of data on map as well as in the side panel, I created some dummy data and worked further with it.
These are the final changes I applied in the map app-
1) Changed the urls.py to include a new path get-Shutdowns-YearWise.
2) Edited the views.py (defined a function getShutdownYearWise) so that the year data is fetched from the user-side, stored in a session and passed to the map. Also edited the getAllShutdowns function such that when a year is clicked, only the necessary data is filtered onto the map. Else, there is a default view of all countries.
3) Edited the yearwiseshutdowns.js to make the year-circles interactive, when clicked they pass the year to views.py. I did this using the CSRF token and a POST request.