Closed noirbee closed 7 years ago
Hi, sorry for the lateness but I was offline for a couple of weeks, I like this approach to add config variables to the widgets, and the code looks good, please add the documentation to proceed with the merge of this pull request.
And here are the updated docs !
looks good, thanks :)
I did not get the map widget to work without adding a Google Maps API key to the JS script loading function, hence this PR.
It's implemented using an additional settings key,
WIDGET_CONFIGS
, to hold the API key, because as I understand it it's not possible to have it indashing-config.js
since the Google Maps javascript has already been loaded earlier indashing.js
. I added a new template tag,widget_configs
, similar to the existing styles and scripts tags, since once again I saw no over simpler way to do it.If you agree with the way this is implemented I'll go about updating the docs as well to explain how the new settings key must be used (it's basically a widget name -> {key, value} dict that ends pushed down as
<script>
snippets inbase.html
).