Takwimu is a free and open development information service, transforming access to high quality analysis and data for African changemakers. Accessible at https://takwimu.africa/
Chart.js has hard-coded paths to static files e.g. /static/img/network-connections.svg, which 404 in production due to the use of S3. This PR fixes that by:
[x] Introduce STATIC_PREFIX JavaScript variable that will hold the value of {% get_static_prefix %} django template variable, and
[x] Uses STATIC_PREFIX variable in referencing all static assets in Chart.js.
Type of change
[x] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
Screenshots
N/A
Checklist:
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
Description
Chart.js
has hard-coded paths to static files e.g./static/img/network-connections.svg
, which 404 in production due to the use ofS3
. This PR fixes that by:STATIC_PREFIX
JavaScript variable that will hold the value of{% get_static_prefix %}
django template variable, andSTATIC_PREFIX
variable in referencing all static assets inChart.js
.Type of change
Screenshots
N/A
Checklist: